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)
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+?
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 :)
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.