系统相关
首页 > 系统相关> > python – pytesseract,WindowsError:[错误2]系统找不到指定的文件

python – pytesseract,WindowsError:[错误2]系统找不到指定的文件

作者:互联网

我是文本提取的新手.当我尝试使用pytesseract从png图像中提取文本时

from PIL import Image
import pytesseract
s=Image.open('d:\\test.png')
print(pytesseract.image_to_string(s))

我收到错误了
enter image description here
这是image(test.png)的问题.the test.png是一个号牌的图像.我应该安装其他任何东西.

解决方法:

根据PyPi information,你有一个遗漏的缺点:

Install google tesseract-ocr from 07001 .
You must be able to invoke the tesseract command as “tesseract”. If this
isn’t the case, for example because tesseract isn’t in your PATH, you will
have to change the “tesseract_cmd” variable at the top of ‘tesseract.py’.

那个链接将我重定向到https://github.com/tesseract-ocr/tesseract

我很坦率地感到失望的是,该软件包没有给你提供更多信息,你错过了这个,无论如何,一旦你安装了底层的tesseract命令pytesseract应该正常工作:)

标签:python,image-processing,image-recognition
来源: https://codeday.me/bug/20190608/1200591.html