Python tesseract-ocr图片转文字

step1:安装tesseract-ocr-w64-setup-v4.0.0.20181030.exe

step2:配置环境变量
Python tesseract-ocr图片转文字
step3:下载词库chi_sim.traineddata

step4:安装pytesseract

pip install pytesseract

step5:准备图片资源
Python tesseract-ocr图片转文字

step6:编写python代码

import pytesseract
from PIL import Image
image = Image.open("1.png")
#图片转文字
text = pytesseract.image_to_string(image,lang='chi_sim') 
print(text)

解析结果
Python tesseract-ocr图片转文字