Name

perim — Perimeter of binary shape

Calling Sequence

p = perim(Img)

Parameters

Img
binary array, 1 for object and 0 for background (double precision)
p
approximate perimeter of the shape inside Img

Description

This is a simple routine to measure the perimeter of a 2D shape. It assumes border pixels as a polygonal line: adjacent border pixels has measure size 1 or sqrt(2).

Examples

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

       Img = imread('star.bmp');
       xbasc()
       imshow(Img,2);
       p = perim(Img)

       chdir(initial_dir);
   

Authors

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

Availability

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

http://siptoolbox.sourceforge.net

See Also

follow , bwborder , edge , im2bw