HOG People Detector on image
I'm try to use HOG People Detector for obtain Region of Interest. I have this depth image and the istruction is:
HOGDescriptor hog;
hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());
vector<Rect> found, found_filtered;
hog.detectMultiScale(falseColorsMap, found, 0, Size(16, 16), Size(32, 32), 1.05, 2);
size_t i, j;
for (i = 0; i<found.size(); i++)
{
Rect r = found[i];
for (j = 0; j<found.size(); j++)
if (j != i && (r & found[j]) == r)
break;
if (j == found.size())
found_filtered.push_back(r);
}
for (i = 0; i<found_filtered.size(); i++)
{
Rect r = found_filtered[i];
r.x += cvRound(r.width*0.1);
r.width = cvRound(r.width*0.8);
r.y += cvRound(r.height*0.07);
r.height = cvRound(r.height*0.8);
rectangle(img, r.tl(), r.br(), Scalar(0, 255, 0), 3);
}
namedWindow("Display window", WINDOW_AUTOSIZE);// Create a window for display.
imshow("Display window", falseColorsMap); // Show our image inside it.
waitKey(0); // Wait for a keystroke in the window
return 0;
how i can detect roi?
I don't want write on every post "use a neuronal network / pretrained model(yes there are good people detectors out there)" but its just way more efficient and accurate...