PIL安裝
Windos平臺可以直接去PIL官網下載exe安裝包。http://pythonware.com/products/pil/
注:官網提供的安裝包是32位的,63位系統請前往這裏 http://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow 下載替代包pillow。
pytesser3安裝
下載地址:
https://github.com/songluyi/pytesser3
解壓放到 python安裝目錄\Lib\site-packages
修改__init__.py文件裏面的tesseract路徑
測試圖片:
測試代碼:
from pytesser import pytesser
print(pytesser.image_file_to_string('1.jpg'))
結果: