http://www.cnblogs.com/subconscious/p/3979988.html
2)Ubuntu环境:
root@Slave1:~# uname -a编辑:
#include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; int main(int argc, char** argv ) { if ( argc != 2 ) { printf("usage: DisplayImage.out <Image_Path>\n"); return -1; } Mat image; image = imread( argv[1], 1 ); if ( !image.data ) { printf("No image data \n"); return -1; } namedWindow("Display Image", WINDOW_AUTOSIZE ); imshow("Display Image", image); waitKey(0); return 0; }#vi CMakeLists.txt
cmake_minimum_required(VERSION 2.8) project( DisplayImage ) find_package( OpenCV REQUIRED ) add_executable( DisplayImage DisplayImage.cpp ) target_link_libraries( DisplayImage ${OpenCV_LIBS} )
4)EasyPR安装:
https://github.com/liuruoze/EasyPR 下载EasyPR-master.zip
#unzip EasyPR-master.zip
解压到/home目录下
#cd EasyPR-master
#vi CMakeLists.txt
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/share/OpenCV")
修改为opencv的CMake配置文件路径
#cmake CMakeLists.txt
#make -j 12
生成demo_linux_amd64可执行程序,用于测试。
5)测试:
#cd EasyPR-master
#./demo_linux_amd64 ?
有5个命令
ann ann operation
judge determine whether an image block is the license plate
locate locate plates in an image
recognize plate recognition
svm svm operations
#./demo_linux_amd64 recognize -p resources/image/plate_recognize.jpg --svm resources/model/svm.xml --ann resources/model/ann.xml
可以训练自己的样本来提升识别。
参考: