我正在尝试使用pytesseract
但是当我提供图像时它无法识别它。是因为图像很小吗?如果是,最小尺寸应该是多少?它是否适合识别从图像中分割出来的单个字符?
from PIL import Image
import pytesseract
image = Image.open(path)
num = pytesseract.image_to_string(image)
print(num)
尝试将其他参数配置传递给image_to_string方法,其值如下:
pytesseract.image_to_string(filename, config='--psm 10 --oem 3 -c tessedit_char_whitelist=0123456789')