edge detection and linking
显示 更早的评论
Hello, I am doing contour detection using Canny Edge detection and I am trying to fill the broken edges and struggling to do that. please anyone can post some solutions or ideas. this is the original image and then the result.. my original aim is to find the external contour only.


回答(1 个)
Image Analyst
2014-9-13
2 个投票
Professor Peter Kovesi's site has edge linking code: http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/#edgelink
3 个评论
Image Analyst
2014-9-13
To get the outer contour, you might also try activecontour(). Demo attached.
Image Analyst
2014-9-14
Sader's "Answer" moved here since it's a reply to me and not an "Answer" to the original question:
thanks for your answer but the first code does not do link edge but outlining all disconnected edges in different colors as I have tried it before and you can see his result.
the second code does not have any thing with what I have asked.. please any other solution or can you please apply the code on the deers and let me know.
I=imread('test03.jpg');
figure, imshow(I);
title('original image');
YCBCR=rgb2ycbcr(I);
Y=I(:,:,1);
sigma=1.5;
BW1=edge(Y,'canny',[0.1 0.4],sigma,'Thinning');
figure, imshow(BW1);
Image Analyst
2014-9-14
Not sure why you don't see how active contours apply, but anyway another option is to use imclose() to close the gaps. Not sure what you want to do after that but if you want to make the outlines into a solid mask, you can call imfill().
类别
在 帮助中心 和 File Exchange 中查找有关 Object Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!