I am converting a grayscale signature image to thin image but not getting the desired output
1 回表示 (過去 30 日間)
古いコメントを表示
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149178/image.png)
after applying the im2bw(img,graythresh(img)) function i get the following image
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149179/image.png)
but the image is not smooth enough after applying thining on the said image i get the following
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149181/image.png)
so how to get rid of extra roots from the thin image and get smooth signature skeleton
0 件のコメント
採用された回答
Anand
2015 年 9 月 17 日
It looks like you need to clean up the binary image a little before thinning.
This worked for me:
bw = im2bw(img,graythresh(img));
% remove some of the noisy edges in the mask.
bw_clean = imopen(bw, strel('disk',1));
% remove small foreground objects.
bw_clean = bwareaopen(bw_clean, 25);
% invert the image and thin it.
bw_thin = bwmorph(imcomplement(bw_clean), 'thin', Inf);
9 件のコメント
Image Analyst
2015 年 9 月 18 日
imfill() will fill completely surrounded holes and leave exterior boundaries unchanged. imclose() will fill interior holes and will smooth out exterior boundaries.
Image Analyst
2015 年 9 月 18 日
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!