我正在与Kinect传感器和Emgu CV项目合作。我把探测到的人分成长方形,然后把它分成小块。我将每个片段发送到Emgu的HoG函数中,并等待一个浮点数数组作为每个发送片段的结果。
问题是,当我将图像发送到我的HoG函数中时,程序就会在计算方法上无警告/异常地退出。
我的Hog函数是:(取自:Taking the HOG descriptor of an image using HOGDescriptor from EMGU CV C#)
public Image<Bgr, Byte> Resize(Image<Bgr, Byte> im)
{
return im.Resize(64, 128, Emgu.CV.CvEnum.INTER.CV_INTER_LINEAR);
}
public float[] GetVector(Image<Bgr, Byte> im)
{
HOGDescriptor hog = new HOGDescriptor(); // with defaults values
Image<Bgr, Byte> imageOfInterest = Resize(im);
System.Drawing.Point[] p = new System.Drawing.Point[imageOfInterest.Width * imageOfInterest.Height];
int k = 0;
for (int i = 0; i < imageOfInterest.Width; i++)
{
for (int j = 0; j < imageOfInterest.Height; j++)
{
System.Drawing.Point p1 = new System.Drawing.Point(i, j);
p[k++] = p1;
}
}
float[] result = hog.Compute(imageOfInterest, new System.Drawing.Size(16, 16), new System.Drawing.Size(0, 0), p);
return result;
}我试着用Procdump捕获一个转储,但是当我的程序崩溃时,它没有捕获任何东西就退出了。
发布于 2015-04-30 10:57:37
我自己发现了问题。
如果试图将p数组发送到Compute函数中,则会出现错误。
您可以通过发送空数组而不是p[]来解决这个问题。
float[] result = hog.Compute(imageOfInterest, new System.Drawing.Size(16, 16), new System.Drawing.Size(0, 0), NULL ARRAY HERE);https://stackoverflow.com/questions/27548961
复制相似问题