edge detection and linking

7 Ansichten (letzte 30 Tage)
Sader Yousif
Sader Yousif am 13 Sep. 2014
Kommentiert: Image Analyst am 14 Sep. 2014
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.

Antworten (1)

Image Analyst
Image Analyst am 13 Sep. 2014
Professor Peter Kovesi's site has edge linking code: http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/#edgelink
  3 Kommentare
Image Analyst
Image Analyst am 14 Sep. 2014
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
Image Analyst am 14 Sep. 2014
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().

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by