The javadoc mentions signature of adaptive threshold function as
adaptiveThreshold(src, dst, maxValue, adaptiveMethod, thresholdType, blockSize, C)
I need to somehow put in values for blockSize
and C
(offset) automatically given a particular image. So I get a colored image which I convert to gray scale and then apply adaptive threshold as a pre-proccessing step for OCR.
Currently I hardcode the values for blocksize
and C
and see what gives me better result and then settle on that value. Is there a way to somehow find the best(or better) values for these parameters so that given a grayscale image my algorithm knows what would be good values for blocksize
and 'C'.
PS: The adaptive threshold method that I am using is ADAPTIVE_THRESH_MEAN_C
.