Merge pull request #21180 from tezz-io:4.x
authorTejas M R <52408360+tezz-io@users.noreply.github.com>
Sun, 5 Dec 2021 12:47:44 +0000 (18:17 +0530)
committerGitHub <noreply@github.com>
Sun, 5 Dec 2021 12:47:44 +0000 (12:47 +0000)
Added CV_PROP_RW macro to keypoints

* Added CV_PROP_RW macro to keypoints

As outlined in the feature request in the issue https://github.com/opencv/opencv/issues/21171 : the keypoints field has been made parsable by the bindings.

* Added test for keypoints

Added test to check if the CV_PROP_RW macro added in the previous commit makes keypoints public and accessible through the python API.

modules/stitching/include/opencv2/stitching/detail/matchers.hpp
modules/stitching/misc/python/test/test_stitching.py

index ef4684f..cd9749c 100644 (file)
@@ -59,7 +59,7 @@ struct CV_EXPORTS_W_SIMPLE ImageFeatures
 {
     CV_PROP_RW int img_idx;
     CV_PROP_RW Size img_size;
-    std::vector<KeyPoint> keypoints;
+    CV_PROP_RW std::vector<KeyPoint> keypoints;
     CV_PROP_RW UMat descriptors;
     CV_WRAP std::vector<KeyPoint> getKeypoints() { return keypoints; };
 };
index 719f058..0d66182 100644 (file)
@@ -28,6 +28,9 @@ class stitching_detail_test(NewOpenCVTests):
         imgFea = cv.detail.computeImageFeatures2(finder,img)
         self.assertIsNotNone(imgFea)
 
+        # Added Test for PR #21180
+        self.assertIsNotNone(imgFea.keypoints)
+
         matcher = cv.detail_BestOf2NearestMatcher(False, 0.3)
         self.assertIsNotNone(matcher)
         matcher = cv.detail_AffineBestOf2NearestMatcher(False, False, 0.3)