12 """Get sift keypoints from image 16 Input image of shape ``(M, N)`` from which we get sift keypoints 21 each row has [col, row, orientation, scale] in this order 24 descriptors of each frame 26 if type(img)
is not np.ndarray:
28 if len(img.shape) != 2:
29 raise ValueError(
'image should be 2d array: {}'.format(img.shape))
30 siftimg = siftfastpy.Image(img.shape[1], img.shape[0])
32 frames, desc = siftfastpy.GetKeypoints(siftimg)
43 each row has [col, row, orientation, scale] in this order 45 if len(img.shape) > 2:
46 raise ValueError(
'input image should be gray-scale')
50 col, row, ori, scale = frame
51 angle = ori / math.pi * 180
52 kp = cv2.KeyPoint(x=col, y=row, _size=scale, _angle=angle)
54 dst = cv2.drawKeypoints(img, keypoints,
55 flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)
def draw_sift_frames(img, frames)
def get_sift_keypoints(img)