From ebe2d03aefae92ebc84422bb3769440548e2a69e Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Fri, 20 May 2011 12:46:05 +0000 Subject: [PATCH] removed duplicated output, added the print of first and last points always --- samples/cpp/descriptor_extractor_matcher.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/samples/cpp/descriptor_extractor_matcher.cpp b/samples/cpp/descriptor_extractor_matcher.cpp index d22a64c327..909022f97d 100644 --- a/samples/cpp/descriptor_extractor_matcher.cpp +++ b/samples/cpp/descriptor_extractor_matcher.cpp @@ -155,12 +155,24 @@ void doIteration( const Mat& img1, Mat& img2, bool isWarpPerspective, Ptr gdm = new VectorDescriptorMatcher( descriptorExtractor, descriptorMatcher ); evaluateGenericDescriptorMatcher( img1, img2, H12, keypoints1, keypoints2, 0, 0, curve, gdm ); + Point2f firstPoint = *curve.begin(); + Point2f lastPoint = *curve.rbegin(); + int prevPointIndex = -1; + cout << "1-precision = " << firstPoint.x << "; recall = " << firstPoint.y << endl; for( float l_p = 0; l_p <= 1 + FLT_EPSILON; l_p+=0.05f ) { int nearest = getNearestPoint( curve, l_p ); if( nearest >= 0 ) - cout << "1-precision = " << curve[nearest].x << "; recall = " << curve[nearest].y << endl; + { + Point2f curPoint = curve[nearest]; + if( curPoint.x > firstPoint.x && curPoint.x < lastPoint.x && nearest != prevPointIndex ) + { + cout << "1-precision = " << curPoint.x << "; recall = " << curPoint.y << endl; + prevPointIndex = nearest; + } + } } + cout << "1-precision = " << lastPoint.x << "; recall = " << lastPoint.y << endl; cout << ">" << endl; }