车牌识别基于OpenCV
发布时间
阅读量:
阅读量
#include<opencv2\opencv.hpp>
#include
//该函数用于验证是否为所需的区域,车牌定位的原理是在图像中寻找矩形,可以通过长宽比例以及面积来判断是否为目标矩形,宽高比为520/110=4.7272(即车牌的长除以宽),区域面积最小为15个像素,最大为125个像素
bool VerifySize(RotatedRect candidate) { float error = 0.4; //40%的误差范围
float aspect = 4.7272;//宽高比例
int min = 25 * aspect * 25; //最小像素为15
int max = 125 * aspect * 125;//最大像素为125
float rmin = aspect - aspect*error;//最小误差
float rmax = aspect + aspect*error;//最大误差
int area = candidate.size.height*candidate.size.width;//计算面积
float r = (float)candidate.size.width / (float)c
全部评论 (0)
还没有任何评论哟~
