Merge pull request #1881 from pentschev:defaultNorm_master
This commit is contained in:
@@ -35,6 +35,7 @@ Abstract base class for computing descriptors for image keypoints. ::
|
||||
|
||||
virtual int descriptorSize() const = 0;
|
||||
virtual int descriptorType() const = 0;
|
||||
virtual int defaultNorm() const = 0;
|
||||
|
||||
static Ptr<DescriptorExtractor> create( const String& descriptorExtractorType );
|
||||
|
||||
@@ -114,6 +115,7 @@ them into a single color descriptor. ::
|
||||
virtual void write( FileStorage& ) const;
|
||||
virtual int descriptorSize() const;
|
||||
virtual int descriptorType() const;
|
||||
virtual int defaultNorm() const;
|
||||
protected:
|
||||
...
|
||||
};
|
||||
@@ -141,6 +143,7 @@ Strecha C., Fua P. *BRIEF: Binary Robust Independent Elementary Features* ,
|
||||
virtual void write( FileStorage& ) const;
|
||||
virtual int descriptorSize() const;
|
||||
virtual int descriptorType() const;
|
||||
virtual int defaultNorm() const;
|
||||
protected:
|
||||
...
|
||||
};
|
||||
|
||||
@@ -169,6 +169,7 @@ public:
|
||||
|
||||
CV_WRAP virtual int descriptorSize() const = 0;
|
||||
CV_WRAP virtual int descriptorType() const = 0;
|
||||
CV_WRAP virtual int defaultNorm() const = 0;
|
||||
|
||||
CV_WRAP virtual bool empty() const;
|
||||
|
||||
@@ -226,6 +227,8 @@ public:
|
||||
int descriptorSize() const;
|
||||
// returns the descriptor type
|
||||
int descriptorType() const;
|
||||
// returns the default norm type
|
||||
int defaultNorm() const;
|
||||
|
||||
// Compute the BRISK features on an image
|
||||
void operator()(InputArray image, InputArray mask, std::vector<KeyPoint>& keypoints) const;
|
||||
@@ -320,6 +323,8 @@ public:
|
||||
int descriptorSize() const;
|
||||
// returns the descriptor type
|
||||
int descriptorType() const;
|
||||
// returns the default norm type
|
||||
int defaultNorm() const;
|
||||
|
||||
// Compute the ORB features and descriptors on an image
|
||||
void operator()(InputArray image, InputArray mask, std::vector<KeyPoint>& keypoints) const;
|
||||
@@ -377,6 +382,9 @@ public:
|
||||
/** returns the descriptor type */
|
||||
virtual int descriptorType() const;
|
||||
|
||||
/** returns the default norm type */
|
||||
virtual int defaultNorm() const;
|
||||
|
||||
/** select the 512 "best description pairs"
|
||||
* @param images grayscale images set
|
||||
* @param keypoints set of detected keypoints
|
||||
@@ -837,6 +845,7 @@ public:
|
||||
|
||||
virtual int descriptorSize() const;
|
||||
virtual int descriptorType() const;
|
||||
virtual int defaultNorm() const;
|
||||
|
||||
virtual bool empty() const;
|
||||
|
||||
@@ -863,6 +872,7 @@ public:
|
||||
|
||||
virtual int descriptorSize() const;
|
||||
virtual int descriptorType() const;
|
||||
virtual int defaultNorm() const;
|
||||
|
||||
/// @todo read and write for brief
|
||||
|
||||
|
||||
@@ -125,6 +125,11 @@ int BriefDescriptorExtractor::descriptorType() const
|
||||
return CV_8UC1;
|
||||
}
|
||||
|
||||
int BriefDescriptorExtractor::defaultNorm() const
|
||||
{
|
||||
return NORM_HAMMING;
|
||||
}
|
||||
|
||||
void BriefDescriptorExtractor::read( const FileNode& fn)
|
||||
{
|
||||
int dSize = fn["descriptorSize"];
|
||||
|
||||
@@ -712,6 +712,12 @@ BRISK::descriptorType() const
|
||||
return CV_8U;
|
||||
}
|
||||
|
||||
int
|
||||
BRISK::defaultNorm() const
|
||||
{
|
||||
return NORM_HAMMING;
|
||||
}
|
||||
|
||||
BRISK::~BRISK()
|
||||
{
|
||||
delete[] patternPoints_;
|
||||
|
||||
@@ -247,6 +247,11 @@ int OpponentColorDescriptorExtractor::descriptorType() const
|
||||
return descriptorExtractor->descriptorType();
|
||||
}
|
||||
|
||||
int OpponentColorDescriptorExtractor::defaultNorm() const
|
||||
{
|
||||
return descriptorExtractor->defaultNorm();
|
||||
}
|
||||
|
||||
bool OpponentColorDescriptorExtractor::empty() const
|
||||
{
|
||||
return !descriptorExtractor || descriptorExtractor->empty();
|
||||
|
||||
@@ -676,4 +676,9 @@ int FREAK::descriptorType() const
|
||||
return CV_8U;
|
||||
}
|
||||
|
||||
int FREAK::defaultNorm() const
|
||||
{
|
||||
return NORM_HAMMING;
|
||||
}
|
||||
|
||||
} // END NAMESPACE CV
|
||||
|
||||
@@ -575,6 +575,11 @@ int ORB::descriptorType() const
|
||||
return CV_8U;
|
||||
}
|
||||
|
||||
int ORB::defaultNorm() const
|
||||
{
|
||||
return NORM_HAMMING;
|
||||
}
|
||||
|
||||
/** Compute the ORB features and descriptors on an image
|
||||
* @param img the image to compute the features and descriptors on
|
||||
* @param mask the mask to apply
|
||||
|
||||
@@ -616,8 +616,8 @@ TEST(Features2d_RotationInvariance_Detector_ORB, regression)
|
||||
TEST(Features2d_RotationInvariance_Descriptor_BRISK, regression)
|
||||
{
|
||||
DescriptorRotationInvarianceTest test(Algorithm::create<FeatureDetector>("Feature2D.BRISK"),
|
||||
Algorithm::create<DescriptorExtractor>("Feature2D.BRISK"),
|
||||
NORM_HAMMING,
|
||||
Algorithm::create<DescriptorExtractor>("Feature2D.BRISK"),
|
||||
Algorithm::create<DescriptorExtractor>("Feature2D.BRISK")->defaultNorm(),
|
||||
0.99f);
|
||||
test.safe_run();
|
||||
}
|
||||
@@ -626,7 +626,7 @@ TEST(Features2d_RotationInvariance_Descriptor_ORB, regression)
|
||||
{
|
||||
DescriptorRotationInvarianceTest test(Algorithm::create<FeatureDetector>("Feature2D.ORB"),
|
||||
Algorithm::create<DescriptorExtractor>("Feature2D.ORB"),
|
||||
NORM_HAMMING,
|
||||
Algorithm::create<DescriptorExtractor>("Feature2D.ORB")->defaultNorm(),
|
||||
0.99f);
|
||||
test.safe_run();
|
||||
}
|
||||
@@ -635,7 +635,7 @@ TEST(Features2d_RotationInvariance_Descriptor_ORB, regression)
|
||||
//{
|
||||
// DescriptorRotationInvarianceTest test(Algorithm::create<FeatureDetector>("Feature2D.ORB"),
|
||||
// Algorithm::create<DescriptorExtractor>("Feature2D.FREAK"),
|
||||
// NORM_HAMMING,
|
||||
// Algorithm::create<DescriptorExtractor>("Feature2D.FREAK")->defaultNorm(),
|
||||
// 0.f);
|
||||
// test.safe_run();
|
||||
//}
|
||||
@@ -667,26 +667,26 @@ TEST(Features2d_ScaleInvariance_Detector_BRISK, regression)
|
||||
//TEST(Features2d_ScaleInvariance_Descriptor_BRISK, regression)
|
||||
//{
|
||||
// DescriptorScaleInvarianceTest test(Algorithm::create<FeatureDetector>("Feature2D.BRISK"),
|
||||
// Algorithm::create<DescriptorExtractor>("Feature2D.BRISK"),
|
||||
// NORM_HAMMING,
|
||||
// 0.99f);
|
||||
// Algorithm::create<DescriptorExtractor>("Feature2D.BRISK"),
|
||||
// Algorithm::create<DescriptorExtractor>("Feature2D.BRISK")->defaultNorm(),
|
||||
// 0.99f);
|
||||
// test.safe_run();
|
||||
//}
|
||||
|
||||
//TEST(Features2d_ScaleInvariance_Descriptor_ORB, regression)
|
||||
//{
|
||||
// DescriptorScaleInvarianceTest test(Algorithm::create<FeatureDetector>("Feature2D.ORB"),
|
||||
// Algorithm::create<DescriptorExtractor>("Feature2D.ORB"),
|
||||
// NORM_HAMMING,
|
||||
// 0.01f);
|
||||
// Algorithm::create<DescriptorExtractor>("Feature2D.ORB"),
|
||||
// Algorithm::create<DescriptorExtractor>("Feature2D.ORB")->defaultNorm(),
|
||||
// 0.01f);
|
||||
// test.safe_run();
|
||||
//}
|
||||
|
||||
//TEST(Features2d_ScaleInvariance_Descriptor_FREAK, regression)
|
||||
//{
|
||||
// DescriptorScaleInvarianceTest test(Algorithm::create<FeatureDetector>("Feature2D.ORB"),
|
||||
// Algorithm::create<DescriptorExtractor>("Feature2D.FREAK"),
|
||||
// NORM_HAMMING,
|
||||
// 0.01f);
|
||||
// Algorithm::create<DescriptorExtractor>("Feature2D.FREAK"),
|
||||
// Algorithm::create<DescriptorExtractor>("Feature2D.FREAK")->defaultNorm(),
|
||||
// 0.01f);
|
||||
// test.safe_run();
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user