pytesseract无法识别图像中的字符

问题描述 投票:1回答:1

我正在尝试使用pytesseract但是当我提供图像时它无法识别它。是因为图像很小吗?如果是,最小尺寸应该是多少?它是否适合识别从图像中分割出来的单个字符?

from PIL import Image
import pytesseract

image = Image.open(path)
num = pytesseract.image_to_string(image)
print(num)

这是图像:enter image description here

python-3.x tesseract python-tesseract
1个回答
0
投票

尝试将其他参数配置传递给image_to_string方法,其值如下:

pytesseract.image_to_string(filename, config='--psm 10 --oem 3 -c tessedit_char_whitelist=0123456789')
© www.soinside.com 2019 - 2024. All rights reserved.