训练:
git clone https://github.com/openalpr/train-detector.git
1、 opencv
安装cmake及一些依赖库
sudo apt-get install cmakesudo apt-get install build-essential libgtk2.0-dev libavcodec-dev
libavformat-dev libjpeg.dev libtiff4.dev libswscale-dev libjasper-dev
2、安装OpenCV
从官网下载opencv并解压,cd命令进入opencv的目录
cmake .
sudo make
sudo makeinstall
sudo updatedb #更新database
Once you are ready to start training, enter the following commands:
- rm ./out/* (clear the out folder in case it has data from previous runs)
- ./prep.py neg
- ./prep.py pos
- ./prep.py train
- Copy the output from the above command onto the command line. You should adjust the numStages to a smaller value (usually 12 stages works well, but it will depend on your input images). You may also need to adjust the numPos value to a smaller number in order to complete the training.
Copy the out/cascade.xml file to your OpenALPR runtime directory (runtime_data/region/[countrycode].xml). You should now be able to use the region for plate detection.
进入openalpr/openalpr
# 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
http://blog.csdn.net/lanbing510/article/details/41698517