HOGDescriptor::getDefaultPeopleDetector()
classifier was trained using training images of 64*128
size, but what real height pedectrians at those train data?
Performance is important, and I approximately know height of my pedestrians -- so I using HOGDescriptor::detect()
(not detectMultiScale()
).
Firstly I resize my target area to detector resolution (coefficient of resizing equal to ratio between "detector height pedectrian" and "my data height pedectrian"), and then perform detect function.
part of code:
double HeightPedestrian = 250.0;
double resizeRatio = 128.0 / HeightPedestrian;
resize(frame(RectWindow), frame_for_HOG, Size(), resizeRatio, resizeRatio);
HOGDescriptor hog;
hog.setSVMDetector(cv::HOGDescriptor::getDefaultPeopleDetector());
hog.detect(frame_for_HOG, foundPoints, 0, Size(8,8), Size(32,32));