0
votes

i am using opencv library for image processing process in android. The problem is when i use canny function for image. This is my code of using canny:

Imgproc.Canny(ImageMat, ImageMat, 0.4, 0.5);

i use low threshold 0.4 and 0.5 for high threshold, but the result for the image is not good. I know i must change the low and high threshold to get the good result, but that must be different threshold for the other image too. How to get dynamic threshold for that canny process?? My project is leaf recognition on android. Sorry for my bad English language.

1

1 Answers

1
votes

As far as I know, the only relatively automatic thresholding method may be Otsu operation. You may put more effort on the channel selection and intensity mapping (usually non-linear) instead of thresholding trial. The aim of doing this is to maximize the difference between your object and background, which makes thresholding easier and more robust. In order to achieve this purpose, you may need to check your leaf image database and get a rough idea of the intensity range of leaf and background.