I am trying to use adaptiveTreshold, but I get error regarding blockSize. I know it should be odd and > 0, it is set 11 but it still shows this error. What could be wrong?
treshold = 115
maxValue = 255
adaptiveMethod = cv.ADAPTIVE_THRESH_GAUSSIAN_C
thresholdType = cv.THRESH_BINARY
blockSize = 11
C = 2
im = cv.adaptiveThreshold(img, treshold, maxValue, adaptiveMethod, thresholdType, blockSize, C)
plt.imsave(save_path, im, cmap = 'gray')
error: OpenCV(4.6.0) /io/opencv/modules/imgproc/src/thresh.cpp:1675: error: (-215:Assertion failed) blockSize % 2 == 1 && blockSize > 1 in function 'adaptiveThreshold