All modules (except ocl and gpu) compiles and pass tests

This commit is contained in:
Andrey Kamaev
2013-03-20 20:13:46 +04:00
parent 762aefd71b
commit 2ad7b97f1c
91 changed files with 606 additions and 604 deletions

View File

@@ -285,7 +285,7 @@ const CvMat* CvMLData::get_missing() const
return missing;
}
const std::map<std::string, int>& CvMLData::get_class_labels_map() const
const std::map<cv::String, int>& CvMLData::get_class_labels_map() const
{
return class_map;
}

View File

@@ -1537,7 +1537,7 @@ CvERTrees::~CvERTrees()
{
}
std::string CvERTrees::getName() const
cv::String CvERTrees::getName() const
{
return CV_TYPE_NAME_ML_ERTREES;
}

View File

@@ -1117,7 +1117,7 @@ void CvGBTrees::write( CvFileStorage* fs, const char* name ) const
CvSeqReader reader;
int i;
std::string s;
cv::String s;
cvStartWriteStruct( fs, name, CV_NODE_MAP, CV_TYPE_NAME_ML_GBT );
@@ -1167,7 +1167,7 @@ void CvGBTrees::read( CvFileStorage* fs, CvFileNode* node )
CvFileNode* trees_fnode;
CvMemStorage* storage;
int i, ntrees;
std::string s;
cv::String s;
clear();
read_params( fs, node );

View File

@@ -45,6 +45,7 @@
#include "cvconfig.h"
#endif
#include "opencv2/core.hpp"
#include "opencv2/ml.hpp"
#include "opencv2/core/core_c.h"
#include "opencv2/core/utility.hpp"

View File

@@ -246,7 +246,7 @@ CvRTrees::~CvRTrees()
clear();
}
std::string CvRTrees::getName() const
cv::String CvRTrees::getName() const
{
return CV_TYPE_NAME_ML_RTREES;
}
@@ -730,7 +730,7 @@ void CvRTrees::write( CvFileStorage* fs, const char* name ) const
if( ntrees < 1 || !trees || nsamples < 1 )
CV_Error( CV_StsBadArg, "Invalid CvRTrees object" );
std::string modelNodeName = this->getName();
cv::String modelNodeName = this->getName();
cvStartWriteStruct( fs, name, CV_NODE_MAP, modelNodeName.c_str() );
cvWriteInt( fs, "nclasses", nclasses );

View File

@@ -1924,7 +1924,7 @@ bool CvSVM::train_auto( const CvMat* _train_data, const CvMat* _responses,
qsort(ratios, k_fold, sizeof(ratios[0]), icvCmpIndexedratio);
double old_dist = 0.0;
for (int k=0; k<k_fold; ++k)
old_dist += abs(ratios[k].val-class_ratio);
old_dist += cv::abs(ratios[k].val-class_ratio);
double new_dist = 1.0;
// iterate to make the folds more balanced
while (new_dist > 0.0)
@@ -1941,7 +1941,7 @@ bool CvSVM::train_auto( const CvMat* _train_data, const CvMat* _responses,
qsort(ratios, k_fold, sizeof(ratios[0]), icvCmpIndexedratio);
new_dist = 0.0;
for (int k=0; k<k_fold; ++k)
new_dist += abs(ratios[k].val-class_ratio);
new_dist += cv::abs(ratios[k].val-class_ratio);
if (new_dist < old_dist)
{
// swapping really improves, so swap the samples