pytesseract的使用

首先,先安装好Tesseract软件,pytesseract模块

问题 1 :FileNotFoundError: [WinError 2] 系统找不到指定的文件。

  加上这行代码

pytesseract.pytesseract.tesseract_cmd = r'D:Program FilesTesseract-OCR'

方法

  1 image_to_string()

from PIL import Image
import pytesseract

pytesseract.pytesseract.tesseract_cmd = r'D:Program FilesTesseract-OCR	esseract.exe'
im = Image.open(r'a.jpg')
s = pytesseract.image_to_string(im)

print(s)

  输出:

7364
原文地址:https://www.cnblogs.com/654321cc/p/8882937.html