def orb_features(image, keypoints):
if isinstance(keypoints, np.ndarray):
# takes in x, y coordinates. size is the diameter of the descripted area
keypoints = [cv2.KeyPoint(p[0], p[1], ORB_DESCRIPTOR_SIZE) for p in keypoints]
orb = cv2.ORB_create()
new_keypoints, descriptors = orb.compute(np.mean(image, axis=2).astype(np.uint8), keypoints)
print('len(keypoints)', len(keypoints))
print('len(new_keypoints)', len(new_keypoints))
return new_keypoints, descriptors
评论列表
文章目录