开源车牌识别项目,OpenALPR

来源:互联网 发布:nrf24l01与单片机连接 编辑:程序博客网 时间:2024/06/05 22:01

今天在github上看到了一个开源的车牌识别项目,OpenALPR。github链接
我以前自己在MATLAB上编写了一个简单的车牌识别的程序,使用的是传统模板匹配法。只是有了初步的效果,还有很多需要完善的。
博文链接:数字图像处理:基于MATLAB的车牌识别项目

简介

OpenALPR是一种使用C ++编写的开源自动车牌识别库,还能支持:
C#,Java,Node.js,Go和Python。
该库可以分析图像和视频流以识别车牌。
输出的结果是车牌上的字符。

环境配置

OpenALPR需要这些依赖的库:

  • Tesseract OCR v3.0.4 (https://github.com/tesseract-ocr/tesseract)
  • OpenCV v2.4.8+ (http://opencv.org/)

1、安装一些相关的库。

# Install prerequisitessudo apt-get install libopencv-dev libtesseract-dev git cmake build-essential libleptonica-devsudo apt-get install liblog4cplus-dev libcurl3-dev# If using the daemon, install beanstalkdsudo apt-get install beanstalkd

2、到github上下载源码。

git clone https://github.com/openalpr/openalpr.git

3、编译源码并安装。

# Setup the build directorycd openalpr/srcmkdir buildcd build# setup the compile environmentcmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc ..# compile the librarymake# Install the binaries/libraries to your local system (prefix is /usr)sudo make install

这里给出了有三种安装方法:Compilation instructions (Ubuntu Linux)

测试

alpr支持命令行,直接在命令行输入alpr [图片文件路径]即可。

下载几幅图片:

wget http://plates.openalpr.com/ea7the.jpgwget http://plates.openalpr.com/h786poj.jpg

这里写图片描述

识别车牌:

输入指令:

alpr -c us ea7the.jpg

识别结果:
这里写图片描述

输入指令:

alpr -c eu h786poj.jpg

识别结果:
这里写图片描述

这里两幅图片的车牌是不同国家的,一个是美国的,一个是欧洲的,-c 表示选择车牌的国家,默认选择美国的。

alpr指令说明:
输入alpr --help查看指令说明:

xhb@xhb-GL552JX:~/Study/OpenALPR/pic$ alpr --helpUSAGE:    alpr  [-c <country_code>] [--config <config_file>] [-n <topN>] [--seek         <integer_ms>] [-p <pattern code>] [--motion] [--clock] [-d]         [--debug] [-j] [--] [--version] [-h] <> ...Where:    -c <country_code>,  --country <country_code>     Country code to identify (either us for USA or eu for Europe).      Default=us   --config <config_file>     Path to the openalpr.conf file   -n <topN>,  --topn <topN>     Max number of possible plate numbers to return.  Default=10   --seek <integer_ms>     Seek to the specified millisecond in a video file. Default=0   -p <pattern code>,  --pattern <pattern code>     Attempt to match the plate number against a plate pattern (e.g., md     for Maryland, ca for California)   --motion     Use motion detection on video file or stream.  Default=off   --clock     Measure/print the total time to process image and all plates.      Default=off   -d,  --detect_region     Attempt to detect the region of the plate image.  [Experimental]      Default=off   --debug     Enable debug output.  Default=off   -j,  --json     Output recognition results in JSON format.  Default=off   --,  --ignore_rest     Ignores the rest of the labeled arguments following this flag.   --version     Displays version information and exits.   -h,  --help     Displays usage information and exits.   <>  (accepted multiple times)     (required)  Image containing license plates   OpenAlpr Command Line Utility

接下来可以愉快地玩耍了,可以去阅读源码或是制作各种应用。
︿( ̄︶ ̄)︿

原创粉丝点击