首页 > 解决方案 > 使用 pytesseract 将图像转换为数字

问题描述

我正在尝试将图像转换为数字文本,但我遇到了一些问题,输出出现了一些编码字符 (♀)。

输入图像: 在此处输入图像描述

这是我的代码:

import pytesseract
from PIL import Image
from pytesseract import image_to_string
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'

text = pytesseract.image_to_string(Image.open("Capture.jpg"))
print(text)

我得到这个输出:

我想要的输出:

021217

任何帮助解决这个问题,非常感谢

标签: pythonimage-processingocrpython-tesseractpytesser

解决方案


推荐阅读