opencv之车牌检测(初)
来源:互联网 发布:淘宝信用贷款和网商贷 编辑:程序博客网 时间:2024/06/06 19:54
1.we get the classifier of plates with the way of haar and adaboost too. we can detect the front of the plate or a certain slope plate ,At the same time just can distinguish between blue and white plate。
#include "stdafx.h"#include <iostream>#include "opencv2/opencv.hpp"using namespace cv;using namespace std;int i;void display_number(vector<Rect>plates,Mat&img){cout<<"检测到"<<i<<"个车牌"<<endl;for(int j=0;j<i;j++){ if (j==0){ Rect roi = Rect(plates[0]); Mat roiImg = img(roi); imshow("roi_0", roiImg);cvMoveWindow("roi_0",0,0);} if (j==1){ Rect roi = Rect(plates[1]); Mat roiImg = img(roi); imshow("roi_1", roiImg);cvMoveWindow("roi_1",0,80);}if (j==2){ Rect roi = Rect(plates[0]); Mat roiImg = img(roi); imshow("roi_2", roiImg);cvMoveWindow("roi_2",0,160);}if (j==3){ Rect roi = Rect(plates[3]); Mat roiImg = img(roi); imshow("roi_3", roiImg);cvMoveWindow("roi_3",0,240);}if (j==4){ Rect roi = Rect(plates[4]); Mat roiImg = img(roi); imshow("roi_4", roiImg);cvMoveWindow("roi_4",0,320);}if (j==5){ Rect roi = Rect(plates[5]); Mat roiImg = img(roi); imshow("roi_5", roiImg);cvMoveWindow("roi_5",0,400);}if (j==6){ Rect roi = Rect(plates[6]); Mat roiImg = img(roi); imshow("roi_6", roiImg);cvMoveWindow("roi_6",0,480);}if (j==7){ Rect roi = Rect(plates[7]); Mat roiImg = img(roi); imshow("roi_7", roiImg);cvMoveWindow("roi_7",0,560);}} }int main(){CascadeClassifier classifier("D://haar_xml//chepaihao//cascade.xml"); Mat img = imread("D://vvoo//chepai3.jpg"); //读取照片vector<Rect> plates; //代表车牌区域(这里就是58×18)classifier.detectMultiScale(img, plates,1.1, 3, 0);for( i =0; i < plates.size(); i++) { /*cout<<"plate.x="<<plates[i].x<<endl<<"plate.x="<<plates[i].y<<endl;cout<<"plate.width="<<plates[i].width<<endl<<"plate.height="<<plates[i].height<<endl;*//*rectangle(img, Point(plates[i].x-plates[i].width*0.1,plates[i].y-plates[i].height*0.1),Point(plates[i].x+plates[i].width*1.1,plates[i].y+plates[i].height*1.1) ,Scalar(255, 0, 255), 2);*/rectangle(img, plates[i], Scalar(255, 0,255), 2);}display_number(plates,img);Mat ResizeImage;Size outSize;outSize.width=img.cols*0.25;outSize.height=img.rows*0.25;resize(img,ResizeImage,outSize,0,0,INTER_LINEAR);imshow("plates", ResizeImage);waitKey(0);return 0;}
As can be seen from the figure below, there is some error in the detection of this classifier.
2.let's appreciate the actual result of plate detection.
I don't understand why the same plates number is detected two times,the result of detector is better if the pixels of image is more!
1.http://lib.csdn.net/article/45/57492?knId=1221
阅读全文
0 1
- opencv之车牌检测(初)
- OpenCV:车牌检测(定位)
- 车牌检测--master opencv
- 【OpenCV学习笔记】【教程翻译】三( 车牌检测之区域分割)
- 【OpenCV学习笔记】【教程翻译】四(车牌检测之SVM分类)
- 学习OpenCV——车牌检测(定位)
- 学习OpenCV——车牌检测(定位)
- 学习OpenCV——车牌检测(定位)
- 学习OpenCV——车牌检测(定位)
- yolo v2 之车牌检测
- opencv 学习之 车牌提取
- opencv 学习之 车牌识别
- yolo v2之车牌检测后续识别字符(一)
- yolo v2之车牌检测后续识别字符(二)
- python+openCV利用cascade分类器训练实现实时视频车辆检测与车牌检测(一)
- opencv实现车牌识别之字符分割
- opencv实现车牌识别之字符识别
- opencv实现车牌识别之字符分割
- 《设计心理学》
- Spring--MVC--如何书写MVC的控制层Controller
- 虚拟机下Linux系统的安装及项目部署详解
- Centos 7 防火墙
- [YTU ]_2736指针练习--输出最大值
- opencv之车牌检测(初)
- hdu 1196 水题
- 使用PHPMailer发送
- 拾遗计划:从蒟蒻到神犇的地图
- C/C++_log2000_C语言中的宏定义与宏函数定义1
- 网站域名一二
- [YTU]_2738 指针练习--变量交换
- keepalive
- Tensorflow基础知识