pytesseract无法识别图像中的字符

时间:2018-05-30 19:48:38

标签: python-3.x tesseract python-tesseract

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

from PIL import Image
import pytesseract

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

这是图片: enter image description here

1 个答案:

答案 0 :(得分:0)

尝试将其他参数 config 传递给具有以下值的 image_to_string 方法:

pytesseract.image_to_string(filename, config='--psm 10 --oem 3 -c tessedit_char_whitelist=0123456789')
相关问题