Commit ce89d00f authored by Andrey Kamaev's avatar Andrey Kamaev

Implemented missed AlgorithmInfo for BRIEF

parent 700c1665
...@@ -724,6 +724,8 @@ public: ...@@ -724,6 +724,8 @@ public:
/// @todo read and write for brief /// @todo read and write for brief
AlgorithmInfo* info() const;
protected: protected:
virtual void computeImpl(const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors) const; virtual void computeImpl(const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors) const;
......
...@@ -172,4 +172,20 @@ void BriefDescriptorExtractor::computeImpl(const Mat& image, std::vector<KeyPoin ...@@ -172,4 +172,20 @@ void BriefDescriptorExtractor::computeImpl(const Mat& image, std::vector<KeyPoin
test_fn_(sum, keypoints, descriptors); 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 } // namespace cv
...@@ -697,7 +697,7 @@ void CV_DescriptorMatcherTest::matchTest( const Mat& query, const Mat& train ) ...@@ -697,7 +697,7 @@ void CV_DescriptorMatcherTest::matchTest( const Mat& query, const Mat& train )
for( size_t i = 0; i < matches.size(); i++ ) for( size_t i = 0; i < matches.size(); i++ )
{ {
DMatch& match = matches[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 ) if( match.queryIdx != (int)i || match.trainIdx != (int)i || std::abs(match.distance) > FLT_EPSILON )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment