【问题标题】:Segmentation fault with OpenALPROpenALPR 的分段错误
【发布时间】:2018-08-09 08:04:08
【问题描述】:

我正在尝试在 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。我将它从那里复制到目录中,再次尝试识别但这次:

--(!) 运行时目录 '/usr/share/openalpr/runtime_data' 无效。缺少国家/地区的 OCR 数据:“我们”! 加载 OpenALPR 时出错

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

分段错误(核心转储)

【问题讨论】:

    标签: c++ ocr openalpr


    【解决方案1】:

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

    我遇到了其他解决方案;这不是最好的方法,但它可能会奏效。

    我创建了一个从 /usr/share/openalpr/runtime_data/ocr/tessdata/lus.traineddata/usr/share/openalpr/runtime_data/ocr/lus.traineddata 的符号链接,以便在 tesseract/openalpr 期望的位置提供 trainedData 文件。

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

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

    希望对你有帮助

    【讨论】:

      【解决方案2】:

      这是因为经过语言训练的数据在 tesseract 4.0 中位于 [runtime_data path]/ocr/tessdata/ 中,而 tesseract 3.0 将它们存储在 [runtime_data path]/ocr/ 中。

      此问题已在this commit 中修复。

      但似乎apt-get存储库中的openalpr版本在此提交之后。

      所以临时解决方案是像 daniellilu 的解决方案一样将语言数据移动到 [runtime_data path]/ocr

      由于“美国”国家配置只需要 lus.traineddata 文件,您只需移动 lus.traineddata 文件。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-11-18
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多