Linux下安装配置EasyPR中文车牌识别系统
? ? ?參考:
? ? ?https://github.com/liuruoze/EasyPR/blob/master/Usage.md
? ? ?http://www.cnblogs.com/justinzhang/p/5523649.html
? ? ?http://www.cnblogs.com/subconscious/p/3979988.html
2)Ubuntu環境:
? ? ?root@Slave1:~# uname -a? ? ?Linux Slave1 3.16.0-77-generic #99~14.04.1-Ubuntu SMP Tue Jun 28 19:17:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
? ? ?GCC/G++安裝:#gcc --versiongcc
? ? ? ? ? ? ? ? ? (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
? ? ? ? ? ? ? ? ? #apt-get install g++
? ? ? ? ? ? ? ? ? #g++ --version?
? ? ? ? ? ? ? ? ? g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4?
? ? ?CMake安裝:Ubunut默認cmake version 2.8.12.2
? ? ? ? ? ? ? ? EasyPR要求cmake版本3.1.0+,需要升級
? ? ? ? ? ? ? ?#add-apt-repository ppa:george-edison55/cmake-3.x
? ? ? ? ? ? ? ?#apt-get update
? ? ? ? ? ? ? ?#apt-get install cmake
? ? ? ? ? ? ? ?#cmake --version ?
? ? ? ? ? ? ? ? ?cmake version 3.2.2?
? ?3)Opencv安裝:
? ? ?http://opencv.org/downloads.html 下載opencv-3.1.0.zip放在/home目錄下
? ? ?#unzip opencv-3.1.0.zip
? ? ?解壓到/home目錄下
? ? ?#cd opencv-3.1.0
? ? ?#mkdir release
? ? ?#cd release
? ? ?#cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
? ? ?#make?
? ? ?#make install
? ? ?測試:
? ? ?#mkdir /tmp/opencvdemo
? ? ?#cd /tmp/opencvdemo
? ? ?#vi DisplayImage.cpp
? ? ?編輯:?
#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} )?#cmake .
? ? ? #make
? ? ? #./DisplayImage uk722.jpg ?//要顯示圖片需要安裝GTK+ 2.x版本
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
? ? ?可以訓練自己的樣本來提升識別。
? 參考:
總結
以上是生活随笔為你收集整理的Linux下安装配置EasyPR中文车牌识别系统的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: EasyPR-Java开源中文车牌识别系
- 下一篇: Java程序执行Linux命令调用Eas