This post could also be titled: “Why I’ve decided not to use the HOGDescriptors from opencv”. There are three main reasons why I chose not to use the provided HOG functionality in Opencv:
- What is in Opencv is not only a descriptor. Of course the descriptors are implemented, but they are bundled up together with classifiers and detectors. Also bundled inside the HOG class hierarchy is a pedestrian detector. Now, don’t get me wrong, I’m not against all that being in opencv. They could have separated it, in such a way that one can use a HOGDescriptor class and not have to deal with design decisions based on the other non-descriptor elements of the class.
- My second reason is related to the work that brought on the HOG descriptors to begin with. This is described in a paper by Navneet Dalala and Bill Triggs. Their work is centered in Histogram of Oriented Gradient feature descriptor. How to calculate such a feature descriptor and how different tweaks to the descriptors parameters can affect a binary SVM classifier. They included the classifier as a mere way of measuring the models worthiness. What I’m trying to say is that HOG can live separately from classification method and detection method. Note that even though they relate the HOG concept to pedestrian detection, it does not mean that it only works for that. In Navneet’s PhD document he also works with motorcycles and cars.
- My third reason (and this was the one that tipped the glass): You need CUDA  to run the HOG stuff. It’s all implemented in cu files. I don’t have nvidia hardware and am not planning to get some. I don’t need real-time object detection! In my situation I’m even willing to wait a couple of days.
Conclusion: I will have to use Navneet’s original code or code one myself (Which is not THAT hard) Histograms of Oriented Gradients for Human Detection http://www.nvidia.com/object/what_is_cuda_new.html http://smsoftdev-solutions.blogspot.com/2009/10/object-detection-using-opencv-ii.html