From b700521b95368fae6953e5c2d45f4b042d9f837d Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Fri, 22 Jul 2011 12:20:43 +0000 Subject: [PATCH] fixed trim_weights in boosting (thanks to frankman for the patch; ticket #1231) --- modules/ml/src/boost.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ml/src/boost.cpp b/modules/ml/src/boost.cpp index e91b4f1165..b29feab394 100644 --- a/modules/ml/src/boost.cpp +++ b/modules/ml/src/boost.cpp @@ -1439,7 +1439,7 @@ CvBoost::trim_weights() for( i = 0; i < count; i++ ) { double w = weak_eval->data.db[i]; - if( sum > w ) + if( sum <= 0 ) break; sum -= w; }