Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

gpu hog.computeConfidenceMultiScale throws Assertion failed error

I'm trying to utilize the gpu functionality to speed up processing of images when testing people detection using HOG detectors. To start with, I've been trying to use the standard HOG people detector built into OpenCV but once I started trying to get out Confidence metrics from the program, it fails with the error:

OpenCV Error:Assertion failed (_rows >=0 && _cols >=0) in cv::gpu::GpuMat::create, file ..\..\source\modules\core\src\gpumat.cpp, line 693

Relevant Code:

Mat img;
gpu::HOGDescriptor hog(Size(64,128), Size(16,16), Size(8,8), Size(8,8), 9);
hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());
sequence.open(baseDIR+dir+"I00000.png");
vector<Rect> foundFull;
vector<gpu::HOGConfidence> fullConf;
for(;;){
  sequence >> img;
  cv::cvtColor(img, img, CV_BGR2GRAY);
  gpu::GpuMat gpuImg;
  gpuImg.upload(img);
  hog.computeConfidenceMultiScale(gpuImg, foundFull, 0, Size(8,8), Size(8,8), fullConf, 2);
}

The method calls for detectMultiScale work fine, but don't have a mode that returns confidence metrics, which are necessary for my project. Does anyone have any idea as to what I might be doing wrong? This is highly time critical, so any guidance would be appreciated.

Thanks.