Skip to content

Commit ca826f2

Browse files
committed
feature2d: added regression tests for AKAZE
* test with both MLDB and KAZE keypoints
1 parent ffd9ad9 commit ca826f2

File tree

3 files changed

+71
-2
lines changed

3 files changed

+71
-2
lines changed

modules/features2d/test/test_descriptors_regression.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,14 @@ TEST( Features2d_DescriptorExtractor_AKAZE, regression )
350350
test.safe_run();
351351
}
352352

353+
TEST( Features2d_DescriptorExtractor_AKAZE_DESCRIPTOR_KAZE, regression )
354+
{
355+
CV_DescriptorExtractorTest< L2<float> > test( "descriptor-akaze-with-kaze-desc", 0.03f,
356+
AKAZE::create(AKAZE::DESCRIPTOR_KAZE),
357+
L2<float>(), AKAZE::create(AKAZE::DESCRIPTOR_KAZE));
358+
test.safe_run();
359+
}
360+
353361
TEST( Features2d_DescriptorExtractor, batch )
354362
{
355363
string path = string(cvtest::TS::ptr()->get_data_path() + "detectors_descriptors_evaluation/images_datasets/graf");

modules/features2d/test/test_detectors_regression.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,13 @@ TEST( Features2d_Detector_AKAZE, regression )
302302
test.safe_run();
303303
}
304304

305+
TEST( Features2d_Detector_AKAZE_DESCRIPTOR_KAZE, regression )
306+
{
307+
CV_FeatureDetectorTest test( "detector-akaze-with-kaze-desc", AKAZE::create(AKAZE::DESCRIPTOR_KAZE) );
308+
test.safe_run();
309+
}
310+
311+
305312
TEST( Features2d_Detector_AKAZE, detect_and_compute_split )
306313
{
307314
Mat testImg(100, 100, CV_8U);

modules/features2d/test/test_rotation_and_scale_invariance.cpp

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,12 @@ void rotateKeyPoints(const vector<KeyPoint>& src, const Mat& H, float angle, vec
104104
void scaleKeyPoints(const vector<KeyPoint>& src, vector<KeyPoint>& dst, float scale)
105105
{
106106
dst.resize(src.size());
107-
for(size_t i = 0; i < src.size(); i++)
108-
dst[i] = KeyPoint(src[i].pt.x * scale, src[i].pt.y * scale, src[i].size * scale, src[i].angle);
107+
for (size_t i = 0; i < src.size(); i++) {
108+
dst[i] = src[i];
109+
dst[i].pt.x *= scale;
110+
dst[i].pt.y *= scale;
111+
dst[i].size *= scale;
112+
}
109113
}
110114

111115
static
@@ -630,6 +634,22 @@ TEST(Features2d_RotationInvariance_Detector_ORB, regression)
630634
test.safe_run();
631635
}
632636

637+
TEST(Features2d_RotationInvariance_Detector_AKAZE, regression)
638+
{
639+
DetectorRotationInvarianceTest test(AKAZE::create(),
640+
0.5f,
641+
0.76f);
642+
test.safe_run();
643+
}
644+
645+
TEST(Features2d_RotationInvariance_Detector_AKAZE_DESCRIPTOR_KAZE, regression)
646+
{
647+
DetectorRotationInvarianceTest test(AKAZE::create(AKAZE::DESCRIPTOR_KAZE),
648+
0.5f,
649+
0.76f);
650+
test.safe_run();
651+
}
652+
633653
/*
634654
* Descriptors's rotation invariance check
635655
*/
@@ -648,6 +668,20 @@ TEST(Features2d_RotationInvariance_Descriptor_ORB, regression)
648668
test.safe_run();
649669
}
650670

671+
TEST(Features2d_RotationInvariance_Descriptor_AKAZE, regression)
672+
{
673+
Ptr<Feature2D> f2d = AKAZE::create();
674+
DescriptorRotationInvarianceTest test(f2d, f2d, f2d->defaultNorm(), 0.99f);
675+
test.safe_run();
676+
}
677+
678+
TEST(Features2d_RotationInvariance_Descriptor_AKAZE_DESCRIPTOR_KAZE, regression)
679+
{
680+
Ptr<Feature2D> f2d = AKAZE::create(AKAZE::DESCRIPTOR_KAZE);
681+
DescriptorRotationInvarianceTest test(f2d, f2d, f2d->defaultNorm(), 0.99f);
682+
test.safe_run();
683+
}
684+
651685
//TEST(Features2d_RotationInvariance_Descriptor_FREAK, regression)
652686
//{
653687
// DescriptorRotationInvarianceTest test(Algorithm::create<FeatureDetector>("Feature2D.ORB"),
@@ -679,6 +713,12 @@ TEST(Features2d_ScaleInvariance_Detector_AKAZE, regression)
679713
test.safe_run();
680714
}
681715

716+
TEST(Features2d_ScaleInvariance_Detector_AKAZE_DESCRIPTOR_KAZE, regression)
717+
{
718+
DetectorScaleInvarianceTest test(AKAZE::create(AKAZE::DESCRIPTOR_KAZE), 0.08f, 0.49f);
719+
test.safe_run();
720+
}
721+
682722
TEST(Features2d_ScaleInvariance_Detector_ORB, regression)
683723
{
684724
DetectorScaleInvarianceTest test(ORB::create(), 0.08f, 0.49f);
@@ -689,6 +729,20 @@ TEST(Features2d_ScaleInvariance_Detector_ORB, regression)
689729
* Descriptor's scale invariance check
690730
*/
691731

732+
TEST(Features2d_ScaleInvariance_Descriptor_AKAZE, regression)
733+
{
734+
Ptr<Feature2D> akaze = AKAZE::create();
735+
DescriptorScaleInvarianceTest test(akaze, akaze, akaze->defaultNorm(), 0.01f);
736+
test.safe_run();
737+
}
738+
739+
TEST(Features2d_ScaleInvariance_Descriptor_AKAZE_DESCRIPTOR_KAZE, regression)
740+
{
741+
Ptr<Feature2D> akaze = AKAZE::create(AKAZE::DESCRIPTOR_KAZE);
742+
DescriptorScaleInvarianceTest test(akaze, akaze, akaze->defaultNorm(), 0.01f);
743+
test.safe_run();
744+
}
745+
692746
//TEST(Features2d_ScaleInvariance_Descriptor_BRISK, regression)
693747
//{
694748
// DescriptorScaleInvarianceTest test(Algorithm::create<FeatureDetector>("Feature2D.BRISK"),

0 commit comments

Comments
 (0)