Name

thin — thinning by border deletion

Calling Sequence

out = thin(img)

Parameters

img
Binary image containing one or more binary shapes. (foreground == 1, background == 0),
out
Internal skeleton, thinned version of the shapes in the input image.

Description

Function thin performs thinning of binary objects. It uses the Zhang-Suen, a de facto standard and simple technique. The resulting image, the skeleton, is not always connected and is very sensible to noise. It is also slower than a good skeletonization algorithm (see skel). For thin shapes, it should work faster and provide better quality. You will need some pruning criterium to eliminate spurs.

Examples

       im=gray_imread(SIPDIR+'images/r.gif');
       imshow(im,2);

       skl = thin(im);

       xbasc();
       imshow(im+skl,[]);

       // Quality is definitely inferior to that of good skeletonization
       // methods, as in the following test

       im=gray_imread(SIPDIR+'images/escher.png');
       skl = thin(im);      // Ordinary thinning
       xbasc();
       xset('wdim',400,500);
       subplot(1,2,1);
       imshow(im+skl,[]);
       xset('wdim',800,400);

       skl = skel(im);      // multiscale euclidean skeletonization
       subplot(1,2,2);
       imshow(im+(skl >= 10),[]);
       xset('wdim',800,400);
   

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

skel