Python 图像识别入门篇

1、安装Python依赖html

pip install pytesseract pyocr pillow Image

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

2、下载并安装 tesseract-ocr:.net

wget https://download.csdn.net/download/yiyu1/11200375

3、修改pytesseract.pycode

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

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

4、找张图片图片

5、Python代码ip

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

6、执行脚本get