-1

Im trying to get pytesseract to get the positions of each number. However, it doesn't seem to work on this image, but it does on the original uncropped image. I've tried using psm-13 config but it still doesn't detect anything

d = pytesseract.image_to_string(Image.open('page2crop.jpg'))
print(d)

original image, cropped image

Finite
  • 1
  • 1

1 Answers1

0

This is possibly a duplicate of use pytesseract to recognize text from image.
Some users mentioned that the highest voted answer returns empty result. However, someone reported that the following solution worked. I have not tested it. Please check and leave a comment if it worked.

Quoting the second most voted answer by dinesh-chandra-kumawat.

import pytesseract
from PIL import Image
text = pytesseract.image_to_string(Image.open("temp.jpg"), lang='eng',
                        config='--psm 10 --oem 3 -c tessedit_char_whitelist=0123456789')

print(text)
CypherX
  • 7,019
  • 3
  • 25
  • 37
  • the code you posted doesn't seem to work. Im not sure if tessedict_char_whitelist works https://github.com/tesseract-ocr/tesseract/issues/751 there seems to be an issue that doesnt seem to be solved – Finite Nov 19 '19 at 12:38