How do I know what values to set for the blockSize and constant parameters of adaptiveThreshold().

asked 2017-09-18 17:45:27 -0600

I am trying to find the contours of an image using the findContours() method. Firstly, I converted the image to grayscale, and then made it binary using the adaptiveThreshold() method. How do I know what values to set for the blockSize and constant?

Thanks.

edit retag flag offensive close merge delete

Comments

It is not possible to set these values without writting your own algoithm

LBerger gravatar imageLBerger ( 2017-09-20 11:19:21 -0600 )edit

What do you mean? Thanks.

JamieCorkhill gravatar imageJamieCorkhill ( 2017-09-20 16:49:46 -0600 )edit

If my memory is good adaptive threshold uses block image mean to find threshold. When you have two mode in this block threshold found is good but when there is one mode threshold is bad. Problem opencv does not give mean modes values and hence you don't know tjreshold quality

LBerger gravatar imageLBerger ( 2017-09-21 00:56:01 -0600 )edit