Image Processing Edge Detection: Remove unwanted edges
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Firstly, apologies for the length of this question. But I feel it needs a little bit of an explanation so that my objective can be understood.
I want to detect only the edge that surrounds the subject of the image, but edge detection operators such as canny, sobel etc. (with varying thresholds) all yield too many edges (false positives for what I want to achieve)...
My workaround for this is to use segmentation to pick out only the subject of the image and the background, and I seem to have done this successfully. I have then run canny edge detection on this segmented version, which appears at first to give me the edge I want. However, after a deeper examination, these edges are off by sometimes up to 4 pixels because of the way the segmentation process worked. So I am wondering if there is now a way to use the segmented edge image to say "keep all edges within 5 pixels of this edge, and remove all the others"...
Can anyone tell me how I can do this?
0 Kommentare
Antworten (2)
Sean de Wolski
am 15 Apr. 2011
Yes.
doc bwdist
on a logical image will return the distances to the edge. Then you can use a threshold (e.g D <=5) to expand it.
Ps. Your question was well written and we don't mind the length ;) However, as a forum, whenever an image processing related question is asked, it's strongly advised to post an image. You can see how do this by clicking on "Markup Help". We may be able to help you find a better way altogether.
-Sean
Sean de Wolski
am 15 Apr. 2011
D = bwdist(canny_edge_detection); % Distance xform
M = full_edge_detection_image&(D<5); % Edges in the full edge image and within within 5 of the canny.
Could you post the original image too.
4 Kommentare
moahaimen talib
am 6 Mär. 2017
hi i need pruning code for image can anyone answer me to send the full image
Rongsong Yang
am 5 Jul. 2018
what do you mean "full_edge_detection_image&(D<5)"? It seems undefined in Matlab
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!