开源车牌识别项目,OpenALPR

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

简介

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

环境配置

OpenALPR需要这些依赖的库:

1、安装一些相关的库。

# 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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

2、到github上下载源码。

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

3、编译源码并安装。

# 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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

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

测试

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

下载几幅图片:

wget http://plates.openalpr.com/ea7the.jpg
wget http://plates.openalpr.com/h786poj.jpg
  • 1
  • 2

这里写图片描述

识别车牌:

输入指令:

alpr -c us ea7the.jpg
  • 1

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

输入指令:

alpr -c eu h786poj.jpg
  • 1

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

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

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

xhb@xhb-GL552JX:~/Study/OpenALPR/pic$ alpr --help

USAGE: 

   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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61

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

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值