1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

DescriptorExtractor: added defaultNorm() to return default norm type.

Added the defaultNorm() method to the DescriptorExtractor class. This method returns the default norm type for each descriptor type. The tests and C/C++ samples were updated to get the norm type directly from the DescriptorExtractor inherited classes.

This was reported in feature report #2182 (http://code.opencv.org/issues/2182). It will make it possible to get the norm type usually applied matching method for each descriptor, instead of passing it manually.
This commit is contained in:
Peter Andreas Entschev
2013-11-27 17:58:40 -02:00
parent 41ae5d5f66
commit 6f3163f62d
29 changed files with 94 additions and 26 deletions
@@ -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();
//}