//////////////////////////////////////////////////////////////////參數設定////////////////////////////////根據自己的參數設置///////////////////////
Rectangle rc = new Rectangle();
rc.Width = 28;
rc.Height = 28;//tuxaing daxiao
Rectangle rc1 = new Rectangle();
rc1.Width = 14;
rc1.Height = 14;//bloke
Rectangle rc2 = new Rectangle();
rc2.Width = 7;
rc2.Height = 7;
Rectangle rc3 = new Rectangle();
rc3.Width = 7;
rc3.Height = 7;
///////////////設置參數//////////////////////////////////////////////
System.Drawing.Size r1 = new System.Drawing.Size();
r1.Width = 1;
r1.Height = 1;
System.Drawing.Size r2 = new System.Drawing.Size();
r2.Width = 0;
r2.Height = 0;
HOGDescriptor hog = new HOGDescriptor(rc.Size, rc1.Size, rc2.Size, rc3.Size, 9, 1, -1.0000000000000000, 0.20000000000000001, false);
float[] yy = new float[1000000];
yy = hog.Compute(src, r1,r2, null);//src爲要提取特徵的圖像,yy爲生成特徵的數組
但是我發現一個問題,同樣的參數在opencv 上面顯示的hog特徵數據略有不同,不知道是什麼原因。