Skip to content

Compilation instructions (Ubuntu Linux)

Henry edited this page Mar 20, 2016 · 18 revisions

The Easiest Way

(Ubuntu 14.04 64-bit)

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

The Easy Way

(Ubuntu 14.04+)

# 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

The Harder Way (Compile all dependencies manually)

  1. 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
  1. install opencv (tutorial) *http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html
  2. download and install leptonica and tesseract-ocr
  1. 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
  1. compile leptonica:
  • cd /usr/local/src/openalpr/leptonica-1.70/
  • ./configure --prefix=/usr/local
  • make
  • make install
  1. compile tesseract:
  • cd /usr/local/src/openalpr/tesseract-ocr/
  • ./autogen.sh
  • ./configure
  • make
  • sudo make install
  • sudo ldconfig
  1. clone the openalpr repo to /usr/local/src/openalpr/ directory
  1. 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.

Clone this wiki locally