本文共 784 字,大约阅读时间需要 2 分钟。
这里提供两个下载地址:
推荐使用
,下面是各个版本的展示,根据自己的需求下载即可。个人不推荐,有点麻烦
。所占空间有点大
,可以酌情考虑安装到D盘其他的都是一路Next即可
具体步骤就不说。
安装之后测试一下tesseract -v
结果如下:
建议重启一下电脑,以确保环境变量真实生效。
因为,虽然在命令行显示确实生效了,但是在代码中使用,有可能产生,未安装的异常。就很蓝瘦香菇。
pytesseract.pytesseract.TesseractNotFoundError:
其实,并不是你的问题,而是python没能正确识别而已。 不要在python中使用
pip install tesseract-ocr
来安装,为什么呢?下面就是原因
首先安装tesseract的python库
pip install pytesseract
from PIL import Imageimport pytesseractimport cv2 as cvimg_path = 'thjnbshlw2.jpg'img = cv.imread(img_path)text = pytesseract.image_to_string(Image.fromarray(img))print(text)
转载地址:http://ougsz.baihongyu.com/