Estimate block size and constant from image for adaptive threshold cv2 python

522 Views Asked by At

I'm using

import cv2
cv2.adaptiveThreshold(img,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, 
                                    cv2.THRESH_BINARY_INV,
                                    11,
                                    0)

in python to compute a preprocess on different types of images. Since a constant C (0 in this case) and the kernel size (11 in this case) can be good for a specific type of image and bad for another type, is there a way to calculate them dynamically using some features of an image?

0

There are 0 best solutions below