I tried to apply opencv OTSU binarization on the following image, but it generate a black image.
Here is the following python code:
import cv2 image = cv2.imread('test_otsu.png', 0) ret, thresh = cv2.threshold(image, 0,250,cv2.THRESH_BINARY+cv2.THRESH_OTSU) cv2.imwrite('temp.png', thresh)
Did I miss anything in my code? Please help me how to get correct binarization of the given image.