首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Openalpr目录错误

Openalpr目录错误
EN

Stack Overflow用户
提问于 2015-09-18 16:41:59
回答 2查看 1.3K关注 0票数 2

我尝试使用python代码和openalpr库来识别车牌。当我尝试获取车牌号码时,我得到了以下错误。

代码语言:javascript
复制
Warning: You are running an unsupported version of Tesseract.
Expecting at least 3.03, your version is: 3.02.02
Error opening data file /usr/local/share/tessdata/lus.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.
Failed loading language 'lus'
Tesseract couldn't load any languages!

这是我从Here得到的代码

代码语言:javascript
复制
from openalpr import Alpr

alpr = Alpr("us", "/etc/openalpr/openalpr.conf", "/home/pi/openalpr/runtime_data/")
if not alpr.is_loaded():
    print("Error loading OpenALPR")
    sys.exit(1)

alpr.set_top_n(20)
alpr.set_default_region("md")

results = alpr.recognize_file("/home/pi/ea7the.jpg")

i = 0
for plate in results['results']:
    i += 1
    print("Plate #%d" % i)
    print("   %12s %12s" % ("Plate", "Confidence"))
    for candidate in plate['candidates']:
        prefix = "-"
        if candidate['matches_template']:
            prefix = "*"

        print("  %s %12s%12f" % (prefix, candidate['plate'], candidate['confidence']))

# Call when completely done to release memory
alpr.unload()

如何解决这个错误?

EN

回答 2

Stack Overflow用户

发布于 2019-04-26 02:51:48

更新tesseract安装。从以下链接下载Tesseract 3.04

代码语言:javascript
复制
wget -o tesseract https://github.com/tesseract-ocr/tesseract/archive/3.04.zip
./configure
make 
sudo make install
sudo ldconfig

使用以下命令测试版本

代码语言:javascript
复制
tesseract --version
票数 1
EN

Stack Overflow用户

发布于 2016-04-21 17:27:59

您只需要更新tesseract,它就会工作我花了2个小时才完成,但我的脚本运行得很好

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32647585

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档