From 4ea5bbd31fdad5d2e597da108e4734f6732059fd Mon Sep 17 00:00:00 2001 From: Jiri Horner Date: Fri, 30 Jun 2017 18:22:16 +0200 Subject: [PATCH] always compute determinat od hessian and spacial derivatives * this needs to be computed always as we need derivatives while computing descriptors * fixed tests of AKAZE with KAZE descriptors which have been affected by this Currently it computes all first and second order derivatives together and the determiant of the hessian. For descriptors it would be enough to compute just first order derivates, but it is not probably worth it optimize for scenario where descriptors and keypoints are computed separately, since it is already very inefficient. When computing keypoint and descriptors together it is faster to do it the current way (preserves locality). --- modules/features2d/src/kaze/AKAZEFeatures.cpp | 3 ++- modules/features2d/test/test_descriptors_invariance.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/features2d/src/kaze/AKAZEFeatures.cpp b/modules/features2d/src/kaze/AKAZEFeatures.cpp index 0177063f33..c930d11a6c 100644 --- a/modules/features2d/src/kaze/AKAZEFeatures.cpp +++ b/modules/features2d/src/kaze/AKAZEFeatures.cpp @@ -294,6 +294,8 @@ int AKAZEFeatures::Create_Nonlinear_Scale_Space(const Mat& img) } } + Compute_Determinant_Hessian_Response(); + return 0; } @@ -307,7 +309,6 @@ void AKAZEFeatures::Feature_Detection(std::vector& kpts) CV_INSTRUMENT_REGION() kpts.clear(); - Compute_Determinant_Hessian_Response(); Find_Scale_Space_Extrema(kpts); Do_Subpixel_Refinement(kpts); } diff --git a/modules/features2d/test/test_descriptors_invariance.cpp b/modules/features2d/test/test_descriptors_invariance.cpp index 2e678e89ce..1edb7807be 100644 --- a/modules/features2d/test/test_descriptors_invariance.cpp +++ b/modules/features2d/test/test_descriptors_invariance.cpp @@ -179,7 +179,7 @@ INSTANTIATE_TEST_CASE_P(AKAZE, DescriptorRotationInvariance, Value(IMAGE_TSUKUBA, AKAZE::create(), AKAZE::create(), 0.99f)); INSTANTIATE_TEST_CASE_P(AKAZE_DESCRIPTOR_KAZE, DescriptorRotationInvariance, - Value(IMAGE_TSUKUBA, AKAZE::create(AKAZE::DESCRIPTOR_KAZE), AKAZE::create(AKAZE::DESCRIPTOR_KAZE), 0.002f)); + Value(IMAGE_TSUKUBA, AKAZE::create(AKAZE::DESCRIPTOR_KAZE), AKAZE::create(AKAZE::DESCRIPTOR_KAZE), 0.99f)); /* * Descriptor's scale invariance check @@ -189,4 +189,4 @@ INSTANTIATE_TEST_CASE_P(AKAZE, DescriptorScaleInvariance, Value(IMAGE_BIKES, AKAZE::create(), AKAZE::create(), 0.6f)); INSTANTIATE_TEST_CASE_P(AKAZE_DESCRIPTOR_KAZE, DescriptorScaleInvariance, - Value(IMAGE_BIKES, AKAZE::create(AKAZE::DESCRIPTOR_KAZE), AKAZE::create(AKAZE::DESCRIPTOR_KAZE), 0.0004f)); + Value(IMAGE_BIKES, AKAZE::create(AKAZE::DESCRIPTOR_KAZE), AKAZE::create(AKAZE::DESCRIPTOR_KAZE), 0.55f));