mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
fixed CvBoost in mll if no tree can be trained.
This commit is contained in:
parent
65e2350606
commit
d38f694275
@ -910,7 +910,7 @@ CvBoost::CvBoost()
|
||||
|
||||
void CvBoost::prune( CvSlice slice )
|
||||
{
|
||||
if( weak )
|
||||
if( weak && weak->total > 0 )
|
||||
{
|
||||
CvSeqReader reader;
|
||||
int i, count = cvSliceLength( slice, weak );
|
||||
@ -1076,11 +1076,15 @@ CvBoost::train( const CvMat* _train_data, int _tflag,
|
||||
break;
|
||||
}
|
||||
|
||||
get_active_vars(); // recompute active_vars* maps and condensed_idx's in the splits.
|
||||
data->is_classifier = true;
|
||||
ok = true;
|
||||
|
||||
data->free_train_data();
|
||||
if(weak->total > 0)
|
||||
{
|
||||
get_active_vars(); // recompute active_vars* maps and condensed_idx's in the splits.
|
||||
data->is_classifier = true;
|
||||
data->free_train_data();
|
||||
ok = true;
|
||||
}
|
||||
else
|
||||
clear();
|
||||
|
||||
__END__;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user