i've already figured out how to train a CvSVM using the OpenCV Java bindings. I thought i could use this for the HOGDescriptor like this
CvSVM svm = new CvSVM();
svm.load("svm.xml");
HOGDescriptor hoG = new HOGDescriptor();
hoG.setSVMDetector(svm);
I was pretty surprised to see that this doesn't work since setSVMDetector() has a Mat as an argument. It seems like a conversion is possible, as one can read here. My problem is that i couldn't figure out how this conversion could be done in Java up to now, since i don't know how i convert this
const CvSVMDecisionFunc* df = decision_func;
to Java code.
So i have two questions:
- Could anybody give me some help to get the conversion done?
- Is there a better way to use a SVM in OpenCV for a HoGDescriptor / detector?
Any help would be nice!
Thanks in advance,
Nils