Windows下Python3使用Tesseract-OCR进行图片识别

1、Tesseract OCR下载安装:
https://github.com/tesseract-ocr/tesseract
https://digi.bib.uni-mannheim.de/tesseract/

2、配置环境变量:
找到系统变量的Path,在后面将Tesseract-OCR的安装目录添加进去,可通过如下代码在cmd中验证是否成功:

tesseract --version

3、pip3 install pytesseract

4、python代码:

#coding:utf-8

import pytesseract
from PIL import Image

im=Image.open('image.png')
print(pytesseract.image_to_string(im))

参考:https://segmentfault.com/a/1190000014086067

你可能感兴趣的:(Windows下Python3使用Tesseract-OCR进行图片识别)