I can\'t train the SVM to recognize my object. I\'m trying to do this using SURF + Bag Of Words + SVM. My problem is that the classifier does not detect anything. All the result
First of all, using same parameters from an existing project doesn't prove that you are using correct parameters. In fact, in my opinion it is a completely nonsense approach (no offense). It is because, SVM parameters are affected from dataset and decriptor extraction method directly. In order to get correct parameters you have to do cross-validation. So if those parameters are obtained from a different recognition task it won't make any sense. For example in my face verification project optimal parameters were 0.0625 and 10 for gamma
and C
respectively.
Other important issue with your approach is test images. As far as I see from your code, you are not using images from disk to test your classifier, so from rest of here I'll do some assumptions. If your test images, that you are acquired from camera are different from your positive images, it will fail. By different I mean this; you have to be sure that your test images are composed only of steering wheels, because your training images contain only steering wheels. If your test image contains, for instance car seat with it, your BoW descriptor for test image will be completely different from your train images BoW descriptor. So, simply, your test images shouldn't contain steering wheels with some other objects, they should only contain steering wheels.
If you satisfy these, using training images for testing your system is the most basic approach. Even in that scenario you are failing you probably have some implenetation issues. Other approach can be this; split your training data into two, such that you have four partitions:
Use only train images for training the system and test it with the test images. And again, you have to specify parameters via cross-validation.
Other than these, you might want to check some specific steps in order to localize the problem, before doing the previous things that I wrote:
I hope I was able to emphasize the importance of the cross-validation. Do the cross-validation!
Good luck!