小编Jef*_*eff的帖子

pytesseract image_to_string 不拉字符串,但没有错误

我在 pytesseract 包中使用 image_to_string 函数将单个图片文件的多个部分转换为字符串。除此图像外,所有部件均正常工作:

在此处输入图片说明

这是我用来转换它的脚本:

from PIL import Image
import pytesseract
pytesseract.pytesseract.tesseract_cmd = 'C:/Program Files (x86)/Tesseract-OCR/tesseract'

im = Image.open('image.png')
text = pytesseract.image_to_string(im)
print(text)
Run Code Online (Sandbox Code Playgroud)

这给出了输出:

—\—\—\N—\—\—\—\—\N

我尝试将图像分解成更小的部分,并将图像处理为 jpg 和 png。我该怎么做才能让它输出图像中的值?

image image-processing python-imaging-library python-3.x python-tesseract

1
推荐指数
1
解决办法
3720
查看次数