【发布时间】:2020-08-24 11:14:27
【问题描述】:
这是我第一次编码。 我希望得到有关如何从 Image Passport/ID 中提取文本的指导。 使用 python-Tesseract OCR,我对 Tesseract 的文档进行了研究,但没有得到足够的解释。
【问题讨论】:
-
欢迎来到 Stack Overflow,这里不是寻求一般指导的地方;请询问有关代码的具体问题
标签: python-3.x python-tesseract
这是我第一次编码。 我希望得到有关如何从 Image Passport/ID 中提取文本的指导。 使用 python-Tesseract OCR,我对 Tesseract 的文档进行了研究,但没有得到足够的解释。
【问题讨论】:
标签: python-3.x python-tesseract
导入 PIL 和 pytesseract
import PIL.Image
import pytesseract
加载你的图片
my_image = PIL.Image.open("Path/To/My_Image.jpg")
在上面运行 tesseract
my_image_text = pytesseract.image_to_string(my_image)
print(my_image_text)
【讨论】: