mirror of
https://github.com/zebrajr/opencv.git
synced 2025-12-06 12:19:50 +01:00
commit
939e58f260
|
|
@ -864,8 +864,8 @@ public:
|
||||||
|
|
||||||
TermCriteria termcrit;
|
TermCriteria termcrit;
|
||||||
termcrit.type = TermCriteria::COUNT + TermCriteria::EPS;
|
termcrit.type = TermCriteria::COUNT + TermCriteria::EPS;
|
||||||
termcrit.maxCount = std::max((params.termCrit.type & CV_TERMCRIT_ITER ? params.termCrit.maxCount : MAX_ITER), 1);
|
termcrit.maxCount = std::max((params.termCrit.type & TermCriteria::MAX_ITER ? params.termCrit.maxCount : MAX_ITER), 1);
|
||||||
termcrit.epsilon = std::max((params.termCrit.type & CV_TERMCRIT_EPS ? params.termCrit.epsilon : DEFAULT_EPSILON), DBL_EPSILON);
|
termcrit.epsilon = std::max((params.termCrit.type & TermCriteria::EPS ? params.termCrit.epsilon : DEFAULT_EPSILON), DBL_EPSILON);
|
||||||
|
|
||||||
int iter = 0;
|
int iter = 0;
|
||||||
switch(params.trainMethod){
|
switch(params.trainMethod){
|
||||||
|
|
@ -901,7 +901,7 @@ public:
|
||||||
int count = inputs.rows;
|
int count = inputs.rows;
|
||||||
|
|
||||||
int iter = -1, max_iter = termCrit.maxCount*count;
|
int iter = -1, max_iter = termCrit.maxCount*count;
|
||||||
double epsilon = (termCrit.type & CV_TERMCRIT_EPS) ? termCrit.epsilon*count : 0;
|
double epsilon = (termCrit.type & TermCriteria::EPS) ? termCrit.epsilon*count : 0;
|
||||||
|
|
||||||
int l_count = layer_count();
|
int l_count = layer_count();
|
||||||
int ivcount = layer_sizes[0];
|
int ivcount = layer_sizes[0];
|
||||||
|
|
|
||||||
|
|
@ -446,7 +446,7 @@ public:
|
||||||
CV_Assert(!clusterSamples.empty());
|
CV_Assert(!clusterSamples.empty());
|
||||||
|
|
||||||
calcCovarMatrix(clusterSamples, covs[clusterIndex], means.row(clusterIndex),
|
calcCovarMatrix(clusterSamples, covs[clusterIndex], means.row(clusterIndex),
|
||||||
CV_COVAR_NORMAL + CV_COVAR_ROWS + CV_COVAR_USE_AVG + CV_COVAR_SCALE, CV_64FC1);
|
COVAR_NORMAL | COVAR_ROWS | COVAR_USE_AVG | COVAR_SCALE, CV_64FC1);
|
||||||
weights.at<double>(clusterIndex) = static_cast<double>(clusterSamples.rows)/static_cast<double>(nsamples);
|
weights.at<double>(clusterIndex) = static_cast<double>(clusterSamples.rows)/static_cast<double>(nsamples);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@
|
||||||
|
|
||||||
#include "opencv2/core.hpp"
|
#include "opencv2/core.hpp"
|
||||||
#include "opencv2/ml.hpp"
|
#include "opencv2/ml.hpp"
|
||||||
#include "opencv2/core/core_c.h"
|
|
||||||
#include "opencv2/core/utility.hpp"
|
#include "opencv2/core/utility.hpp"
|
||||||
|
|
||||||
#include "opencv2/core/private.hpp"
|
#include "opencv2/core/private.hpp"
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ struct SvmParams
|
||||||
C = 1;
|
C = 1;
|
||||||
nu = 0;
|
nu = 0;
|
||||||
p = 0;
|
p = 0;
|
||||||
termCrit = TermCriteria( CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 1000, FLT_EPSILON );
|
termCrit = TermCriteria( TermCriteria::MAX_ITER|TermCriteria::EPS, 1000, FLT_EPSILON );
|
||||||
}
|
}
|
||||||
|
|
||||||
SvmParams( int _svmType, int _kernelType,
|
SvmParams( int _svmType, int _kernelType,
|
||||||
|
|
@ -412,8 +412,7 @@ ParamGrid SVM::getDefaultGrid( int param_id )
|
||||||
grid.logStep = 7; // total iterations = 3
|
grid.logStep = 7; // total iterations = 3
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cvError( cv::Error::StsBadArg, "SVM::getDefaultGrid", "Invalid type of parameter "
|
CV_Error( cv::Error::StsBadArg, "Invalid type of parameter (use one of SVM::C, SVM::GAMMA et al.)");
|
||||||
"(use one of SVM::C, SVM::GAMMA et al.)", __FILE__, __LINE__ );
|
|
||||||
return grid;
|
return grid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user