pull/13383/head
Maria Dimashova 14 years ago
parent 336989f80b
commit 8bbbd93410
  1. 4
      modules/traincascade/cascadeclassifier.cpp

@ -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;

Loading…
Cancel
Save