unfollow - Converts a parametric contour into a binary image
Function unfollow plots a contour from its parametric representation into a binary image. This operation is the reverse of the follow function.
x and y both store the parametrized contour. That is, (x(i),y(i)) is a point of the contour, where the coordinate system is assumed as starting from bottom-left corner (0,0) to uper-right corner of the image. To get (x,y) coordinates from (row,col) matrix coordinates, use the transformation below:
initial_dir = PWD; chdir (SIPDIR + 'images'); Img = imread('star.bmp'); xset('window',0); xbasc() imshow(Img,2); [x,y] = follow(Img); xbasc() xsm = gsm(x,15); ysm = gsm(y,15); Img2=unfollow(xsm,ysm,size(Img)); xbasc() imshow(Img2,2); chdir(initial_dir);
http://siptoolbox.sourceforge.net