perim - perimeter of binary shape |
p = perim(Img) |
Img |
binary array, 1 for object and 0 for background (double precision) |
p |
approximate perimeter of the shape inside Img |
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). |
initial_dir = PWD; chdir (SIPDIR + 'images'); Img = imread('star.bmp'); xbasc() imshow(Img,2); p = perim(Img) chdir(initial_dir); |
Images are stored in double precision matrices. Hopefully, the next release will make usage of integer types. |
Ricardo Fabbri <rfabbri@if.sc.usp.br> |
The latest version of the Scilab Image Processing toolbox can be found at |
http://siptoolbox.sourceforge.net |
follow, bwborder, edge, im2bw |