安装
pip install tesseract
识别图像 – 在图像路径下自动生成一个a.txt
tesseract a.png a
查看命令
tesseracr -h
查看所有语言
tesseract --list-langs
python 中tesserect 的使用
#encoding: utf-8
import pytesseract
from PIL import Image
pytesseract.pytesseract.tesseract_cmd = r"D:\ProgramApp\TesseractOCR\tesseract.exe"
image = Image.open('c.png')
text = pytesseract.image_to_string(image,lang='chi_sim') #chi_sim 指定的是数据集,这里指定了中文
print(text)