Ask Your Question

Revision history [back]

A couple things to troubleshoot.

  1. Confirm that you are providing the correct path to hog.xml. OpenCV already handles this for you by simply providing HOGDescriptor::getDefaultPeopleDetector().
  2. You are using the same parameters for getDefaultPeopleDetector() in your detectMultiScale() as your hog.xml. Did you train your dataset with the same parameters as getDefaultPeopleDetector? Meaning, was your model trained on 32x32 images? Take a moment to understand detectMultiScale first. Thereafter, this response will be a good guide in helping you determine what values would make sense for your model.
  3. Here's the documentation with regards to .setSVMDetector(const vector<float>& detector) and const vector<float>& detector

Finally, here's a tutorial on how to use Haar Cascades on C++. You can also Google around for more.

Cheers :)