From daded3663d48802b060bc3f3e58e02a4c745294e Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 17 Nov 2023 12:20:16 +0300 Subject: [PATCH] Binding fix for matchLOGOS with python test, --- modules/xfeatures2d/include/opencv2/xfeatures2d.hpp | 2 +- .../xfeatures2d/misc/python/test/test_descriptors.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp b/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp index cf0980ddf3..3313a38348 100644 --- a/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp +++ b/modules/xfeatures2d/include/opencv2/xfeatures2d.hpp @@ -1269,7 +1269,7 @@ CV_EXPORTS_W void matchGMS(const Size& size1, const Size& size2, const std::vect */ CV_EXPORTS_W void matchLOGOS(const std::vector& keypoints1, const std::vector& keypoints2, const std::vector& nn1, const std::vector& nn2, - std::vector& matches1to2); + CV_OUT std::vector& matches1to2); //! @} diff --git a/modules/xfeatures2d/misc/python/test/test_descriptors.py b/modules/xfeatures2d/misc/python/test/test_descriptors.py index ca8bbcbc02..7e69311c86 100644 --- a/modules/xfeatures2d/misc/python/test/test_descriptors.py +++ b/modules/xfeatures2d/misc/python/test/test_descriptors.py @@ -19,6 +19,18 @@ def test_create(self): img1 = np.zeros((100, 100, 3), dtype=np.uint8) kp1_ = msd.detect(img1, None) +class matchLOGOS_test(NewOpenCVTests): + + def test_basic(self): + + frame = self.get_sample('python/images/baboon.png', cv.IMREAD_COLOR) + detector = cv.AKAZE_create(threshold = 0.003) + + keypoints1, descrs1 = detector.detectAndCompute(frame, None) + keypoints2, descrs2 = detector.detectAndCompute(frame, None) + matches1to2 = cv.xfeatures2d.matchLOGOS(keypoints1, keypoints2, range(len(keypoints1)), range(len(keypoints2))) + self.assertFalse(matches1to2 is None) + if __name__ == '__main__': NewOpenCVTests.bootstrap()