From f3662b0bd193683804722eb9c52ea99cb30a5714 Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Fri, 20 May 2011 12:30:47 +0000 Subject: [PATCH] fixed sample --- samples/cpp/descriptor_extractor_matcher.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/samples/cpp/descriptor_extractor_matcher.cpp b/samples/cpp/descriptor_extractor_matcher.cpp index a950582..d22a64c 100644 --- a/samples/cpp/descriptor_extractor_matcher.cpp +++ b/samples/cpp/descriptor_extractor_matcher.cpp @@ -155,10 +155,11 @@ 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 ); - for( float l_p = 0; l_p <= 1; l_p+=0.05f ) + for( float l_p = 0; l_p <= 1 + FLT_EPSILON; l_p+=0.05f ) { int nearest = getNearestPoint( curve, l_p ); - cout << "1-precision = " << curve[nearest].x << "; recall = " << curve[nearest].y << endl; + if( nearest >= 0 ) + cout << "1-precision = " << curve[nearest].x << "; recall = " << curve[nearest].y << endl; } cout << ">" << endl; } -- 2.7.4