Merge pull request #3594 from asmorkalov:as/matchLOGOS_bindining_fix

Binding fix for matchLOGOS with python test.
pull/3604/head
Alexander Smorkalov 1 year ago committed by GitHub
commit ab4bfc261b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      modules/xfeatures2d/include/opencv2/xfeatures2d.hpp
  2. 12
      modules/xfeatures2d/misc/python/test/test_descriptors.py

@ -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<KeyPoint>& keypoints1, const std::vector<KeyPoint>& keypoints2,
const std::vector<int>& nn1, const std::vector<int>& nn2,
std::vector<DMatch>& matches1to2);
CV_OUT std::vector<DMatch>& matches1to2);
//! @}

@ -19,6 +19,18 @@ class MSDDetector_test(NewOpenCVTests):
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()

Loading…
Cancel
Save