From 685787041289d14f19314ece2ab88635d9d84104 Mon Sep 17 00:00:00 2001 From: "Patel, Nilaykumar K" Date: Thu, 14 Sep 2017 10:24:05 +0530 Subject: [PATCH] Overloading getDefaultName method for Feature2D and its child classes Signed-off-by: Vipin Anand Signed-off-by: Prashanth Voora Signed-off-by: Patel, Nilaykumar K --- modules/features2d/include/opencv2/features2d.hpp | 10 ++++++++++ modules/features2d/src/agast.cpp | 5 +++++ modules/features2d/src/akaze.cpp | 6 ++++++ modules/features2d/src/blobdetector.cpp | 5 +++++ modules/features2d/src/brisk.cpp | 5 +++++ modules/features2d/src/fast.cpp | 4 ++++ modules/features2d/src/feature2d.cpp | 5 +++++ modules/features2d/src/gftt.cpp | 5 +++++ modules/features2d/src/kaze.cpp | 6 ++++++ modules/features2d/src/mser.cpp | 5 +++++ modules/features2d/src/orb.cpp | 5 +++++ 11 files changed, 61 insertions(+) diff --git a/modules/features2d/include/opencv2/features2d.hpp b/modules/features2d/include/opencv2/features2d.hpp index 68e8aeb6f8..411194a3b2 100644 --- a/modules/features2d/include/opencv2/features2d.hpp +++ b/modules/features2d/include/opencv2/features2d.hpp @@ -206,6 +206,7 @@ public: //! Return true if detector object is empty CV_WRAP virtual bool empty() const; + CV_WRAP virtual String getDefaultName() const; }; /** Feature detectors in OpenCV have wrappers with a common interface that enables you to easily switch @@ -267,6 +268,7 @@ public: CV_WRAP static Ptr create(int thresh, int octaves, const std::vector &radiusList, const std::vector &numberList, float dMax=5.85f, float dMin=8.2f, const std::vector& indexChange=std::vector()); + CV_WRAP virtual String getDefaultName() const; }; /** @brief Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor @@ -340,6 +342,7 @@ public: CV_WRAP virtual void setFastThreshold(int fastThreshold) = 0; CV_WRAP virtual int getFastThreshold() const = 0; + CV_WRAP virtual String getDefaultName() const; }; /** @brief Maximally stable extremal region extractor @@ -399,6 +402,7 @@ public: CV_WRAP virtual void setPass2Only(bool f) = 0; CV_WRAP virtual bool getPass2Only() const = 0; + CV_WRAP virtual String getDefaultName() const; }; /** @overload */ @@ -454,6 +458,7 @@ public: CV_WRAP virtual void setType(int type) = 0; CV_WRAP virtual int getType() const = 0; + CV_WRAP virtual String getDefaultName() const; }; /** @overload */ @@ -508,6 +513,7 @@ public: CV_WRAP virtual void setType(int type) = 0; CV_WRAP virtual int getType() const = 0; + CV_WRAP virtual String getDefaultName() const; }; /** @brief Wrapping class for feature detection using the goodFeaturesToTrack function. : @@ -534,6 +540,7 @@ public: CV_WRAP virtual void setK(double k) = 0; CV_WRAP virtual double getK() const = 0; + CV_WRAP virtual String getDefaultName() const; }; /** @brief Class for extracting blobs from an image. : @@ -600,6 +607,7 @@ public: CV_WRAP static Ptr create(const SimpleBlobDetector::Params ¶meters = SimpleBlobDetector::Params()); + CV_WRAP virtual String getDefaultName() const; }; //! @} features2d_main @@ -656,6 +664,7 @@ public: CV_WRAP virtual void setDiffusivity(int diff) = 0; CV_WRAP virtual int getDiffusivity() const = 0; + CV_WRAP virtual String getDefaultName() const; }; /** @brief Class implementing the AKAZE keypoint detector and descriptor extractor, described in @cite ANB13. @@ -723,6 +732,7 @@ public: CV_WRAP virtual void setDiffusivity(int diff) = 0; CV_WRAP virtual int getDiffusivity() const = 0; + CV_WRAP virtual String getDefaultName() const; }; //! @} features2d_main diff --git a/modules/features2d/src/agast.cpp b/modules/features2d/src/agast.cpp index a0481f9159..d1f1bb6927 100644 --- a/modules/features2d/src/agast.cpp +++ b/modules/features2d/src/agast.cpp @@ -8169,4 +8169,9 @@ void AGAST(InputArray _img, std::vector& keypoints, int threshold, boo } } +String AgastFeatureDetector::getDefaultName() const +{ + return(Feature2D::getDefaultName() + ".AgastFeatureDetector"); +} + } // END NAMESPACE CV diff --git a/modules/features2d/src/akaze.cpp b/modules/features2d/src/akaze.cpp index 63194bc690..c63bb74be3 100644 --- a/modules/features2d/src/akaze.cpp +++ b/modules/features2d/src/akaze.cpp @@ -244,4 +244,10 @@ namespace cv return makePtr(descriptor_type, descriptor_size, descriptor_channels, threshold, octaves, sublevels, diffusivity); } + + String AKAZE::getDefaultName() const + { + return (Feature2D::getDefaultName() + ".AKAZE"); + } + } diff --git a/modules/features2d/src/blobdetector.cpp b/modules/features2d/src/blobdetector.cpp index ac55341be9..e545891da1 100644 --- a/modules/features2d/src/blobdetector.cpp +++ b/modules/features2d/src/blobdetector.cpp @@ -379,4 +379,9 @@ Ptr SimpleBlobDetector::create(const SimpleBlobDetector::Par return makePtr(params); } +String SimpleBlobDetector::getDefaultName() const +{ + return (Feature2D::getDefaultName() + ".SimpleBlobDetector"); +} + } diff --git a/modules/features2d/src/brisk.cpp b/modules/features2d/src/brisk.cpp index 8f99afa101..00810a62fd 100644 --- a/modules/features2d/src/brisk.cpp +++ b/modules/features2d/src/brisk.cpp @@ -2345,4 +2345,9 @@ Ptr BRISK::create(int thresh, int octaves, const std::vector &radi return makePtr(thresh, octaves, radiusList, numberList, dMax, dMin, indexChange); } +String BRISK::getDefaultName() const +{ + return (Feature2D::getDefaultName() + ".BRISK"); +} + } diff --git a/modules/features2d/src/fast.cpp b/modules/features2d/src/fast.cpp index 5b36023564..e939f065b1 100644 --- a/modules/features2d/src/fast.cpp +++ b/modules/features2d/src/fast.cpp @@ -512,5 +512,9 @@ Ptr FastFeatureDetector::create( int threshold, bool nonmax return makePtr(threshold, nonmaxSuppression, type); } +String FastFeatureDetector::getDefaultName() const +{ + return (Feature2D::getDefaultName() + ".FastFeatureDetector"); +} } diff --git a/modules/features2d/src/feature2d.cpp b/modules/features2d/src/feature2d.cpp index 06a7f4c8ff..3cd9909794 100644 --- a/modules/features2d/src/feature2d.cpp +++ b/modules/features2d/src/feature2d.cpp @@ -196,4 +196,9 @@ bool Feature2D::empty() const return true; } +String Feature2D::getDefaultName() const +{ + return "Feature2D"; +} + } diff --git a/modules/features2d/src/gftt.cpp b/modules/features2d/src/gftt.cpp index 78a395673f..1c8db7a6c1 100644 --- a/modules/features2d/src/gftt.cpp +++ b/modules/features2d/src/gftt.cpp @@ -125,4 +125,9 @@ Ptr GFTTDetector::create( int _nfeatures, double _qualityLevel, _minDistance, _blockSize, _useHarrisDetector, _k); } +String GFTTDetector::getDefaultName() const +{ + return (Feature2D::getDefaultName() + ".GFTTDetector"); +} + } diff --git a/modules/features2d/src/kaze.cpp b/modules/features2d/src/kaze.cpp index 9e24397cc5..7f2a9ad2bb 100644 --- a/modules/features2d/src/kaze.cpp +++ b/modules/features2d/src/kaze.cpp @@ -196,4 +196,10 @@ namespace cv { return makePtr(extended, upright, threshold, octaves, sublevels, diffusivity); } + + String KAZE::getDefaultName() const + { + return (Feature2D::getDefaultName() + ".KAZE"); + } + } diff --git a/modules/features2d/src/mser.cpp b/modules/features2d/src/mser.cpp index 393ed02789..eb9248c681 100755 --- a/modules/features2d/src/mser.cpp +++ b/modules/features2d/src/mser.cpp @@ -1109,4 +1109,9 @@ Ptr MSER::create( int _delta, int _min_area, int _max_area, _min_margin, _edge_blur_size)); } +String MSER::getDefaultName() const +{ + return (Feature2D::getDefaultName() + ".MSER"); +} + } diff --git a/modules/features2d/src/orb.cpp b/modules/features2d/src/orb.cpp index 9db9fd86b5..dead53f113 100644 --- a/modules/features2d/src/orb.cpp +++ b/modules/features2d/src/orb.cpp @@ -1198,4 +1198,9 @@ Ptr ORB::create(int nfeatures, float scaleFactor, int nlevels, int edgeThre firstLevel, wta_k, scoreType, patchSize, fastThreshold); } +String ORB::getDefaultName() const +{ + return (Feature2D::getDefaultName() + ".ORB"); +} + }