Merge pull request #1339 from mdim:ml_cpp_wrappers_fix

This commit is contained in:
Roman Donchenko 2013-08-27 12:37:32 +04:00 committed by OpenCV Buildbot
commit 45a0b39a73
5 changed files with 38 additions and 12 deletions

View File

@ -942,6 +942,8 @@ protected:
CvDTreeNode* root;
CvMat* var_importance;
CvDTreeTrainData* data;
CvMat train_data_hdr, responses_hdr;
cv::Mat train_data_mat, responses_mat;
public:
int pruned_tree_idx;
@ -1053,6 +1055,8 @@ protected:
// array of the trees of the forest
CvForestTree** trees;
CvDTreeTrainData* data;
CvMat train_data_hdr, responses_hdr;
cv::Mat train_data_mat, responses_mat;
int ntrees;
int nclasses;
double oob_error;
@ -1268,6 +1272,8 @@ protected:
virtual void initialize_weights(double (&p)[2]);
CvDTreeTrainData* data;
CvMat train_data_hdr, responses_hdr;
cv::Mat train_data_mat, responses_mat;
CvBoostParams params;
CvSeq* weak;

View File

@ -2122,9 +2122,14 @@ CvBoost::train( const Mat& _train_data, int _tflag,
const Mat& _missing_mask,
CvBoostParams _params, bool _update )
{
CvMat tdata = _train_data, responses = _responses, vidx = _var_idx,
sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
return train(&tdata, _tflag, &responses, vidx.data.ptr ? &vidx : 0,
train_data_hdr = _train_data;
train_data_mat = _train_data;
responses_hdr = _responses;
responses_mat = _responses;
CvMat vidx = _var_idx, sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
return train(&train_data_hdr, _tflag, &responses_hdr, vidx.data.ptr ? &vidx : 0,
sidx.data.ptr ? &sidx : 0, vtype.data.ptr ? &vtype : 0,
mmask.data.ptr ? &mmask : 0, _params, _update);
}

View File

@ -1844,9 +1844,14 @@ bool CvERTrees::train( const Mat& _train_data, int _tflag,
const Mat& _sample_idx, const Mat& _var_type,
const Mat& _missing_mask, CvRTParams params )
{
CvMat tdata = _train_data, responses = _responses, vidx = _var_idx,
sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
return train(&tdata, _tflag, &responses, vidx.data.ptr ? &vidx : 0,
train_data_hdr = _train_data;
train_data_mat = _train_data;
responses_hdr = _responses;
responses_mat = _responses;
CvMat vidx = _var_idx, sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
return train(&train_data_hdr, _tflag, &responses_hdr, vidx.data.ptr ? &vidx : 0,
sidx.data.ptr ? &sidx : 0, vtype.data.ptr ? &vtype : 0,
mmask.data.ptr ? &mmask : 0, params);
}

View File

@ -839,9 +839,14 @@ bool CvRTrees::train( const Mat& _train_data, int _tflag,
const Mat& _sample_idx, const Mat& _var_type,
const Mat& _missing_mask, CvRTParams _params )
{
CvMat tdata = _train_data, responses = _responses, vidx = _var_idx,
sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
return train(&tdata, _tflag, &responses, vidx.data.ptr ? &vidx : 0,
train_data_hdr = _train_data;
train_data_mat = _train_data;
responses_hdr = _responses;
responses_mat = _responses;
CvMat vidx = _var_idx, sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
return train(&train_data_hdr, _tflag, &responses_hdr, vidx.data.ptr ? &vidx : 0,
sidx.data.ptr ? &sidx : 0, vtype.data.ptr ? &vtype : 0,
mmask.data.ptr ? &mmask : 0, _params);
}

View File

@ -1594,9 +1594,14 @@ bool CvDTree::train( const Mat& _train_data, int _tflag,
const Mat& _sample_idx, const Mat& _var_type,
const Mat& _missing_mask, CvDTreeParams _params )
{
CvMat tdata = _train_data, responses = _responses, vidx=_var_idx,
sidx=_sample_idx, vtype=_var_type, mmask=_missing_mask;
return train(&tdata, _tflag, &responses, vidx.data.ptr ? &vidx : 0, sidx.data.ptr ? &sidx : 0,
train_data_hdr = _train_data;
train_data_mat = _train_data;
responses_hdr = _responses;
responses_mat = _responses;
CvMat vidx=_var_idx, sidx=_sample_idx, vtype=_var_type, mmask=_missing_mask;
return train(&train_data_hdr, _tflag, &responses_hdr, vidx.data.ptr ? &vidx : 0, sidx.data.ptr ? &sidx : 0,
vtype.data.ptr ? &vtype : 0, mmask.data.ptr ? &mmask : 0, _params);
}