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

相关推荐
测试199836 分钟前
接口自动化测试套件封装示例详解
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·接口测试
工会代表2 小时前
使用 GitHub Actions 与 Docker 实现 CaptchaVision API 持续集成
python
cvyoutian2 小时前
解决 PyTorch 大型 wheel 下载慢、超时和反复重下的问题
人工智能·pytorch·python
小徐敲java3 小时前
python的FastAPI框架
开发语言·python·fastapi
CHANG_THE_WORLD3 小时前
Python 切片操作全面解析
开发语言·python
是一个Bug3 小时前
Spring事件监听器在电商订单系统中的应用
java·python·spring
shangjian0073 小时前
Python基础-闭包和装饰器
开发语言·python
三维空间4 小时前
如何在Python多进程中避免死锁问题?
python
冤大头编程之路4 小时前
Python并发编程实操教程:多线程/多进程/异步全解析
python
dhdjjsjs4 小时前
Day30 Python Study
开发语言·前端·python