Lines Matching refs:SVM
14 void get_svm_detector(const Ptr<SVM>& svm, vector< float > & hog_detector );
24 void get_svm_detector(const Ptr<SVM>& svm, vector< float > & hog_detector )
27 Mat sv = svm->getSupportVectors();
31 double rho = svm->getDecisionFunction(0, alpha, svidx);
321 Ptr<SVM> svm = SVM::create();
322 /* Default values to train SVM */
323 svm->setCoef0(0.0);
324 svm->setDegree(3);
325 svm->setTermCriteria(TermCriteria( CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 1000, 1e-3 ));
326 svm->setGamma(0);
327 svm->setKernel(SVM::LINEAR);
328 svm->setNu(0.5);
329 svm->setP(0.1); // for EPSILON_SVR, epsilon in loss function?
330 svm->setC(0.01); // From paper, soft classifier
331 svm->setType(SVM::EPS_SVR); // C_SVC; // EPSILON_SVR; // may be also NU_SVR; // do regression task
332 svm->train(train_data, ROW_SAMPLE, Mat(labels));
335 svm->save( "my_people_detector.yml" );
357 Ptr<SVM> svm;
364 // Load the trained SVM.
365 svm = StatModel::load<SVM>( "my_people_detector.yml" );
366 // Set the trained svm to my_hog
368 get_svm_detector( svm, hog_detector );