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

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)

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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With