1

I was learning opencv3 official SVM example, encountered this problem. Here is the code.

    #include <opencv2/core.hpp>
    #include <opencv2/imgproc.hpp>
    #include "opencv2/imgcodecs.hpp"
    #include <opencv2/highgui.hpp>
    #include <opencv2/ml.hpp>

    using namespace cv;
    using namespace cv::ml;

    ...[code]
        // Set up SVM's parameters
        ml::SVM::Params params;
        params.svmType = SVM::C_SVC;
        params.kernelType = SVM::LINEAR;
        params.termCrit = TermCriteria(TermCriteria::MAX_ITER, 100, 1e-6);
    ...[code]

}

It suggests the following error:
class cv::ml::SVM do not have member called Params

I don't know where is the problem, please help~~

Astri
  • 21
  • 2
  • Possible duplicate of [OpenCV unable to set up SVM Parameters](http://stackoverflow.com/questions/33897803/opencv-unable-to-set-up-svm-parameters) – Miki Mar 07 '16 at 11:31

1 Answers1

0

Compared with opencv2, opencv3 use SVM in different way: There are no "Params" any more. So it says "class cv::ml::SVM do not have member called Params".

You can see how to use svm in this answer: here

And other details about opencv3 in: OpenCv 3.1.0

Community
  • 1
  • 1
X.Zhang
  • 1
  • 1