Python 图像识别入门篇

一、安装Python依赖

pip install pytesseract pyocr pillow Image

pip安装:https://www.cnblogs.com/Javame/p/10918325.html

二、下载并安装 tesseract-ocr:

1111

三、修改pytesseract.py

位置:..\lib\site-packages\pytesseract\pytesseract.py

tesseract.exe来源第二步安装后Tesseract-OCR/tesseract.exe执行文件快捷方式。

四、找张图片

五、Python代码

from PIL import Image
import pytesseract
image = Image.open(r'E:\test.png')
code = pytesseract.image_to_string(image)
print(code)

六、执行脚本

猜你喜欢

转载自www.cnblogs.com/Javame/p/10918388.html