gpt4 book ai didi

python - pytesseract,Windows 错误 : [Error 2] The system cannot find the file specified

转载 作者:太空狗 更新时间:2023-10-30 02:42:23 24 4
gpt4 key购买 nike

我是文本提取的新手。当我尝试使用 pytesseract as 从 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)的问题,test.png是车牌的图片,还需要安装什么吗

最佳答案

根据PyPi information您缺少一个额外条件:

Install google tesseract-ocr from http://code.google.com/p/tesseract-ocr/ . 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 - pytesseract,Windows 错误 : [Error 2] The system cannot find the file specified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36813344/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com