【问题标题】:Tesseract Recognition of datesTesseract 日期识别
【发布时间】:2017-10-02 02:13:53
【问题描述】:

Date

您好,我正在尝试使用 Tesseract 从收据中识别日期。此代码可以很好地提取收据上的总数,但似乎不适用于日期,因为它打印为空。 我在这里缺少什么让它工作?

这是我的代码:

from PIL import Image
import pytesseract
img = Image.open('Rec.jpg')
print(pytesseract.image_to_string(img, config='-psm 6'))

【问题讨论】:

    标签: tesseract python-tesseract


    【解决方案1】:

    尝试使用tesseract 命令行并将psm 设置为12 并获得正确的日期08/21/2017

    --psm 12 表示为Sparse text with OSD 设置segmentation mode

    您可以使用命令tesseract --help 查找tesseract v4.00.00alpha 支持的--psm 用于测试。

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2012-04-16
      • 1970-01-01
      • 1970-01-01
      • 2018-01-16
      • 2012-07-03
      • 2013-10-16
      • 2015-09-13
      • 1970-01-01
      • 2020-04-26
      相关资源
      最近更新 更多