python图像识别入门_Python 图像识别入门篇

一、安装Python依赖

pip install pytesseract pyocr pillow Image

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

二、下载并安装 tesseract-ocr:

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

三、修改pytesseract.py

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

291579-20190524152128905-826263928.png

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

四、找张图片

291579-20190524152428986-486758892.png

五、Python代码

fromPIL import Image

import pytesseract

image= Image.open(r'E:\test.png')

code=pytesseract.image_to_string(image)

print(code)

六、执行脚本

291579-20190524152634936-2074462256.png