1. 安装 tesseract-ocr 包
安装方法: sudo apt-get install tesseract-ocr
2. 安装 PIL
PIL(python imaging library)是python中的图像处理库
安装方法: sudo apt-get install python-imaging
3. 安装 pytesseract
安装方法: pip install pytesseract
4. pytesseract使用示例
新建py文件或者直接在终端中输入以下程序:
import pytesseract
from PIL import Image
img = Image.open("./01.jpg")
code = pytesseract.image_to_string(img)
print code
---------------------
作者:-牧野-
来源:CSDN
原文:https://blog.csdn.net/dcrmg/article/details/78001771
版权声明:本文为博主原创文章,转载请附上博文链接!