Trying to get a descriptor for a predefined point using python opencv3. The goal is to provide a set of points for a given image and get their corresponding feature descriptors. I'm open to using SIFT, SURF, Brief, ORB, and basically any descriptor. However, I do not want to use any of the detection methods provided. I have created the following:
feat_object = cv2.xfeatures2d.BriefDescriptorExtractor_create()
# define keypoint for a single 2d point
pt = cv2.KeyPoint(point[0,0],point[1,0], 10)
# create feature descriptor
out = feat_object.compute(frame, pt)
However, I get the following error.
----> out = feat_object.compute(frame, pt)
SystemError: error return without exception set
Any suggestions?
Ok, resolving the matter ended up being simple. The correct code snippet looks like the following:
feat_object = cv2.xfeatures2d.BriefDescriptorExtractor_create()
pt = [cv2.KeyPoint(point[0,0],point[1,0], 10)]
out = feat_object.compute(frame, pt)
with frame defined as a grayscale image and pt being a list of keypoints. So even if you only want to process a single keypoint, you still are required to pass it in as a list.
I've only tested this out in opencv2.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.