forked from openalpr/openalpr
-
Notifications
You must be signed in to change notification settings - Fork 0
Compilation instructions (Ubuntu Linux)
Henry edited this page Mar 20, 2016
·
18 revisions
wget -O - http://deb.openalpr.com/openalpr.gpg.key | sudo apt-key add -
echo "deb http://deb.openalpr.com/master/ openalpr main" | sudo tee /etc/apt/sources.list.d/openalpr.list
sudo apt-get update
sudo apt-get install openalpr openalpr-daemon openalpr-utils libopenalpr-dev
Test the library
wget http://plates.openalpr.com/ea7the.jpg
alpr -c us ea7the.jpg
wget http://plates.openalpr.com/h786poj.jpg
alpr -c eu h786poj.jpg
# Install prerequisites
sudo apt-get install libopencv-dev libtesseract-dev git cmake build-essential libleptonica-dev
sudo apt-get install liblog4cplus-dev libcurl3-dev
# If using the daemon, install beanstalkd
sudo apt-get install beanstalkd
# Clone the latest code from GitHub
git clone https://github.com/openalpr/openalpr.git
# Setup the build directory
cd openalpr/src
mkdir build
cd build
# setup the compile environment
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc ..
# compile the library
make
# Install the binaries/libraries to your local system (prefix is /usr)
sudo make install
# Test the library
wget http://plates.openalpr.com/h786poj.jpg -O lp.jpg
alpr lp.jpg
- Make sure that dependencies and required tools are installed
sudo apt-get install --assume-yes libpng12-dev libjpeg62-dev libtiff4-dev zlib1g-dev
sudo apt-get install --assume-yes build-essential
sudo apt-get install --assume-yes autoconf automake libtool
sudo apt-get install --assume-yes git-core
sudo apt-get install --assume-yes cmake
- install opencv (tutorial) *http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html
- download and install leptonica and tesseract-ocr
- tesseract-ocr requires leptonica and at least one language package.
- http://www.leptonica.org/source/leptonica-1.70.tar.gz
- https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz
- https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz
- move the downloaded tarballs to some directory. I will assume that they are located at /usr/local/src/openalpr/.
- unpack the tarballs:
- tar xf /usr/local/src/openalpr/tesseract-ocr-3.02.02.tar.gz
- tar xf /usr/local/src/openalpr/tesseract-ocr-3.02.02.eng.tar.gz
- tar xf /usr/local/src/openalpr/leptonica-1.70.tar.gz
- compile leptonica:
- cd /usr/local/src/openalpr/leptonica-1.70/
- ./configure --prefix=/usr/local
- make
- make install
- compile tesseract:
- cd /usr/local/src/openalpr/tesseract-ocr/
- ./autogen.sh
- ./configure
- make
- sudo make install
- sudo ldconfig
- clone the openalpr repo to /usr/local/src/openalpr/ directory
- cd /usr/local/src/openalpr/
- git clone https://github.com/openalpr/openalpr.git
- update CMakeLists.txt compile openalpr
- cd /usr/local/src/openalpr/openalpr/
- gedit CMakeLists.txt &
- SET(OpenCV_DIR "/usr/local/lib")
- SET(Tesseract_DIR "/usr/local/src/openalpr/tesseract-ocr")
- cmake ./
- make
Note: For Tesseract 3.03 the source files can be downloaded from the main svn branch or https://drive.google.com/folderview?id=0B7l10Bj_LprhQnpSRkpGMGV2eE0&usp=sharing#list.