Implemented missed AlgorithmInfo for BRIEF
authorAndrey Kamaev <no@email>
Thu, 29 Mar 2012 03:06:59 +0000 (03:06 +0000)
committerAndrey Kamaev <no@email>
Thu, 29 Mar 2012 03:06:59 +0000 (03:06 +0000)
modules/features2d/include/opencv2/features2d/features2d.hpp
modules/features2d/src/brief.cpp
modules/features2d/test/test_features2d.cpp

index 08872a8..f3a6626 100644 (file)
@@ -724,6 +724,8 @@ public:
 
     /// @todo read and write for brief
 
+    AlgorithmInfo* info() const;
+
 protected:
     virtual void computeImpl(const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors) const;
 
index 7247b92..c825707 100644 (file)
@@ -172,4 +172,20 @@ void BriefDescriptorExtractor::computeImpl(const Mat& image, std::vector<KeyPoin
     test_fn_(sum, keypoints, descriptors);
 }
 
+static Algorithm* createBRIEF() { return new BriefDescriptorExtractor; }
+static AlgorithmInfo brief_info("Feature2D.BRIEF", createBRIEF);
+
+AlgorithmInfo* BriefDescriptorExtractor::info() const
+{
+    static volatile bool initialized = false;
+    if( !initialized )
+    {
+        BriefDescriptorExtractor brief;
+        brief_info.addParam(brief, "bytes", brief.bytes_);
+
+        initialized = true;
+    }
+    return &brief_info;
+}
+
 } // namespace cv
index f7f9c4c..8c5fc6f 100644 (file)
@@ -697,7 +697,7 @@ void CV_DescriptorMatcherTest::matchTest( const Mat& query, const Mat& train )
             for( size_t i = 0; i < matches.size(); i++ )
             {
                 DMatch& match = matches[i];
-                std::cout << match.distance << std::endl;
+                //std::cout << match.distance << std::endl;
 
                 if( match.queryIdx != (int)i || match.trainIdx != (int)i || std::abs(match.distance) > FLT_EPSILON )
                 {