Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Extracting Haar feature vectors

I'm trying to extract Haar feature vectors of images but I can't find the way to do it, and I was hoping some of you could shed some light on it. Let me explain the situation:

  • My goal is to obtain a vector of Haar features of an image, as it is possible to get a vector of HOG features (floats) through HOGDescriptor, so then I can use such vector to train an SVM classifier.
  • I know that Haar features are integrated within the Cascade Classifier, but I don't want to use this kind of classifier.
  • I've been navigating through the several source files involved in the issue, where the FeatureEvaluator is defined and the Haar features are described (basically the files in the traincascade app folder), and I've been trying to use/adapt them to my problem. However, I can't find the way to make use of each of the classes to get the vector of features. Indeed, most of my tries have ended in compilation errors due to some virtual functions not being implemented or include files missing...

After several days of trying I'm quite desperate about not finding a solution (not even a close one), so any help would be incredibly appreciated, whether it's some already done implementation of this (though I couldn't find any), any advice or some tips to face the problem.

Thanks in advance!

P.S. Seems that the 3.0 version will allow to do this through the contrib TrackerFeature class, but I don't plan to migrate all my project from 2.4.x right now.

P.S.2. I find it quite weird that no one before has needed to extract Haar feature vectors for other purposes than using them with the Cascade Classifier. Am I missing anything?