Python OCR工具pytesseract识别数字验证码

直接下载地址:https://digi.bib.uni-mannheim.de/tesseract/

找的最新版本:

我添加了math 跟chinese(因为是国内网络的原因吧,下载都失败,所以不用选择,后面自己下载后,添加到相应目录就好)

配置系统环境变量

在cmd下测试

tesseract -v

复制代码
import pytesseract
from PIL import Image


picture_new_path=文件路径
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
image = Image.open(picture_new_path)
text = pytesseract.image_to_string(image, lang='eng', config="--psm 6")
print(text)

或者查看官方文档:Languages/Scripts supported in different versions of Tesseract | tessdoc

相关推荐
0思必得030 分钟前
[Web自动化] Selenium处理动态网页
前端·爬虫·python·selenium·自动化
韩立学长37 分钟前
【开题答辩实录分享】以《基于Python的大学超市仓储信息管理系统的设计与实现》为例进行选题答辩实录分享
开发语言·python
qq_1927798739 分钟前
高级爬虫技巧:处理JavaScript渲染(Selenium)
jvm·数据库·python
u0109272711 小时前
使用Plotly创建交互式图表
jvm·数据库·python
爱学习的阿磊1 小时前
Python GUI开发:Tkinter入门教程
jvm·数据库·python
Imm7772 小时前
中国知名的车膜品牌推荐几家
人工智能·python
tudficdew2 小时前
实战:用Python分析某电商销售数据
jvm·数据库·python
sjjhd6522 小时前
Python日志记录(Logging)最佳实践
jvm·数据库·python
2301_821369613 小时前
用Python生成艺术:分形与算法绘图
jvm·数据库·python
机 _ 长3 小时前
YOLO26 改进 | 基于特征蒸馏 | 知识蒸馏 (Response & Feature-based Distillation)
python·深度学习·机器学习