1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge pull request #21803 from oguzhanguclu:matches_info_pybinding

python binding for matches and inliers_mask attributes of cv2.detail_MatchesInfo class

* making matches and inliers_mask attributes of cv2.detail_MatchesInfo class accessible from python interface

* binding test for cv2.detail_MatchesInfo class
This commit is contained in:
Oguzhan Guclu
2022-04-02 01:13:14 +03:00
committed by GitHub
parent a233982931
commit 38788a3161
2 changed files with 19 additions and 2 deletions
@@ -118,5 +118,22 @@ class stitching_compose_panorama_args(NewOpenCVTests):
assert result == 0
class stitching_matches_info_test(NewOpenCVTests):
def test_simple(self):
finder = cv.ORB.create()
img1 = self.get_sample('stitching/a1.png')
img2 = self.get_sample('stitching/a2.png')
img_feat1 = cv.detail.computeImageFeatures2(finder, img1)
img_feat2 = cv.detail.computeImageFeatures2(finder, img2)
matcher = cv.detail.BestOf2NearestMatcher_create()
matches_info = matcher.apply(img_feat1, img_feat2)
self.assertIsNotNone(matches_info.matches)
self.assertIsNotNone(matches_info.inliers_mask)
if __name__ == '__main__':
NewOpenCVTests.bootstrap()