2

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:

  1. Could anybody give me some help to get the conversion done?
  2. Is there a better way to use a SVM in OpenCV for a HoGDescriptor / detector?

Any help would be nice!

Thanks in advance,

Nils

Community
  • 1
  • 1
MoeZarella
  • 41
  • 3

0 Answers0