Merge pull request #6861 from teng88:patch-1

This commit is contained in:
Vadim Pisarevsky 2016-07-18 14:43:23 +00:00
commit 4da91f9e6d

View File

@ -310,6 +310,7 @@ bool CvCascadeClassifier::updateTrainingSet( double minimumAcceptanceRatio, doub
int proNumNeg = cvRound( ( ((double)numNeg) * ((double)posCount) ) / numPos ); // apply only a fraction of negative samples. double is required since overflow is possible int proNumNeg = cvRound( ( ((double)numNeg) * ((double)posCount) ) / numPos ); // apply only a fraction of negative samples. double is required since overflow is possible
int negCount = fillPassedSamples( posCount, proNumNeg, false, minimumAcceptanceRatio, negConsumed ); int negCount = fillPassedSamples( posCount, proNumNeg, false, minimumAcceptanceRatio, negConsumed );
if ( !negCount ) if ( !negCount )
if ( !(negConsumed > 0 && ((double)negCount+1)/(double)negConsumed <= minimumAcceptanceRatio) )
return false; return false;
curNumSamples = posCount + negCount; curNumSamples = posCount + negCount;