Anushree Joyous
Anushree Joyous

Reputation: 1

OpenCV SVM Train

I am using SVM.train command (with appropriate parameters defined) with openCv. Next, instead of using svm.predict, I want to use my algorithm for classification purpose. Is it possible? Can I access support vectors generated while training? If so, how ?

Upvotes: 0

Views: 211

Answers (1)

Jürgen K.
Jürgen K.

Reputation: 3487

Yes you can. Usually you save your Support Vectors after training in an XML file. Which looks like this:

clasificador = new CvSVM(trainingData, classes, new Mat(), new Mat(),
                params);
clasificador.save(XML);

Now you can define your own classificador. I guess you already did it. Then its up on you to write a method which should look like this

clasificador.load( new File( XML ).getAbsolutePath() );

Upvotes: 1

Related Questions