Skip to content

Commit

Permalink
Merge pull request #3594 from asmorkalov:as/matchLOGOS_bindining_fix
Browse files Browse the repository at this point in the history
Binding fix for matchLOGOS with python test.
  • Loading branch information
asmorkalov authored Dec 15, 2023
2 parents 0bcbc73 + daded36 commit ab4bfc2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/xfeatures2d/include/opencv2/xfeatures2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

//! @}

Expand Down
12 changes: 12 additions & 0 deletions modules/xfeatures2d/misc/python/test/test_descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit ab4bfc2

Please sign in to comment.