Openalpr: Tesseract Issue in Ubuntu Bionic

Created on 21 May 2019  路  6Comments  路  Source: openalpr/openalpr

I installed openalpr using the following command

sudo apt-get install openalpr openalpr-daemon openalpr-utils libopenalpr-dev

I am using the following command on the Ubuntu Bionic

alpr filename2019-04-06_16_55_07.780321.h264.mp4

But getting the following error

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!
Frame: 0
Segmentation fault (core dumped)

Most helpful comment

The problem is that is trying to get the locales from /usr/share/openalpr/runtime_data/ocr/ but I don't know why in this version the locales are located in a subfolder called tessdata.

You can solve this performing a copy of all the files inside the folder tessdata. Code:
sudo cp -r /usr/share/openalpr/runtime_data/ocr/tessdata/* /usr/share/openalpr/runtime_data/ocr/

I hope it helps.

All 6 comments

The problem is that is trying to get the locales from /usr/share/openalpr/runtime_data/ocr/ but I don't know why in this version the locales are located in a subfolder called tessdata.

You can solve this performing a copy of all the files inside the folder tessdata. Code:
sudo cp -r /usr/share/openalpr/runtime_data/ocr/tessdata/* /usr/share/openalpr/runtime_data/ocr/

I hope it helps.

It should be hitting this line. Is Tesseract non Bionic not reporting as 4.0+?

https://github.com/openalpr/openalpr/blob/5097221a464edf8f5f33bd0569bbdf45dd5baa31/src/openalpr/ocr/tesseract_ocr.cpp#L47

libtesseract-4 in Bionic is versioned 4.0.0-beta.1 which I suspect is throwing off the above version check.

the version compare works. It's just not in the Bionic release since its as introduced in 28e0b0fa95c12923138768d670b852242a750d0c.

I'd suggest maybe leaving a note for those on 18.04 to run the command @isaactoes suggests

sudo cp -a /usr/share/openalpr/runtime_data/ocr/tessdata/*.traineddata /usr/share/openalpr/runtime_data/ocr/
It works for me :)

Was this page helpful?
0 / 5 - 0 ratings