From 450734cc32dd094eb55f4c42d7ca004c9f298d16 Mon Sep 17 00:00:00 2001 From: Benoit Seguin Date: Tue, 23 Sep 2014 14:03:20 +0200 Subject: [PATCH] Correction of the integer data treated as floating point data bug, already corrected in the 2.4 branch. --- modules/ml/src/gbt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ml/src/gbt.cpp b/modules/ml/src/gbt.cpp index b186abf..0ebe19e 100644 --- a/modules/ml/src/gbt.cpp +++ b/modules/ml/src/gbt.cpp @@ -268,6 +268,7 @@ CvGBTrees::train( const CvMat* _train_data, int _tflag, sample_idx = cvCreateMat( 1, sample_idx_len, CV_32S ); for (int i=0; idata.i[i] = _sample_idx->data.i[i]; + std::sort(sample_idx->data.i, sample_idx->data.i + sample_idx_len); } break; case CV_8S: case CV_8U: @@ -284,7 +285,6 @@ CvGBTrees::train( const CvMat* _train_data, int _tflag, } break; 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 { -- 2.7.4