I am currently trying to count cars using OpenCV 2.4.4 with a HOG descriptor. Because a model for car detection is not available in OpenCV, I am creating my own model using SVMLight and a dataset of cars from the INRIA car dataset here (positive and negative samples).
I created the model using the positive and negative samples with SVMLight (I resized the images to 128 * 104 because a HOG image must be power of 2), by following this tutorial and code. I applied the model to my program, and it detected cars correctly, but also with lot of false positives (3- 8 false positives per image).
I read in Dalal paper about the HOG Detector, and I found out that the model needs to be retrained using false positives found by applying the preliminary model on the negative samples. The resulting patches came in varying sizes, so again, I resized it to 128*104 px.
I reran the HOG training program using positive and negative samples like the preliminary run, but this time, I added the false positives on the negative samples (this is what I think of retraining based on the paper by Dalal). Then I have the retrained model.
Unfortunately, I ran the car detection program using the new model, but all images returned with no car detection although I used positive sample images and other images with a car in it.
This is very interesting and I am curious if any of you can point out what have I done wrong.