Commit 8bbbd934 authored by Maria Dimashova's avatar Maria Dimashova

fixed #1025

parent 336989f8
......@@ -264,9 +264,11 @@ bool CvCascadeClassifier::updateTrainingSet( double& acceptanceRatio)
return false;
cout << "POS count : consumed " << posCount << " : " << (int)posConsumed << endl;
int negCount = fillPassedSamples( numPos, numNeg, false, negConsumed );
int proNumNeg = cvRound( (float)(numNeg * posCount) / numPos ); // apply only a fraction of negative samples.
int negCount = fillPassedSamples( posCount, proNumNeg, false, negConsumed );
if ( !negCount )
return false;
curNumSamples = posCount + negCount;
acceptanceRatio = negConsumed == 0 ? 0 : ( (double)negCount/(double)(int64)negConsumed );
cout << "NEG count : acceptanceRatio " << negCount << " : " << acceptanceRatio << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment