I am trying to train my own detector for use with OpenCV :: HOGDescriptor, but I am having trouble creating an existing HOGDescriptor with my newly trained SVM.
I calculated HOG functions for positive and negative learning images, tagged them and trained SVM with CvSVM. The options I used are as follows:
CvSVMParams params;
params.svm_type =CvSVM::EPS_SVR;
params.kernel_type = CvSVM::LINEAR;
params.C = 0.01;
params.p = 0.5;
Then I calculate the Primal Form of the support vectors, so that I get only one vector instead of many and set the calculated support vector using HOGDescriptor.setSVMDetector (vector);
This is the primary form.
When I use CvSVM.predict (), I can correctly classify objects using SVM, but HOGDescriptor.detect () or detectMultiScale () always returns many positive matches and does not give accurate predictions.
CvSVM.predict () uses the original support vectors for classification, so there might be something wrong with the way I calculate the primary form.
Is there anyone who trained his detector that can point me in the right direction?
source
share