91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 14.11MB
    文件類型: .rar
    金幣: 1
    下載: 0 次
    發布日期: 2023-06-18
  • 語言: 其他
  • 標簽: SVMANN??

資源簡介

這是一整套的車牌定位程序,其漢字由于作者比較懶做字符集的時候只做了。三個省份的:粵,鄂,湘。這個程序公開是為了向ForeverYang2015致敬,當初是他的公開程序才讓我開始接觸車牌識別。

資源截圖

代碼片段和文件信息

#include?“carID_Detection.h“



void?RgbConvToGray(const?Mat&?inputImageMat?&?outpuImage)??//g?=?0.3R+0.59G+0.11B
{
outpuImage?=?Mat(inputImage.rows?inputImage.cols?CV_8UC1);??

for?(int?i?=?0?;i {
uchar?*ptrGray?=?outpuImage.ptr(i);?
const?Vec3b?*?ptrRgb?=?inputImage.ptr(i);
for?(int?j?=?0?;j {
ptrGray[j]?=?0.3*ptrRgb[j][2]+0.59*ptrRgb[j][1]+0.11*ptrRgb[j][0];
}
}
}

void?posDetect_closeImg(Mat?&inputImage??vector??&?rects??)???//初步找到候選區域?rects
{

Mat?img_canny;
Canny(inputImage?img_canny?150?220);
Mat?img_threshold;
threshold(img_canny??img_threshold0255??CV_THRESH_OTSU+CV_THRESH_BINARY);?//otsu算法自動獲得閾值

Mat?element?=?getStructuringElement(MORPH_RECT?Size(15?3));??//閉形態學的結構元素
morphologyEx(img_threshold?img_thresholdCV_MOP_CLOSEelement);??//形態學處理

//尋找車牌區域的輪廓
vector?>?contours;
findContours(img_threshold?contoursCV_RETR_EXTERNAL?CV_CHAIN_APPROX_NONE);//只檢測外輪廓
//對候選的輪廓進行進一步篩選
vector?>?::iterator?itc?=?contours.begin();

while(?itc?!=?contours.end())
{
RotatedRect?mr?=?minAreaRect(Mat(?*itc?));?//返回每個輪廓的最小有界矩形區域
?? if(!verifySizes_closeImg(mr))??//判斷矩形輪廓是否符合要求
{
itc?=?contours.erase(itc);
}
else?????
{

rects.push_back(mr);
++itc;
}??????
}

}


bool?verifySizes_closeImg(const?RotatedRect?&?candidate)
{
float?error?=?0.4;
const?float?aspect?=?44/14;?//長寬比
int?min?=?100*aspect*100;?//最小區域
int?max?=?180*aspect*180;??//最大區域
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)candidate.size.height;
if(r?<1)
r?=?1/r;

if(?(area??max)?||?(r?rmax)??)
return?false;
else
return?true;
}

void?posDetect(Mat?&inputImage??vector??&?rects??)???//初步找到候選區域?rects
{
Mat?img_sobel;
Sobel(inputImage??img_sobel??CV_8U?10310);

Mat?img_threshold;
threshold(img_sobel??img_threshold0255??CV_THRESH_OTSU+CV_THRESH_BINARY);?//otsu算法自動獲得閾值

Mat?element?=?getStructuringElement(MORPH_RECT?Size(15?3));??//閉形態學的結構元素
morphologyEx(img_threshold?img_thresholdCV_MOP_CLOSEelement);??

//尋找車牌區域的輪廓
vector?>?contours;
findContours(img_threshold?contoursCV_RETR_EXTERNAL?CV_CHAIN_APPROX_NONE);//只檢測外輪廓
//對候選的輪廓進行進一步篩選
vector?>?::iterator?itc?=?contours.begin();

while(?itc?!=?contours.end())
{
RotatedRect?mr?=?minAreaRect(Mat(?*itc?));?//返回每個輪廓的最小有界矩形區域
if(!verifySizes(mr))??//判斷矩形輪廓是否符合要求
{
itc?=?contours.erase(itc);
}
else?????
{
rects.push_back(mr);
++itc;
}??????
}
}

bool?verifySizes(const?RotatedRect?&?candidate)
{
float?error?=?0.4;
const?float?aspect?=?44/14;?//長寬比
int?min?=?20*aspect*20;?//最小區域
in

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????780515??2016-05-05?16:03??CarNumber\CarNumber\ann_xml.xml

?????文件??????12991??2016-05-07?15:46??CarNumber\CarNumber\carID_Detection.cpp

?????文件???????1842??2016-05-07?15:44??CarNumber\CarNumber\carID_Detection.h

?????文件???????4118??2016-05-05?20:19??CarNumber\CarNumber\CarNumber.vcxproj

?????文件???????1308??2016-05-05?20:19??CarNumber\CarNumber\CarNumber.vcxproj.filters

?????文件????????143??2016-03-02?22:19??CarNumber\CarNumber\CarNumber.vcxproj.user

?????文件?????699173??2016-05-07?14:54??CarNumber\CarNumber\Debug\carID_Detection.obj

?????文件????????406??2016-04-30?23:06??CarNumber\CarNumber\Debug\CarNumber.exe.embed.manifest

?????文件????????472??2016-04-30?23:06??CarNumber\CarNumber\Debug\CarNumber.exe.embed.manifest.res

?????文件????????381??2016-05-07?14:54??CarNumber\CarNumber\Debug\CarNumber.exe.intermediate.manifest

?????文件?????????77??2016-05-07?14:54??CarNumber\CarNumber\Debug\CarNumber.lastbuildstate

?????文件???????8291??2016-05-07?14:54??CarNumber\CarNumber\Debug\CarNumber.log

?????文件????????208??2016-04-30?23:06??CarNumber\CarNumber\Debug\CarNumber_manifest.rc

?????文件???????3714??2016-05-07?14:54??CarNumber\CarNumber\Debug\cl.command.1.tlog

?????文件??????80762??2016-05-07?14:54??CarNumber\CarNumber\Debug\CL.read.1.tlog

?????文件???????5272??2016-05-07?14:54??CarNumber\CarNumber\Debug\CL.write.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link-cvtres.read.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link-cvtres.write.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link.11148-cvtres.read.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link.11148-cvtres.write.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link.11148.read.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link.11148.write.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link.16264-cvtres.read.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link.16264-cvtres.write.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link.16264.read.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link.16264.write.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link.16584-cvtres.read.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link.16584-cvtres.write.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link.16584.read.1.tlog

?????文件??????????2??2016-05-07?14:54??CarNumber\CarNumber\Debug\link.16584.write.1.tlog

............此處省略2142個文件信息

評論

共有 條評論

相關資源