As you may know, many things changed in OpenCV 3 (in comparision to the openCV2 or the old first version).
In the old days, to train SVM one would use:
CvSVMParams params;
params.svm_type = CvSVM::C_SVC;
params.kernel_type = CvSVM::POLY;
params.gamma = 3;
CvSVM svm;
svm.train(training_mat, labels, Mat(), Mat(), params);
In the third version of API, there is no CvSVMParams
nor CvSVM
. Surprisingly, there is a documentation page about SVM, but it tells everything, but not how to really use it (at least I cannot make it out).
Moreover, it looks like no one in the Internet uses SVM from OpenCV's 3.0.
Currently, I only managed to get the following:
ml::SVM.Params params;
params.svmType = ml::SVM::C_SVC;
params.kernelType = ml::SVM::POLY;
params.gamma = 3;
Can you please provide me with information, how to rewrite the actual training to openCV 3?