【问题标题】:Tesseract Open Source OCR Engine v3.05.00dev with Leptonica Warning in pixReadMemPngTesseract 开源 OCR 引擎 v3.05.00dev,在 pixReadMemPng 中带有 Leptonica 警告
【发布时间】:2018-11-25 08:25:44
【问题描述】:

我正在尝试使用 pytesseract 将 PNG 图像文件转换为文本。它给了我以下错误。
TesseractError: (1, 'Tesseract Open Source OCR Engine v3.05.00dev with Leptonica Warning in pixReadMemPng: work-around: writing to a temp file libpng 警告:使用 libpng-1.4.3 构建的应用程序,但使用 1.5.14 运行 pixReadStreamPng 中的错误:未生成 png_ptr pixReadMemPng 中的错误:pix 未读取 pixReadMem 中的错误:png:没有返回 pix 处理过程中错误。')

当我做 tesseract -v
正方体 3.05.00dev
leptonica-1.72
libjpeg 9:libpng 1.5.14:libtiff 4.0.3:zlib 1.2.5:libopenjp2 2.1.0

【问题讨论】:

    标签: python-3.x libpng python-tesseract libtiff leptonica


    【解决方案1】:

    我也遇到这个问题,网上找不到答案。

    但我尝试下载 tesseract-ocr 并安装它,然后:

    1. 设置环境变量,TESSDATA_PREFIX:"C:\Program Files (x86)\Tesseract-OCR\tessdata"
    2. C:\Program Files (x86)\Tesseract-OCR 添加到路径变量中。
    3. 在第 35 行编辑 pytesseract.pytesseract_cmd = 'C:\\Program Files (x86)\\Tesseract-OCR\\tesseract.exe'

    当我在 anaconda 提示符中调用 pytesseract.image_to_string(img) 时,它会返回一个字符串。我的环境:

    • pytesseract 0.2.6
    • 枕头 5.2.0
    • tesseract 4.00.00alpha

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-17
      • 1970-01-01
      • 2023-01-05
      • 1970-01-01
      • 2010-09-07
      • 2013-04-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多