Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

broken image edges with canny operator

I am using canny edge detector to detect edges from the input image.

In every input image, there can be two objects (main object and another object inside it) as shown in the sample image. Therefore, I am supposed to detect two edges in such scenarios

enter image description here

I determine the upper and lower thresholds automatically from the input image (using median and sigma). Most of the time canny works well but sometimes when the contrast of the image is not very good then edge detection fail as shown in following examples (NOTE:- outer edge is always detected correctly problem occurs with the inner edge)

enter image description here enter image description here

Canny detected the edge for the outer boundary but failed for the inner object. At the moment, I am using openCV with python. Is there any way I can improve the results of canny edge detection

Any help will be really appreciated

like image 629
user1388142 Avatar asked Dec 15 '25 03:12

user1388142


1 Answers

Canny might be not the best tool here, but just a though: Have you tried histogram equalization? It will improve the contrast, so chances are Canny will work better.

like image 85
Lech Napierała Avatar answered Dec 16 '25 15:12

Lech Napierała



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!