<< KRC_from_P SIP - Scilab Image Processing Toolbox bwborder >>

SIP - Scilab Image Processing Toolbox >> SIP - Scilab Image Processing Toolbox > arclength

arclength

Arc length function of a sampled curve

Calling Sequence

s = arclength(crv)
s = arclength(crv, circular)

Parameters

crv
nx2 curve vector [x y]
circular
boolean, %t if curve is to be treated as circular. Defaults to %f.
s
vector containing the estimated arclength at each sample point x(i),y(i) from x(0),y(0). Thus s(1) == 0.

Description

This function computes the numerical arclength at each sample of a curve, as measured from the first sample. The method implicitly interpolates the curve using line segments between each sample.

Examples

initial_dir = PWD;
chdir (SIPDIR + 'images');

Img = imread('star.bmp');
clf
imshow(Img,2);

[x,y] = follow(Img);

s = arclength([x y], %t);

// plot arc length vs sample id to get an idea of the difference
clf;
plot(s);
a = gca();
a.isoview = 'on';

// the last element should equal the perimeter
s($), perim(Img)

chdir(initial_dir);

Authors

Availability

The latest version of the Scilab Image Processing toolbox can be found at

http://siptoolbox.sourceforge.net

See Also


<< KRC_from_P SIP - Scilab Image Processing Toolbox bwborder >>