Reputation: 390
I have this image and I need tesseract to read the value.
import cv2
import pytesseract
im = cv2.imread("num.png")
print(pytesseract.image_to_string(im))
It does not print anything. Am I doing something wrong since it is pretty clear that it is a 7.
Even after scaling the image up by 5x with intercubic it still would not work. This is the image now
Upvotes: 0
Views: 596
Reputation: 1596
As described here:
By default Tesseract expects a page of text when it segments an image. If you’re just seeking to OCR a small region, try a different segmentation mode, using the --psm argument.
In this case, --psm
from 6 to 10 should work fine. Example:
pytesseract.image_to_string(im, config='--psm 6')
Upvotes: 4