From ccc72f61755a7cbea13761a3ac3327bcb4a2b697 Mon Sep 17 00:00:00 2001 From: Ilya Lysenkov Date: Thu, 30 Sep 2010 15:33:40 +0000 Subject: [PATCH] Updated a recall curve construction in descriptors evaluation --- .../cv/src/adetectordescriptor_evaluation.cpp | 57 +++++++------------ 1 file changed, 21 insertions(+), 36 deletions(-) diff --git a/tests/cv/src/adetectordescriptor_evaluation.cpp b/tests/cv/src/adetectordescriptor_evaluation.cpp index 9e6f01e01..800c57f02 100644 --- a/tests/cv/src/adetectordescriptor_evaluation.cpp +++ b/tests/cv/src/adetectordescriptor_evaluation.cpp @@ -987,54 +987,39 @@ void DescriptorQualityTest::calculatePlotData( vector > &allMatch { vector recallPrecisionCurve; computeRecallPrecisionCurve( allMatches, allCorrectMatchesMask, recallPrecisionCurve ); - // you have recallPrecisionCurve for all images from dataset - // size of recallPrecisionCurve == total matches count -#if 0 - std::sort( allMatches.begin(), allMatches.end() ); - //calcDatasetQuality[di].resize( allMatches.size() ); calcDatasetQuality[di].clear(); - int correctMatchCount = 0, falseMatchCount = 0; - const float sparsePlotBound = 0.1; - const int npoints = 10000; - int step = 1 + allMatches.size() / npoints; const float resultPrecision = 0.5; bool isResultCalculated = false; + const double eps = 1e-2; - for( size_t i=0;i= sparsePlotBound || (i % step == 0) ) + if( fabs( quality.recall - back.recall ) < eps && fabs( quality.precision - back.precision ) < eps ) + continue; + + calcDatasetQuality[di].push_back( quality ); + + if( !isResultCalculated && quality.precision < resultPrecision ) { - Quality quality; - quality.recall = recall( correctMatchCount, allCorrespCount ); - quality.precision = precision( correctMatchCount, falseMatchCount ); - - calcDatasetQuality[di].push_back( quality ); - - if( !isResultCalculated && quality.precision < resultPrecision ) + for(int ci=0;ci &imgs, const vector &Hs, int di, int &progress)