0

I am implementing Canny Edge Detection in C++.I am stuck in Double Thresholding. I have given the threshold values manually which work fine for a given image.But when i try it on other image the threshold values are not correct and the image doesn't look good.Is there any way to get threshold values automatically for a given image.

  • I am sure Fred (@fmw42) will have some insights to share, but AFAIK, the recommendation for **ImageMagick** is to put 10% of pixels in the lower threshold and 30% in the upper threshold... https://www.imagemagick.org/discourse-server/viewtopic.php?f=4&t=25405 – Mark Setchell May 28 '19 at 10:30
  • Scikit-image appears to use 10% and 20% https://scikit-image.org/docs/dev/api/skimage.feature.html?highlight=canny#skimage.feature.canny – Mark Setchell May 28 '19 at 10:32
  • There are no defaults that will work on any image. Using percentage of pixels as mentioned in the comments above will work for some images that have a “normal” amount of edges in them. Other images will have many more or many fewer edges and will need the parameters tweaked. – Cris Luengo May 28 '19 at 13:18
  • By the way, the lower threshold should never be a percentage of pixels, as that limits the algorithm even more in amount of edges. Instead, take that threshold to be e.g. half the value of the upper threshold. – Cris Luengo May 28 '19 at 13:21
  • It worked well when i put lower threshold 10% and higher threshold to 30%.Thanks for the help. – Venu Gopal Bandhakavi May 29 '19 at 05:20

0 Answers0