Ask Your Question
2

HogDescriptor HEAP crash in c++ VisualStudio2012

asked 2012-09-09 19:44:38 -0600

Stefan gravatar image

Hey community,
I have some issue with the cv::HOGDescriptor in a really basic usage.

vector<cv::Rect> found, found_filtered;
cv::HOGDescriptor hog;
hog.setSVMDetector(cv::HOGDescriptor::getDefaultPeopleDetector()); // CRASH HERE
hog.detectMultiScale(tempFrame, found, 0, cv::Size(8, 8), cv::Size(32, 32), 1.05, 2);

it is absolutely a copy of the example code which runs in XCode but not in VisualStudio 2012.

The error message is HEAP[Project.exe]: Invalid address specified to RtlValidateHeap( 00C80000, 02D51150 ) Project.exe has triggered a breakpoint.

has anyone experience with that kind of problems?
Kind regards

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2012-09-12 01:34:29 -0600

Stefan gravatar image
static vector<float> detector = HOGDescriptor::getDefaultPeopleDetector();
if (!detector.size()) {
fprintf(stderr, "ERROR: getDefaultPeopleDetector returned NULL\n");
return -1;      
}
hog.setSVMDetector(detector);

seems to work now

edit flag offensive delete link more
0

answered 2013-03-21 07:09:21 -0600

It means that your detector is not able to read the original parameters. Are you having the original structure of openCV installation folder? Is there a folder with \data\lbpcascades ? This is where these parameters are stored.

edit flag offensive delete link more

Comments

1

HOGDescriptor::getDefaultPeopleDetector() is hardcoded in hog.cpp 1081 (not a file) probably copying the (huge) vector was a problem

berak gravatar imageberak ( 2013-03-21 07:18:36 -0600 )edit

Then just read in the provided file? That will solve the actual problem right?

StevenPuttemans gravatar imageStevenPuttemans ( 2013-03-21 07:23:11 -0600 )edit

Question Tools

Stats

Asked: 2012-09-09 19:44:38 -0600

Seen: 1,314 times

Last updated: Mar 21 '13