Implemented missed AlgorithmInfo for BRIEF
This commit is contained in:
parent
700c1665c9
commit
ce89d00fcf
@ -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
|
|||||||
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 )
|
|||||||
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 )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user