thinning by border deletion
out = thin(img)
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.
im=gray_imread(SIPDIR+'images/r.gif'); imshow(im,2); skl = thin(im); clf; 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 clf; 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);