Skip to content

Commit 4ea5bbd

Browse files
committed
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).
1 parent fca8463 commit 4ea5bbd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

modules/features2d/src/kaze/AKAZEFeatures.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ int AKAZEFeatures::Create_Nonlinear_Scale_Space(const Mat& img)
294294
}
295295
}
296296

297+
Compute_Determinant_Hessian_Response();
298+
297299
return 0;
298300
}
299301

@@ -307,7 +309,6 @@ void AKAZEFeatures::Feature_Detection(std::vector<KeyPoint>& kpts)
307309
CV_INSTRUMENT_REGION()
308310

309311
kpts.clear();
310-
Compute_Determinant_Hessian_Response();
311312
Find_Scale_Space_Extrema(kpts);
312313
Do_Subpixel_Refinement(kpts);
313314
}

modules/features2d/test/test_descriptors_invariance.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ INSTANTIATE_TEST_CASE_P(AKAZE, DescriptorRotationInvariance,
179179
Value(IMAGE_TSUKUBA, AKAZE::create(), AKAZE::create(), 0.99f));
180180

181181
INSTANTIATE_TEST_CASE_P(AKAZE_DESCRIPTOR_KAZE, DescriptorRotationInvariance,
182-
Value(IMAGE_TSUKUBA, AKAZE::create(AKAZE::DESCRIPTOR_KAZE), AKAZE::create(AKAZE::DESCRIPTOR_KAZE), 0.002f));
182+
Value(IMAGE_TSUKUBA, AKAZE::create(AKAZE::DESCRIPTOR_KAZE), AKAZE::create(AKAZE::DESCRIPTOR_KAZE), 0.99f));
183183

184184
/*
185185
* Descriptor's scale invariance check
@@ -189,4 +189,4 @@ INSTANTIATE_TEST_CASE_P(AKAZE, DescriptorScaleInvariance,
189189
Value(IMAGE_BIKES, AKAZE::create(), AKAZE::create(), 0.6f));
190190

191191
INSTANTIATE_TEST_CASE_P(AKAZE_DESCRIPTOR_KAZE, DescriptorScaleInvariance,
192-
Value(IMAGE_BIKES, AKAZE::create(AKAZE::DESCRIPTOR_KAZE), AKAZE::create(AKAZE::DESCRIPTOR_KAZE), 0.0004f));
192+
Value(IMAGE_BIKES, AKAZE::create(AKAZE::DESCRIPTOR_KAZE), AKAZE::create(AKAZE::DESCRIPTOR_KAZE), 0.55f));

0 commit comments

Comments
 (0)