| unfollow - converts a parametric contour into a binary image |
Img = unfollow(x,y,dims) |
| x and y |
| vectors, storing the parametrized contour. They are truncated before calculation. |
| dims |
| vector [row, column] storing the dimensions of the output Image. This has to be consistent with the size of the resulting contour. |
| Img |
| binary array, 1 for object and 0 for background (double precision) |
| 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: |
| x = col - 1 y = dims(1) - row |
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);
|
| 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, gsm, curvature |