2016-04-23 214 views
3

我是新来extraction.when文字我尝试使用pytesseract来提取PNG图像文本pytesseract,WindowsError:[错误2]系统找不到指定的文件

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

我得到错误的 enter image description here 这是图像问题(test.png)。test.png是号牌的图像。我是否需要安装其他任何东西。

+0

你可以单独从image_to_string调用Image.open()调用,看看哪里错误发生? – tobspr

+0

@tobspr尝试过,但仍然相同错误 – Emmanu

+0

多数民众赞成在预期,问题是哪一行导致错误 – tobspr

回答

5

根据PyPi information还有就是你缺少一个额外补贴:

Install google tesseract-ocr from http://code.google.com/p/tesseract-ocr/ . You must be able to invoke the tesseract command as "tesseract". If this isn't the case, for example because tesseract isn't in your PATH, you will have to change the "tesseract_cmd" variable at the top of 'tesseract.py'.

和链接重定向我https://github.com/tesseract-ocr/tesseract

我很坦率地失望的是,包不给你更多提示信息,你是错过了这一点,无论如何,一旦你已经安装了基础的tesseract命令pytesseract应该正常工作:)

+2

@ it worked.Thanks.I安装tesseract-ocr从https://sourceforge.net/projects/tesseract-ocr-alt/files/ – Emmanu

相关问题