Installing pytesser

先介紹幾篇好的文章

Tesseract-OCR引擎 入門   http://blog.csdn.net/xiaochunyong/article/details/7193744

淺談OCR之Tesseract

http://www.cnblogs.com/brooks-dotnet/archive/2010/10/05/1844203.html


安裝PIL、pytesser、tesseract
(1)安裝PIL:下載地址:http://www.pythonware.com/products/pil/
(2)pytesser:下載地址:http://code.google.com/p/pytesser/,下載解壓後所有文件直接放在代碼相同的文件夾下,即可使用。
(3)Tesseract OCR engine下載:http://code.google.com/p/tesseract-ocr/,下載後解壓,找到tessdata文件夾,用其替換掉pytesser解壓後的tessdata文件夾即可。

ps:如果嫌麻煩不想將pytesser程序放在每個項目代碼的目錄下,可以將pytesser下載後的文件(所有文件,包括tesseract.exe,testdata目錄)解壓後放在python安裝目錄的site-packages下,並且在程序中使用os.chdir(‘C:\\Python27\\Lib\\site-packages’)來指定python程序運行的目錄,否則會出現WindowsError: [Error 2] The system cannot find the file specified 。當然,將pytesser的所有文件放在和項目代碼同目錄下是最簡便的方法,且不容易報錯。可以參考:http://blog.sina.com.cn/s/blog_a73687bc0101dpcg.html。

最後重要的一步是:創建pytesser.pth 內容是pytesser  路徑D:\python\Lib\site-packages


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章