i need to ocr small images with python 2.7, contains a price.
as you can see the image is very small , and contains some values.
my goal is to decode to : 654.10
i try with tesseract but i had no luck.
import pytesseract
print(pytesseract.image_to_string(Image.open('example.png') , lang='eng', boxes=False,config='--psm 10 --eom 3 -c tessedit_char_whitelist=€0123456789'))
i get :
€553 1
i try with an online converter and work like a charm (https://convertio.co/it/ocr/) so i think it will be possibile.
someone have a better idea ?
Thanks
(sorry for my bad english)
UPDATE :
i try to threshold the image without any luck ... again ...
import cv2
img = cv2.imread('cropped.png')
grayscaled = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
retval, threshold2 = cv2.threshold(grayscaled,125,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
cv2.imwrite('threshold.jpeg',threshold2)
print(pytesseract.image_to_string(Image.open('threshold.jpeg') , lang='eng', boxes=False,config='--psm 10 --eom 3 -c tessedit_char_whitelist=0123456789'))
ps. i cropped the original image deleting the € sign ... but still got the error.
Thanks