In OpenCV 3.0 CvSVM
it was renamed to SVM
and moved to the namespace cv::ml
(in fact, also in the previous version SVM
there was a typedef for CvSVM
).
Since it SVM
is an abstract class, you cannot create it. You need to call SVM::create()
.
So you need to do:
cv::Ptr<cv::ml::SVM> svm = cv::ml::SVM::create();
or simply:
using namespace cv;
using namespace cv::ml;
...
Ptr<SVM> svm = SVM::create();
CvSVMParams
. SVM
:
Ptr<SVM> svm = SVM::create();
svm->setType(SVM::C_SVC);
svm->setKernel(SVM::RBF);