【问题标题】:pytesseract: convert pictures of 7-segment numbers to textpytesseract:将 7 段数字的图片转换为文本
【发布时间】:2022-01-06 11:36:24
【问题描述】:

我正在尝试转换这样的图片: 使用 pytesseract 将 7 段文本转换为文本:

我尝试了不同的 PSM 模式和一个只有 0123456789 的白名单,但 pytesseract 的最佳输出是 '5' 而不是 '125'。

有没有办法配置 pytesseract 来转换我的图片?或者有什么扩展?

谢谢。

import pytesseract
from PIL import Image, ImageTk

img = Image.open('test.png')

text = pytesseract.image_to_string(img, config=("-c tessedit_char_whitelist=0123456789 --psm 7"))

print(text)

【问题讨论】:

    标签: python ocr tesseract python-tesseract text-recognition


    【解决方案1】:
    1. 阅读并关注docs
    2. 使用letsgodigital作为ocr“语言”

    【讨论】:

    • 不幸的是,letsgodigital 语言对我不起作用。许多价值观是错误的。 :(
    • 它在您提供的图像上完美运行(如果您也阅读文档。)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-09
    • 1970-01-01
    • 2022-10-23
    • 1970-01-01
    • 2019-01-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多