I'm trying to install OpenALPR on Laravel Homestead (Ubuntu 18.04). First I tried The Easiest Way. I'm trying to run:
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)
I cd
into /usr/share/openalpr/runtime_data/ocr
directory, and I did not find the lus.traineddata
file. But there was an ocr folder and there was a lus.traineddata
. I copied it from there to the directory up, tried again to recognize but this time:
--(!) Runtime directory '/usr/share/openalpr/runtime_data' is invalid. Missing OCR data for the country: 'us'! Error loading OpenALPR
Then I tried The Easy Way. Everything was compiled normally. But:
Segmentation fault (core dumped)
This happens because openALPR's Tesseract OCR expects its trained data in a specific path and the files are not there. According to the error message it can be set using the
TESSDATA_PREFIX
environment variable but in my own experience didn't work.I came accross with nother solution; it's not the best way but it may work.
I created a symbolic link from
/usr/share/openalpr/runtime_data/ocr/tessdata/lus.traineddata
to/usr/share/openalpr/runtime_data/ocr/lus.traineddata
in order to make the trainedData files available to tesseract/openalpr right where they expect them.sudo ln -s /usr/share/openalpr/runtime_data/ocr/tessdata/lus.traineddata /usr/share/openalpr/runtime_data/ocr/lus.traineddata
repeat the command changing
lus
with the desired language/region file (leu, lfr, ...)Hope it helps