-1

I tried to install openalpr in raspberry pi for identify plates. I already install leptonica-1.70 and tesseract-ocr. These directories are in /home/pi. This is I tried tutorial video. When I try to run openalpr by using alpr -c us filename.jpg for identify plate, then i get this error massage.

Warning: You are running an unsupported version of Tesseract.
Expecting at least 3.03, your version is: 3.02.02
Error opening data file /usr/local/share/tessdata/lus.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.
Failed loading language 'lus' Tesseract couldn't load any languages! Segmentation fault

I edited CMakeLists.txt file as shown below. This CMakeLists.txt is in /home/pi/openalpr/src derectory.

SET(OpenCV_DIR "/usr/local/lib")
SET(Tesseract_DIR "/home/pi/tesseract-ocr/tessdata")

How to solve this problem? When /usr/local/shere derectory there is no tessdata folder but tessdata folder have in /home/pi/tesseract-ocr folder but there is no lus.traineddata file.

  • Please show consideration for the people you are asking for help by indicating cross-posting: stackoverflow.com/q/32549939/1151724 Otherwise such people may end up wasting their time providing an answer somebody else already gave you somewhere else. Note that while we do not have a specific policy against cross-posting, other S.E. sites may, in which case you will have to ask there, wait a period of time, and if you do not receive a satisfactory answer, then ask somewhere else. – goldilocks Sep 13 '15 at 15:08
  • I believe the message You are running an unsupported version of Tesseract is pretty explicit about the problem you're having. – Dmitry Grigoryev Jan 18 '17 at 8:36
0

I'm not a Cmake user but what you have done probably doesn't set $TESSDATA_PREFIX, since this is a runtime environment variable, and even if it is used in compilation, it may have been set in a subshell, which will not affect the parent shell when compilation is finished.

Try:

export TESSDATA_PREFIX=/home/pi/tesseract-ocr

This may not work exactly like that, since the nature of the prefix isn't clear to me. However, it should at least change the error such that you now get something like

Error opening data file /home/pi/tesseract-ocr/tessdata/lus.traineddata

Which should allow you to tweak the value until the path works correctly.

Note that setting an environment variable this way will not make it permanent, and it will only affect your current shell and its descendants. However, since setting and using env variables with bash (the default shell on Raspbian) is well documented elsewhere, I will not regurgitate anything further.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.