Merge pull request #443 from taka-no-me:fix_cascade_test

This commit is contained in:
Andrey Kamaev 2013-02-06 16:40:38 +04:00 committed by OpenCV Buildbot
commit 93d4abecf8

View File

@ -363,22 +363,20 @@ int CV_DetectorTest::validate( int detectorIdx, vector<vector<Rect> >& objects )
} }
noPair += (int)count_if( map.begin(), map.end(), isZero ); noPair += (int)count_if( map.begin(), map.end(), isZero );
totalNoPair += noPair; totalNoPair += noPair;
if( noPair > cvRound(valRects.size()*eps.noPair)+1 )
EXPECT_LE(noPair, cvRound(valRects.size()*eps.noPair)+1)
<< "detector " << detectorNames[detectorIdx] << " has overrated count of rectangles without pair on "
<< imageFilenames[imageIdx] << " image";
if (::testing::Test::HasFailure())
break; break;
} }
if( imageIdx < (int)imageFilenames.size() )
{ EXPECT_LE(totalNoPair, cvRound(totalValRectCount*eps./*total*/noPair)+1)
char msg[500]; << "detector " << detectorNames[detectorIdx] << " has overrated count of rectangles without pair on all images set";
sprintf( msg, "detector %s has overrated count of rectangles without pair on %s-image\n",
detectorNames[detectorIdx].c_str(), imageFilenames[imageIdx].c_str() ); if (::testing::Test::HasFailure())
ts->printf( cvtest::TS::LOG, msg );
return cvtest::TS::FAIL_BAD_ACCURACY; return cvtest::TS::FAIL_BAD_ACCURACY;
}
if ( totalNoPair > cvRound(totalValRectCount*eps./*total*/noPair)+1 )
{
ts->printf( cvtest::TS::LOG, "overrated count of rectangles without pair on all images set" );
return cvtest::TS::FAIL_BAD_ACCURACY;
}
return cvtest::TS::OK; return cvtest::TS::OK;
} }