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

  • 大小: 10.07MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-10-06
  • 語言: 其他
  • 標簽: hog??opencv??

資源簡介

配置好opencv249和VS2012的環境之后,設置好工程項目的屬性,運行HOGvisualize\Debug或HOGvisualize\Release目錄下的opencvtest.exe程序便可看到運行結果,即objimg.jpg圖片的hog特征可視化圖像hogvisualize.jpg。程序里有較為詳細的注釋,可以幫助理解hog特征的可視化過程,希望此程序對你有幫助,謝謝。

資源截圖

代碼片段和文件信息

#include?“opencvtest.h“

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

//?HOGDescriptor?visual_imagealizer
//?adapted?for?arbitrary?size?of?feature?sets?and?training?images
Mat?get_hogdescriptor_visual_image(Mat&?origImg
vector&?descriptorValues//hog特征向量
Size?winSize//圖片窗口大小
Size?cellSize?????????????
int?scaleFactor//縮放背景圖像的比例
double?viz_factor)//縮放hog特征的線長比例
{???
Mat?visual_image;//最后可視化的圖像大小
resize(origImg?visual_image?Size(origImg.cols*scaleFactor?origImg.rows*scaleFactor));

int?gradientBinSize?=?9;
//?dividing?180°?into?9?bins?how?large?(in?rad)?is?one?bin?
float?radRangeForOneBin?=?3.14/(float)gradientBinSize;?//pi=3.14對應180°

//?prepare?data?structure:?9?orientation?/?gradient?strenghts?for?each?cell
int?cells_in_x_dir?=?winSize.width?/?cellSize.width;//x方向上的cell個數
int?cells_in_y_dir?=?winSize.height?/?cellSize.height;//y方向上的cell個數
int?totalnrofcells?=?cells_in_x_dir?*?cells_in_y_dir;//cell的總個數
//注意此處三維數組的定義格式
//int?***b;
//int?a[2][3][4];
//int?(*b)[3][4]?=?a;
//gradientStrengths[cells_in_y_dir][cells_in_x_dir][9]
float***?gradientStrengths?=?new?float**[cells_in_y_dir];
int**?cellUpdateCounter???=?new?int*[cells_in_y_dir];
for?(int?y=0;?y {
gradientStrengths[y]?=?new?float*[cells_in_x_dir];
cellUpdateCounter[y]?=?new?int[cells_in_x_dir];
for?(int?x=0;?x {
gradientStrengths[y][x]?=?new?float[gradientBinSize];
cellUpdateCounter[y][x]?=?0;

for?(int?bin=0;?bin gradientStrengths[y][x][bin]?=?0.0;//把每個cell的9個bin對應的梯度強度都初始化為0
}
}

//?nr?of?blocks?=?nr?of?cells?-?1
//?since?there?is?a?new?block?on?each?cell?(overlapping?blocks!)?but?the?last?one
//相當于blockstride?=?(88)
int?blocks_in_x_dir?=?cells_in_x_dir?-?1;
int?blocks_in_y_dir?=?cells_in_y_dir?-?1;

//?compute?gradient?strengths?per?cell
int?descriptorDataIdx?=?0;
int?cellx?=?0;
int?celly?=?0;

for?(int?blockx=0;?blockx {
for?(int?blocky=0;?blocky {
//?4?cells?per?block?...
for?(int?cellNr=0;?cellNr<4;?cellNr++)
{
//?compute?corresponding?cell?nr
int?cellx?=?blockx;
int?celly?=?blocky;
if?(cellNr==1)?celly++;
if?(cellNr==2)?cellx++;
if?(cellNr==3)
{
cellx++;
celly++;
}

for?(int?bin=0;?bin {
float?gradientStrength?=?descriptorValues[?descriptorDataIdx?];
descriptorDataIdx++;

gradientStrengths[celly][cellx][bin]?+=?gradientStrength;//因為C是按行存儲

}?//?for?(all?bins)


//?note:?overlapping?blocks?lead?to?multiple?updates?of?this?sum!
//?we?therefore?keep?track?how?often?a?cell?was?updated
//?to?compute?average?gradient?strengths
cellUpdateCounter[celly][cellx]++;//由于block之間有重疊,所以要記錄哪些cell被多次計算了

}?//?for?(all?cells)


}?//?for?(all?block?x?pos)
}?//?for?(all?block?y?pos)



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

?????文件??????36686??2016-03-24?18:56??HOGvisualize\Debug\hogvisualize.jpg

?????文件???????2064??2016-03-24?14:53??HOGvisualize\Debug\objimg.jpg

?????文件??????91136??2016-03-24?21:48??HOGvisualize\Debug\opencvtest.exe

?????文件?????529968??2016-03-24?21:48??HOGvisualize\Debug\opencvtest.ilk

?????文件????2239488??2016-03-24?21:48??HOGvisualize\Debug\opencvtest.pdb

?????文件???????3566??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\cl.command.1.tlog

?????文件?????141614??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\CL.read.1.tlog

?????文件???????2560??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\CL.write.1.tlog

?????文件?????294985??2016-03-21?20:57??HOGvisualize\opencvtest\Debug\facedetect.obj

?????文件?????361847??2016-03-21?20:58??HOGvisualize\opencvtest\Debug\facematch.obj

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link-cvtres.read.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link-cvtres.write.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link-rc.read.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link-rc.write.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.4028-cvtres.read.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.4028-cvtres.write.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.4028-rc.read.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.4028-rc.write.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.4028.read.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.4028.write.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.4432-cvtres.read.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.4432-cvtres.write.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.4432-rc.read.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.4432-rc.write.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.4432.read.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.4432.write.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.7284-cvtres.read.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.7284-cvtres.write.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.7284-rc.read.1.tlog

?????文件??????????2??2016-03-24?21:48??HOGvisualize\opencvtest\Debug\link.7284-rc.write.1.tlog

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

評論

共有 條評論