I'm trying to recognize some text with pytesseract, but before that I have to turn the picture I have into a binary one. Note that I first resize the picture to make it easier to read for pytesseract.
See below the original picture, the resized one, my code and the result I get, so you can understand my issue..
image = cv2.imread('original.png',0)
image = cv2.resize(image,None,fx=2,fy=2,interpolation=cv2.INTER_CUBIC)
cv2.imwrite("resized.png", image)
thresh = cv2.threshold(image, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)[1]
result = 255 - thresh
cv2.imwrite("after_threshold.png", result)
Thank you for your help :)