【问题标题】:pytesseract,WindowsError: [Error 2] The system cannot find the file specifiedpytesseract,WindowsError: [错误2] 系统找不到指定的文件
【发布时间】:2016-08-17 05:41:02
【问题描述】:

我是文本提取的新手。当我尝试使用 pytesseract as 从 png 图像中提取文本时

from PIL import Image
import pytesseract
s=Image.open('d:\\test.png')
print(pytesseract.image_to_string(s))

我收到错误消息 这是图像(test.png)的问题吗?test.png是车牌的图像。我需要安装其他东西吗?

【问题讨论】:

  • 能否将 Image.open() 调用与 image_to_string 调用分开,看看错误发生在哪里?
  • @tobspr 试过了,但仍然出现同样的错误
  • 这是预期的,问题是哪一行导致错误
  • @tobspr 第 3 行导致错误
  • 第 3 行是什么 - Image.open 调用或 image_to_string_call?你需要更精确。

标签: python image-processing image-recognition


【解决方案1】:

根据PyPi information,您缺少一个附加条件:

http://code.google.com/p/tesseract-ocr/ 安装 google tesseract-ocr。 您必须能够以“tesseract”的形式调用 tesseract 命令。如果这 不是这样,例如因为 tesseract 不在你的 PATH 中,你会 必须更改“tesseract.py”顶部的“tesseract_cmd”变量。

那个链接把我重定向到https://github.com/tesseract-ocr/tesseract

坦率地说,我很失望这个包没有给你一个更丰富的信息,你错过了这个,无论如何,一旦你安装了底层的tesseract 命令 pytesseract 应该可以正常工作:)

【讨论】:

猜你喜欢
  • 2018-10-21
  • 1970-01-01
  • 2011-07-16
  • 1970-01-01
  • 2014-04-12
  • 1970-01-01
  • 2017-05-02
  • 2018-03-26
  • 1970-01-01
相关资源
最近更新 更多