gpt4 book ai didi

c++ - OpenALPR 的段错误

转载 作者:行者123 更新时间:2023-11-30 01:03:52 26 4
gpt4 key购买 nike

我正在尝试在 Laravel Homestead (Ubuntu 18.04) 上安装 OpenALPR。首先我尝试了 The Easiest Way .我正在尝试运行:

Error opening data file /usr/share/openalpr/runtime_data/ocr/lus.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'lus'
Tesseract couldn't load any languages!
Segmentation fault (core dumped)

cd进入/usr/share/openalpr/runtime_data/ocr目录,但没有找到lus.traineddata文件。但是有一个 ocr 文件夹和一个 lus.traineddata。我把它从那里复制到上面的目录,再次尝试识别但是这次:

--(!) Runtime directory '/usr/share/openalpr/runtime_data' is invalid. Missing OCR data for the country: 'us'! Error loading OpenALPR

然后我试了The Easy Way .一切都正常编译。但是:

Segmentation fault (core dumped)

最佳答案

发生这种情况是因为 openALPR 的 Tesseract OCR 期望其经过训练的数据位于特定路径中,而文件不在那里。根据错误消息,可以使用 TESSDATA_PREFIX 环境变量进行设置,但根据我自己的经验,它不起作用。

我遇到了另一种解决方案;这不是最好的方法,但它可能会起作用。

我创建了一个从 /usr/share/openalpr/runtime_data/ocr/tessdata/lus.traineddata/usr/share/openalpr/runtime_data/ocr/lus.traineddata 的符号链接(symbolic link) 以便使经过训练的数据文件在他们期望的位置可供 tesseract/openalpr 使用。

sudo ln -s/usr/share/openalpr/runtime_data/ocr/tessdata/lus.traineddata/usr/share/openalpr/runtime_data/ocr/lus.traineddata

使用所需的语言/区域文件(leu、lfr、...)重复更改 lus 的命令

希望对你有帮助

关于c++ - OpenALPR 的段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51761789/

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