xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡(jiǎn)介

本資源為HOG+SVM實(shí)現(xiàn)的行人檢測(cè)系統(tǒng),包括完整的訓(xùn)練、檢測(cè)和測(cè)試程序。檢測(cè)程序運(yùn)行環(huán)境為VS2013+opencv2.4.13和QT+opencv3.1.0,測(cè)試程序運(yùn)行環(huán)境為matlab2016,具體運(yùn)行方法見資源中的.txt說(shuō)明文件。

資源截圖

代碼片段和文件信息

//?Pedestriandetection.cpp?:?定義控制臺(tái)應(yīng)用程序的入口點(diǎn)。
//

#include?“stdafx.h“

#include?
#include?
#include?
#include?
#include?
#include?
#include?

#include?
#include
#include?
#include?
#include?“opencv2/video/background_segm.hpp“
#include?

using?namespace?std;
using?namespace?cv;

#define?PosSamNO?2400??//正樣本個(gè)數(shù)
#define?NegSamNO?12660????//負(fù)樣本個(gè)數(shù)

#define?TRAIN?false???//是否進(jìn)行訓(xùn)練true表示重新訓(xùn)練,false表示讀取xml文件中的SVM模型
#define?CENTRAL_CROP?true???//true:訓(xùn)練時(shí),對(duì)96*160的INRIA正樣本圖片剪裁出中間的64*128大小人體

//HardExample:負(fù)樣本個(gè)數(shù)。如果HardExampleNO大于0,表示處理完初始負(fù)樣本集后,繼續(xù)處理HardExample負(fù)樣本集。
//不使用HardExample時(shí)必須設(shè)置為0,因?yàn)樘卣飨蛄烤仃嚭吞卣黝悇e矩陣的維數(shù)初始化時(shí)用到這個(gè)值
#define?HardExampleNO?0??

void?press(HOGDescriptor?&myHOG?Mat?src);
//繼承自CvSVM的類,因?yàn)樯蓅etSVMDetector()中用到的檢測(cè)子參數(shù)時(shí),需要用到訓(xùn)練好的SVM的decision_func參數(shù),
//但通過(guò)查看CvSVM源碼可知decision_func參數(shù)是protected類型變量,無(wú)法直接訪問到,只能繼承之后通過(guò)函數(shù)訪問
class?MySVM?:?public?CvSVM
{
public:
//獲得SVM的決策函數(shù)中的alpha數(shù)組??
double?*?get_alpha_vector()
{

return?this->decision_func->alpha;
}

//獲得SVM的決策函數(shù)中的rho參數(shù)即偏移量??
float?get_rho()
{
return?this->decision_func->rho;
}
};



int?main()
{
//檢測(cè)窗口(64128)塊尺寸(1616)塊步長(zhǎng)(88)cell尺寸(88)直方圖bin個(gè)數(shù)9
HOGDescriptor?hog(Size(64?128)?Size(16?16)?Size(8?8)?Size(8?8)?9);//HOG檢測(cè)器,用來(lái)計(jì)算HOG描述子的
int?DescriptorDim;//HOG描述子的維數(shù),由圖片大小、檢測(cè)窗口大小、塊大小、細(xì)胞單元中直方圖bin個(gè)數(shù)決定
MySVM?svm;//SVM分類器

//若TRAIN為true,重新訓(xùn)練分類器
if?(TRAIN)
{
string?ImgName;//圖片名(絕對(duì)路徑)
ifstream?finPos(“E:\\項(xiàng)目\\數(shù)字圖像處理\\INRIAPerson\\INRIAPerson\\96X160H96\\Train\\INRIAPerson96X160PosList.txt“);//正樣本圖片的文件名列表
//ifstream?finPos(“PersonFromVOC2012List.txt“);//正樣本圖片的文件名列表
ifstream?finNeg(“E:\\項(xiàng)目\\數(shù)字圖像處理\\INRIAPerson\\INRIAPerson\\NoPersonFromINRIAList.txt“);//負(fù)樣本圖片的文件名列表

Mat?sampleFeatureMat;//所有訓(xùn)練樣本的特征向量組成的矩陣,行數(shù)等于所有樣本的個(gè)數(shù),列數(shù)等于HOG描述子維數(shù)
Mat?sampleLabelMat;//訓(xùn)練樣本的類別向量,行數(shù)等于所有樣本的個(gè)數(shù),列數(shù)等于1;1表示有人,-1表示無(wú)人


//依次讀取正樣本圖片,生成HOG描述子
for?(int?num?=?0;?num {
cout?< //ImgName?=?“D:\\DataSet\\PersonFromVOC2012\\“?+?ImgName;//加上正樣本的路徑名
ImgName?=?“E:\\項(xiàng)目\\數(shù)字圖像處理\\INRIAPerson\\INRIAPerson\\96X160H96\\Train\\pos\\“?+?ImgName;//加上正樣本的路徑名
Mat?src?=?imread(ImgName);//讀取圖片
if?(CENTRAL_CROP)
src?=?src(Rect(16?16?64?128));//將96*160的INRIA正樣本圖片剪裁為64*128,即剪去上下左右各16個(gè)像素
//resize(srcsrcSize(64128));

vector?descriptors;//HOG描述子向量
hog.compute(src?descriptors?Size(8?8));//計(jì)算HOG描述子,檢測(cè)窗口移動(dòng)步長(zhǎng)(88)
//
cout?<riptors.size()?<
//處理第一個(gè)樣本時(shí)初始化特征向量矩陣和類別矩陣,因?yàn)橹挥兄懒颂卣飨蛄康木S數(shù)才能初始化特征向量矩陣
if?(0?==?num)
{
DescriptorDim?=?descriptors.size();//HOG描述子的維數(shù)
//初始化所有訓(xùn)練樣本的特征向量組成的矩陣,行數(shù)等于所有樣本的個(gè)數(shù),列數(shù)等于HOG描述子維數(shù)sampleFeatureMat
sampleFeatureMat?=?Ma

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-03-25?00:41??行人檢測(cè)工程文件\
?????目錄???????????0??2019-03-25?00:40??行人檢測(cè)工程文件\Pedestriandetection\
?????目錄???????????0??2019-03-25?00:40??行人檢測(cè)工程文件\Pedestriandetection\Debug\
?????文件??????184320??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Debug\Pedestriandetection.exe
?????文件??????960104??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Debug\Pedestriandetection.ilk
?????文件?????3165184??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Debug\Pedestriandetection.pdb
?????文件???????44073??2018-05-18?19:51??行人檢測(cè)工程文件\Pedestriandetection\HOGDetectorForOpenCV.txt
?????目錄???????????0??2019-03-25?00:40??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\
?????目錄???????????0??2019-03-25?00:40??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\
?????目錄???????????0??2019-03-25?00:40??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\Pedestri.EA9A9B55.tlog\
?????文件???????13766??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\Pedestri.EA9A9B55.tlog\CL.read.1.tlog
?????文件????????1384??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\Pedestri.EA9A9B55.tlog\CL.write.1.tlog
?????文件?????????169??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\Pedestri.EA9A9B55.tlog\Pedestriandetection.lastbuildstate
?????文件????????1878??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\Pedestri.EA9A9B55.tlog\cl.command.1.tlog
?????文件????????2438??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\Pedestri.EA9A9B55.tlog\link.command.1.tlog
?????文件????????5028??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\Pedestri.EA9A9B55.tlog\link.read.1.tlog
?????文件?????????726??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\Pedestri.EA9A9B55.tlog\link.write.1.tlog
?????文件????????3373??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\Pedestriandetection.log
?????文件??????824508??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\Pedestriandetection.obj
?????文件?????1703936??2018-05-13?10:24??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\Pedestriandetection.pch
?????文件???????11194??2018-05-13?10:24??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\stdafx.obj
?????文件??????756736??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\vc120.idb
?????文件?????1781760??2018-05-18?19:50??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Debug\vc120.pdb
?????文件???????13053??2018-05-18?19:51??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Pedestriandetection.cpp
?????文件????????4672??2018-05-13?10:24??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Pedestriandetection.vcxproj
?????文件????????1326??2018-05-13?10:19??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\Pedestriandetection.vcxproj.filters
?????文件????????1594??2018-05-13?10:19??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\ReadMe.txt
?????文件?????????225??2018-05-13?10:19??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\stdafx.cpp
?????文件?????????234??2018-05-13?10:19??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\stdafx.h
?????文件?????????236??2018-05-13?10:19??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection\targetver.h
?????文件??????????44??2018-05-18?19:47??行人檢測(cè)工程文件\Pedestriandetection\Pedestriandetection.opensdf
............此處省略20個(gè)文件信息

評(píng)論

共有 條評(píng)論