Arc length function of a sampled curve

s = arclength(crv)

s = arclength(crv, circular)

- 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.

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.

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); |

- Ricardo Fabbri <ricardofabbri (AT) users DOT sf DOT net>

http://siptoolbox.sourceforge.net