fixed CvBoost
authorMaria Dimashova <no@email>
Wed, 12 Jan 2011 12:53:36 +0000 (12:53 +0000)
committerMaria Dimashova <no@email>
Wed, 12 Jan 2011 12:53:36 +0000 (12:53 +0000)
modules/ml/src/boost.cpp
tests/cv/src/afeatures2d.cpp
tests/cv/src/astereomatching.cpp

index a8ca92a..91eaaa9 100644 (file)
@@ -899,6 +899,7 @@ CvBoost::CvBoost()
     data = 0;
     weak = 0;
     default_model_name = "my_boost_tree";
+
     active_vars = active_vars_abs = orig_response = sum_response = weak_eval =
         subsample_mask = weights = subtree_weights = 0;
     have_active_cat_vars = have_subsample = false;
@@ -967,7 +968,9 @@ CvBoost::CvBoost( const CvMat* _train_data, int _tflag,
     weak = 0;
     data = 0;
     default_model_name = "my_boost_tree";
-    orig_response = sum_response = weak_eval = subsample_mask = weights = 0;
+
+    active_vars = active_vars_abs = orig_response = sum_response = weak_eval =
+        subsample_mask = weights = subtree_weights = 0;
 
     train( _train_data, _tflag, _responses, _var_idx, _sample_idx,
            _var_type, _missing_mask, _params );
@@ -2115,7 +2118,8 @@ CvBoost::CvBoost( const Mat& _train_data, int _tflag,
     weak = 0;
     data = 0;
     default_model_name = "my_boost_tree";
-    orig_response = sum_response = weak_eval = subsample_mask = weights = 0;
+    active_vars = active_vars_abs = orig_response = sum_response = weak_eval =
+        subsample_mask = weights = subtree_weights = 0;
     
     train( _train_data, _tflag, _responses, _var_idx, _sample_idx,
           _var_type, _missing_mask, _params );
index c266bd0..3072984 100644 (file)
@@ -307,7 +307,7 @@ protected:
         CV_Assert( DataType<ValueType>::type == validDescriptors.type() );
 
         int dimension = validDescriptors.cols;
-        DistanceType curMaxDist = std::numeric_limits<DistanceType>::min();
+        DistanceType curMaxDist = -std::numeric_limits<DistanceType>::max();
         for( int y = 0; y < validDescriptors.rows; y++ )
         {
             DistanceType dist = distance( validDescriptors.ptr<ValueType>(y), calcDescriptors.ptr<ValueType>(y), dimension );
index b40f8ae..c6c9720 100755 (executable)
@@ -237,7 +237,7 @@ void computeDepthDiscontMask( const Mat& disp, Mat& depthDiscontMask, const Mat&
 
     Mat curDisp; disp.copyTo( curDisp );
     if( !unknDispMask.empty() )
-        curDisp.setTo( Scalar(numeric_limits<float>::min()), unknDispMask );
+        curDisp.setTo( Scalar(-numeric_limits<float>::max()), unknDispMask );
     Mat maxNeighbDisp; dilate( curDisp, maxNeighbDisp, Mat(3, 3, CV_8UC1, Scalar(1)) );
     if( !unknDispMask.empty() )
         curDisp.setTo( Scalar(numeric_limits<float>::max()), unknDispMask );