You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not able to access the public attribute of 'keypoints' which is clearly stated in the OpenCV documentation [https://docs.opencv.org/3.4/d4/db5/structcv_1_1detail_1_1ImageFeatures.html#a1defd2a583122cb6360ab12c6333212b], as well as the opencv2/opencv2/stitching/detail/matchers.hpp file. This is sort of a continuation of the inaccessible public attribute of 'descriptors' but I managed to worked around it by producing the object of the same class from the method cv.detail.computeImageFeatures2(finder_algorithm, image). I am one step away from completing my project but it seems to me that the incompletion of this particular class is proving to be a huge hindrance to optimising the sticher class by OpenCV :(
Aim: Obtaining keypoints and descriptors from another algorithm, packing them, and overwriting the attribute values in the class.
I know there is a similar issue #16371, but the owner was trying to find out why the same public attribute 'keypoints' is not working :(
I appreciate all and any help with this. Thank you for you time.
We are now able to set and get the keypoints in the class of cv2.detail.ImageFeatures. This will now allow us to utilise various feature finding algorithms such as GeoDesc to be incorporated into the Stitcher class made by OpenCV (similar to Lowe's implementation).
Here is the code block:
finder = cv.ORB.create()
img = cv.imread('Images/arena_fetch.jpg', 0)
feat = cv.detail.computeImageFeatures2(finder, img)
print(feat.descriptors.get())
print(feat.keypoints[0].angle)
print()
finder = cv.SIFT_create()
kps, des = finder.detectAndCompute(img, None)
umat = cv.UMat(des)
feat.descriptors = umat
feat.keypoints = kps
print(feat.descriptors.get())
print(feat.keypoints[0].angle)
Detailed description
I am not able to access the public attribute of 'keypoints' which is clearly stated in the OpenCV documentation [https://docs.opencv.org/3.4/d4/db5/structcv_1_1detail_1_1ImageFeatures.html#a1defd2a583122cb6360ab12c6333212b], as well as the opencv2/opencv2/stitching/detail/matchers.hpp file. This is sort of a continuation of the inaccessible public attribute of 'descriptors' but I managed to worked around it by producing the object of the same class from the method cv.detail.computeImageFeatures2(finder_algorithm, image). I am one step away from completing my project but it seems to me that the incompletion of this particular class is proving to be a huge hindrance to optimising the sticher class by OpenCV :(
Aim: Obtaining keypoints and descriptors from another algorithm, packing them, and overwriting the attribute values in the class.
I know there is a similar issue #16371, but the owner was trying to find out why the same public attribute 'keypoints' is not working :(
I appreciate all and any help with this. Thank you for you time.
Steps to reproduce
Here is the output
Here is code block in matchers.hpp:
Here is the output for dir(feat):
Issue submission checklist
forum.opencv.org, Stack Overflow, etc and have not found solution
UPDATED (Resolved)
We are now able to set and get the keypoints in the class of cv2.detail.ImageFeatures. This will now allow us to utilise various feature finding algorithms such as GeoDesc to be incorporated into the Stitcher class made by OpenCV (similar to Lowe's implementation).
Here is the code block:
Here is the output:
Here is the output for dir(feat):