tesseract安装

1.下载tesseract

https://digi.bib.uni-mannheim.de/tesseract/

2.配置环境变量

path

D:\Program Files (x86)\Tesseract-OCR

TESSDATA_PREFIX变量名

D:\Program Files (x86)\Tesseract-OCR\tessdata

3.打开cmd

tesseract -v

4.python脚本

from PIL import Image
import pytesseract
 
text = pytesseract.image_to_string(Image.open(r'D:\image.png'))
print(text)

 

posted @ 2021-12-09 10:46  缘故为何  阅读(123)  评论(0编辑  收藏  举报