Asked:2022-06-25 23:19:08 +0000 UTC2022-06-25 23:19:08 +0000 UTC2022-06-25 23:19:08 +0000 UTC
从图像中识别数字
772
必须先识别文本并显示第一行,然后再显示下一行。
Tesseract 只能识别文本,不能识别数字。如何解决?
from PIL import Image
import pytesseract
image = 'output.png'
text = pytesseract.image_to_string(Image.open(image), lang = 'rus')
with open('log.txt', 'w', encoding = 'utf-8') as file:
file.write(text)
关于这个主题有很多问题和答案,有时归结为正确设置 Tesseract-OCR。