From ee893a08efc9607b4ef3c19fb83ea7a7aab0881b Mon Sep 17 00:00:00 2001 From: Suleyman TURKMEN Date: Sun, 27 Jun 2021 11:22:18 +0300 Subject: [PATCH] Update features2d.hpp, agast.cpp, fast.cpp --- .../features2d/include/opencv2/features2d.hpp | 26 ++++++------------- modules/features2d/src/agast.cpp | 7 ----- modules/features2d/src/fast.cpp | 8 ------ 3 files changed, 8 insertions(+), 33 deletions(-) diff --git a/modules/features2d/include/opencv2/features2d.hpp b/modules/features2d/include/opencv2/features2d.hpp index 38bd7ae487..8a8ff04625 100644 --- a/modules/features2d/include/opencv2/features2d.hpp +++ b/modules/features2d/include/opencv2/features2d.hpp @@ -516,7 +516,9 @@ public: //! @addtogroup features2d_main //! @{ -/** @brief Wrapping class for feature detection using the FAST method. : +/** @brief Wrapping class for feature detection using the FAST method. + +Check @ref tutorial_py_fast "the corresponding tutorial" for more details. */ class CV_EXPORTS_W FastFeatureDetector : public Feature2D { @@ -546,30 +548,23 @@ public: CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; }; -/** @overload */ -CV_EXPORTS void FAST( InputArray image, CV_OUT std::vector& keypoints, - int threshold, bool nonmaxSuppression=true ); - /** @brief Detects corners using the FAST algorithm @param image grayscale image where keypoints (corners) are detected. @param keypoints keypoints detected on the image. @param threshold threshold on difference between intensity of the central pixel and pixels of a circle around this pixel. -@param nonmaxSuppression if true, non-maximum suppression is applied to detected corners -(keypoints). +@param nonmaxSuppression if true, non-maximum suppression is applied to detected keypoints (corners). @param type one of the three neighborhoods as defined in the paper: FastFeatureDetector::TYPE_9_16, FastFeatureDetector::TYPE_7_12, FastFeatureDetector::TYPE_5_8 Detects corners using the FAST algorithm by @cite Rosten06 . -@note In Python API, types are given as cv.FAST_FEATURE_DETECTOR_TYPE_5_8, -cv.FAST_FEATURE_DETECTOR_TYPE_7_12 and cv.FAST_FEATURE_DETECTOR_TYPE_9_16. For corner -detection, use cv.FAST.detect() method. +Check @ref tutorial_py_fast "the corresponding tutorial" for more details. */ CV_EXPORTS void FAST( InputArray image, CV_OUT std::vector& keypoints, - int threshold, bool nonmaxSuppression, FastFeatureDetector::DetectorType type ); + int threshold, bool nonmaxSuppression=true, FastFeatureDetector::DetectorType type=FastFeatureDetector::TYPE_9_16 ); //! @} features2d_main @@ -606,18 +601,13 @@ public: CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; }; -/** @overload */ -CV_EXPORTS void AGAST( InputArray image, CV_OUT std::vector& keypoints, - int threshold, bool nonmaxSuppression=true ); - /** @brief Detects corners using the AGAST algorithm @param image grayscale image where keypoints (corners) are detected. @param keypoints keypoints detected on the image. @param threshold threshold on difference between intensity of the central pixel and pixels of a circle around this pixel. -@param nonmaxSuppression if true, non-maximum suppression is applied to detected corners -(keypoints). +@param nonmaxSuppression if true, non-maximum suppression is applied to detected keypoints (corners). @param type one of the four neighborhoods as defined in the paper: AgastFeatureDetector::AGAST_5_8, AgastFeatureDetector::AGAST_7_12d, AgastFeatureDetector::AGAST_7_12s, AgastFeatureDetector::OAST_9_16 @@ -629,7 +619,7 @@ Detects corners using the AGAST algorithm by @cite mair2010_agast . */ CV_EXPORTS void AGAST( InputArray image, CV_OUT std::vector& keypoints, - int threshold, bool nonmaxSuppression, AgastFeatureDetector::DetectorType type ); + int threshold, bool nonmaxSuppression=true, AgastFeatureDetector::DetectorType type=AgastFeatureDetector::OAST_9_16 ); /** @brief Wrapping class for feature detection using the goodFeaturesToTrack function. : */ diff --git a/modules/features2d/src/agast.cpp b/modules/features2d/src/agast.cpp index e99ceec416..aed092ec3e 100644 --- a/modules/features2d/src/agast.cpp +++ b/modules/features2d/src/agast.cpp @@ -7934,13 +7934,6 @@ static void OAST_9_16(InputArray _img, std::vector& keypoints, int thr #endif // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64)) -void AGAST(InputArray _img, std::vector& keypoints, int threshold, bool nonmax_suppression) -{ - CV_INSTRUMENT_REGION(); - - AGAST(_img, keypoints, threshold, nonmax_suppression, AgastFeatureDetector::OAST_9_16); -} - class AgastFeatureDetector_Impl CV_FINAL : public AgastFeatureDetector { public: diff --git a/modules/features2d/src/fast.cpp b/modules/features2d/src/fast.cpp index e373926a14..42e5188bc0 100644 --- a/modules/features2d/src/fast.cpp +++ b/modules/features2d/src/fast.cpp @@ -524,14 +524,6 @@ void FAST(InputArray _img, std::vector& keypoints, int threshold, bool } -void FAST(InputArray _img, std::vector& keypoints, int threshold, bool nonmax_suppression) -{ - CV_INSTRUMENT_REGION(); - - FAST(_img, keypoints, threshold, nonmax_suppression, FastFeatureDetector::TYPE_9_16); -} - - class FastFeatureDetector_Impl CV_FINAL : public FastFeatureDetector { public: