Commit 450734cc authored by Benoit Seguin's avatar Benoit Seguin

Correction of the integer data treated as floating point data bug, already…

Correction of the integer data treated as floating point data bug, already corrected in the 2.4 branch.
parent ecbec723
...@@ -268,6 +268,7 @@ CvGBTrees::train( const CvMat* _train_data, int _tflag, ...@@ -268,6 +268,7 @@ CvGBTrees::train( const CvMat* _train_data, int _tflag,
sample_idx = cvCreateMat( 1, sample_idx_len, CV_32S ); sample_idx = cvCreateMat( 1, sample_idx_len, CV_32S );
for (int i=0; i<sample_idx_len; ++i) for (int i=0; i<sample_idx_len; ++i)
sample_idx->data.i[i] = _sample_idx->data.i[i]; sample_idx->data.i[i] = _sample_idx->data.i[i];
std::sort(sample_idx->data.i, sample_idx->data.i + sample_idx_len);
} break; } break;
case CV_8S: case CV_8S:
case CV_8U: case CV_8U:
...@@ -284,7 +285,6 @@ CvGBTrees::train( const CvMat* _train_data, int _tflag, ...@@ -284,7 +285,6 @@ CvGBTrees::train( const CvMat* _train_data, int _tflag,
} break; } break;
default: CV_Error(CV_StsUnmatchedFormats, "_sample_idx should be a 32sC1, 8sC1 or 8uC1 vector."); default: CV_Error(CV_StsUnmatchedFormats, "_sample_idx should be a 32sC1, 8sC1 or 8uC1 vector.");
} }
std::sort(sample_idx->data.fl, sample_idx->data.fl + sample_idx_len);
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment