diff --git a/modules/features2d/src/kaze/KAZEFeatures.cpp b/modules/features2d/src/kaze/KAZEFeatures.cpp index 29d85d3285..bbefd4dac9 100644 --- a/modules/features2d/src/kaze/KAZEFeatures.cpp +++ b/modules/features2d/src/kaze/KAZEFeatures.cpp @@ -606,7 +606,7 @@ void KAZEFeatures::Compute_Main_Orientation(KeyPoint &kpt, const std::vector max) { // store largest orientation max = sumX*sumX + sumY*sumY; - kpt.angle = getAngle(sumX, sumY) * 180.f / static_cast(CV_PI); + kpt.angle = fastAtan2(sumX, sumY); } } } diff --git a/modules/features2d/src/kaze/utils.h b/modules/features2d/src/kaze/utils.h index d9bfbe4472..d7af55e9e7 100644 --- a/modules/features2d/src/kaze/utils.h +++ b/modules/features2d/src/kaze/utils.h @@ -1,31 +1,6 @@ #ifndef __OPENCV_FEATURES_2D_KAZE_UTILS_H__ #define __OPENCV_FEATURES_2D_KAZE_UTILS_H__ -/* ************************************************************************* */ -/** - * @brief This function computes the angle from the vector given by (X Y). From 0 to 2*Pi - */ -inline float getAngle(float x, float y) { - - if (x >= 0 && y >= 0) { - return atanf(y / x); - } - - if (x < 0 && y >= 0) { - return static_cast(CV_PI)-atanf(-y / x); - } - - if (x < 0 && y < 0) { - return static_cast(CV_PI)+atanf(y / x); - } - - if (x >= 0 && y < 0) { - return static_cast(2.0 * CV_PI) - atanf(-y / x); - } - - return 0; -} - /* ************************************************************************* */ /** * @brief This function computes the value of a 2D Gaussian function