//参数设定根据自己的参数设置///
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特征数据略有不同,不知道是什么原因。