Month: July 2014

OpenALPR Install for RPI and UDOO and TRE and YUN

This is the way to install on Linux systems like RPI and UDOO Рshould work well.  thanks to Simon Eriksson

1. Remove the Tesseract and OpenCV packages with apt.  It seems the UDOO libs are at OpenCV 2.3.1 which wont work with the openalpr distro on github.

How to remove an apt application

2. Install all dependencies we will need:

sudo apt-get install autoconf automake libtool
sudo apt-get install libpng12-dev
sudo apt-get install libjpeg62-dev
sudo apt-get install libtiff4-dev
sudo apt-get install zlib1g-dev
sudo apt-get install git-core
sudo apt-get install cmake
sudo apt-get install liblog4cplus-dev libcurl3-dev uuid-dev
sudo apt-get install build-essential (you may already have this)

3. Clone the openalpr repo to the /home/pi directory and extract it:

cd /home/ubuntu  ( or /home/pi ) 
git clone https://github.com/openalpr/openalpr.git

4. Create a directory to hold our libraries and download them all:

cd openalpr
mkdir libraries
cd libraries
wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz
wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz
wget http://www.leptonica.org/source/leptonica-1.70.tar.gz
wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.8/opencv-2.4.8.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fopencvlibrary%2Ffiles%2Fopencv-unix%2F2.4.8%2Fopencv-2.4.8.zip%2Fdownload&ts=1392199888&use_mirror=skylink
mv opencv-2.4.8.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fopencvlibrary%2Ffiles%2Fopencv-unix%2F2.4.8%2Fopencv-2.4.8.zip%2Fdownload opencv-2.4.8.zip

(the last step is required because of the way SF does its direct linking, there may be a better way to do this)

5. Extract all the packages ready to compile them:

tar -zxvf tesseract-ocr-3.02.02.tar.gz
tar -zxvf leptonica-1.70.tar.gz
unzip opencv-2.4.8.zip

6. Compile Leptonica:

cd leptonica-1.70
./configure
make
make install

7. Compile tesseract:

cd ../tesseract-ocr
./autogen.sh
./configure
make
sudo make install
sudo ldconfig
export TESSDATA_PREFIX=/home/pi/openalpr/libraries/tesseract-ocr/tessdata

8. Extract the tesseract language data:

cd ..
tar -zxvf tesseract-ocr-3.02.eng.tar.gz

9. Compile opencv:

Try this first – it has a good tutorial on OpenCV

http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html

cd opencv-2.4.8
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make install

10. Update the CMakeLists for openalpr:

cd ../../../src
nano CMakeLists.txt
Change line 22 and 23 to:
SET(OpenCV_DIR "/usr/local/lib")
SET(Tesseract_DIR "/home/pi/openalpr/libraries/tesseract-ocr")

11. Compile openalpr:

cmake ./
make

That should then allow you to run as per the instructions on openalpr

http://www.openalpr.com/