from PIL import Image import pytesseract
text=pytesseract.image_to_string(Image.open(path + wjjname+'/'+jp)) #print(text)
安装:
https://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-setup-4.00.00dev.exe
并将安装目录:C:\Program Files (x86)\Tesseract-OCR
添加至
C:\Python35\Lib\site-packages\pytesseract\pytesseract.py
文件
如下:
# CHANGE THIS IF TESSERACT IS NOT IN YOUR PATH, OR IS NAMED DIFFERENTLY
tesseract_cmd = ‘tesseract’
tesseract_cmd = ‘C:/Program Files (x86)/Tesseract-OCR/tesseract.exe’
