安装库 pip install pytesseract pip install Pillow
windows安装 tesseract 中文识别 下载地址:https://digi.bib.uni-mannheim.de/tesseract/ 运行安装:tesseract-ocr-setup-4.00.00dev.exe 安装路径:C:\Anaconda3\Tesseract-OCR 安装完成后设置环境变量 1、添加环境变量
2、添加系统变量
重启
from PIL import Image import pytesseract text=pytesseract.image_to_string(Image.open('xxx.jpg'),lang='chi_sim') # 使用中文 print(text)
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有