From a66cd5698a0562fd94122b47f10cb2ff12dc3be6 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Mon, 2 Jul 2012 13:06:28 +0000 Subject: [PATCH] Merged the trunk 8892,8894,8898 --- modules/core/doc/operations_on_arrays.rst | 2 +- modules/nonfree/src/surf.cpp | 2 +- modules/nonfree/test/test_features2d.cpp | 15 +++++++-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/modules/core/doc/operations_on_arrays.rst b/modules/core/doc/operations_on_arrays.rst index ca219d87ee..26fffab8de 100644 --- a/modules/core/doc/operations_on_arrays.rst +++ b/modules/core/doc/operations_on_arrays.rst @@ -1820,7 +1820,7 @@ Finds the global minimum and maximum in an array .. note:: - When ``minIdx`` is not NULL, it must have at least 2 elements (as well as ``maxIdx``), even if ``src`` is a single-row or single-column matrix. In OpenCV (following MATLAB) each array has at least 2 dimensions, i.e. single-row matrix is ``Mx1`` matrix (and therefore ``minIdx``/``maxIdx`` will be ``(i1,0)``/``(i2,0)``) and single-column matrix is ``1xN`` matrix (and therefore ``minIdx``/``maxIdx`` will be ``(0,j1)``/``(0,j2)``). + When ``minIdx`` is not NULL, it must have at least 2 elements (as well as ``maxIdx``), even if ``src`` is a single-row or single-column matrix. In OpenCV (following MATLAB) each array has at least 2 dimensions, i.e. single-column matrix is ``Mx1`` matrix (and therefore ``minIdx``/``maxIdx`` will be ``(i1,0)``/``(i2,0)``) and single-row matrix is ``1xN`` matrix (and therefore ``minIdx``/``maxIdx`` will be ``(0,j1)``/``(0,j2)``). :param maxIdx: Pointer to the returned maximum location (in nD case). ``NULL`` is used if not required. diff --git a/modules/nonfree/src/surf.cpp b/modules/nonfree/src/surf.cpp index 2690b35993..d70624e313 100644 --- a/modules/nonfree/src/surf.cpp +++ b/modules/nonfree/src/surf.cpp @@ -667,7 +667,7 @@ struct SURFInvoker besty = sumy; } } - descriptor_dir = fastAtan2( besty, bestx ); + descriptor_dir = fastAtan2( -besty, bestx ); } kp.angle = descriptor_dir; if( !descriptors || !descriptors->data ) diff --git a/modules/nonfree/test/test_features2d.cpp b/modules/nonfree/test/test_features2d.cpp index 8b53c0518d..34258e082d 100644 --- a/modules/nonfree/test/test_features2d.cpp +++ b/modules/nonfree/test/test_features2d.cpp @@ -291,9 +291,9 @@ public: typedef typename Distance::ValueType ValueType; typedef typename Distance::ResultType DistanceType; - CV_DescriptorExtractorTest( const string _name, DistanceType _maxDist, const Ptr& _dextractor, float _prevTime, + CV_DescriptorExtractorTest( const string _name, DistanceType _maxDist, const Ptr& _dextractor, Distance d = Distance() ): - name(_name), maxDist(_maxDist), prevTime(_prevTime), dextractor(_dextractor), distance(d) {} + name(_name), maxDist(_maxDist), dextractor(_dextractor), distance(d) {} protected: virtual void createDescriptorExtractor() {} @@ -401,7 +401,7 @@ protected: double t = (double)getTickCount(); dextractor->compute( img, keypoints, calcDescriptors ); t = getTickCount() - t; - ts->printf(cvtest::TS::LOG, "\nAverage time of computing one descriptor = %g ms (previous time = %g ms).\n", t/((double)cvGetTickFrequency()*1000.)/calcDescriptors.rows, prevTime ); + ts->printf(cvtest::TS::LOG, "\nAverage time of computing one descriptor = %g ms.\n", t/((double)cvGetTickFrequency()*1000.)/calcDescriptors.rows ); if( calcDescriptors.rows != (int)keypoints.size() ) { @@ -486,7 +486,6 @@ protected: string name; const DistanceType maxDist; - const float prevTime; Ptr dextractor; Distance distance; @@ -988,28 +987,28 @@ TEST( Features2d_Detector_SURF, regression ) TEST( Features2d_DescriptorExtractor_SIFT, regression ) { CV_DescriptorExtractorTest > test( "descriptor-sift", 0.03f, - DescriptorExtractor::create("SIFT"), 8.06652f ); + DescriptorExtractor::create("SIFT") ); test.safe_run(); } TEST( Features2d_DescriptorExtractor_SURF, regression ) { CV_DescriptorExtractorTest > test( "descriptor-surf", 0.05f, - DescriptorExtractor::create("SURF"), 0.147372f ); + DescriptorExtractor::create("SURF") ); test.safe_run(); } TEST( Features2d_DescriptorExtractor_OpponentSIFT, regression ) { CV_DescriptorExtractorTest > test( "descriptor-opponent-sift", 0.18f, - DescriptorExtractor::create("OpponentSIFT"), 8.06652f ); + DescriptorExtractor::create("OpponentSIFT") ); test.safe_run(); } TEST( Features2d_DescriptorExtractor_OpponentSURF, regression ) { CV_DescriptorExtractorTest > test( "descriptor-opponent-surf", 0.3f, - DescriptorExtractor::create("OpponentSURF"), 0.147372f ); + DescriptorExtractor::create("OpponentSURF") ); test.safe_run(); }