2016-04-23 191 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

相關問題