操作不复杂,自己看参考资料吧;
可用命令行,也可用代码
from pytesseract import pytesseract from PIL import Image # The path of installed tesseract tesseract_path = r"D:/Program Files/Tesseract-OCR/tesseract.exe" # The image path path_img1 = r"E:\002_nlp\现场设备故障屏幕照片\2、串焊机\奥特维历史报警界面.jpg" path_img1 = r"e:\2.jpg" # Start the tesseract engine pytesseract.tesseract_cmd = tesseract_path # Open the image with PIL img1 = Image.open(path_img1) # Extract the text from image text1 = pytesseract.image_to_string(img1, lang='chi_sim') print("Image 1 text:\n", text1)
识别中文需额外装个字库,其他没啥;
识别效果受 图片质量 影响较大
参考资料:
https://mp.weixin.qq.com/s/jhR0eu2pjhQEndo-zngkMg 使用 Python 的 Tesseract 库从图像中读取文本
https://www.jianshu.com/p/3326c7216696 Tesseract-OCR 安装、中文识别与训练字库
https://gitcode.net/mirrors/tesseract-ocr/tessdata?utm_source=csdn_github_accelerator 源码
https://www.jianshu.com/p/3326c7216696
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)