diff --git a/modules/features2d/include/opencv2/features2d.hpp b/modules/features2d/include/opencv2/features2d.hpp index 70fe4094b0..afd2477d29 100644 --- a/modules/features2d/include/opencv2/features2d.hpp +++ b/modules/features2d/include/opencv2/features2d.hpp @@ -250,6 +250,23 @@ public: @param indexChange index remapping of the bits. */ CV_WRAP static Ptr create(const std::vector &radiusList, const std::vector &numberList, float dMax=5.85f, float dMin=8.2f, const std::vector& indexChange=std::vector()); + + /** @brief The BRISK constructor for a custom pattern, detection threshold and octaves + + @param thresh AGAST detection threshold score. + @param octaves detection octaves. Use 0 to do single scale. + @param radiusList defines the radii (in pixels) where the samples around a keypoint are taken (for + keypoint scale 1). + @param numberList defines the number of sampling points on the sampling circle. Must be the same + size as radiusList.. + @param dMax threshold for the short pairings used for descriptor formation (in pixels for keypoint + scale 1). + @param dMin threshold for the long pairings used for orientation determination (in pixels for + keypoint scale 1). + @param indexChange index remapping of the bits. */ + 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()); }; /** @brief Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor diff --git a/modules/features2d/src/brisk.cpp b/modules/features2d/src/brisk.cpp index f67be9fc31..2fcc5a41c5 100644 --- a/modules/features2d/src/brisk.cpp +++ b/modules/features2d/src/brisk.cpp @@ -59,6 +59,10 @@ public: explicit BRISK_Impl(const std::vector &radiusList, const std::vector &numberList, float dMax=5.85f, float dMin=8.2f, const std::vector indexChange=std::vector()); + explicit BRISK_Impl(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()); + virtual ~BRISK_Impl(); int descriptorSize() const @@ -319,6 +323,18 @@ BRISK_Impl::BRISK_Impl(const std::vector &radiusList, octaves = 3; } +BRISK_Impl::BRISK_Impl(int thresh, + int octaves_in, + const std::vector &radiusList, + const std::vector &numberList, + float dMax, float dMin, + const std::vector indexChange) +{ + generateKernel(radiusList, numberList, dMax, dMin, indexChange); + threshold = thresh; + octaves = octaves_in; +} + void BRISK_Impl::generateKernel(const std::vector &radiusList, const std::vector &numberList, @@ -2318,4 +2334,11 @@ Ptr BRISK::create(const std::vector &radiusList, const std::vector return makePtr(radiusList, numberList, dMax, dMin, indexChange); } +Ptr BRISK::create(int thresh, int octaves, const std::vector &radiusList, + const std::vector &numberList, float dMax, float dMin, + const std::vector& indexChange) +{ + return makePtr(thresh, octaves, radiusList, numberList, dMax, dMin, indexChange); +} + }