how to extract x,y coordinates from OpenCV "cv2.keypoint" object?
point.pt is a tuple
(x,y)`.
So,
x = point.pt[0]
y = point.pt[1]
or,
(x,y) = point.pt
You can use:
import numpy as np
pts = np.float([key_point.pt for key_point in kp]).reshape(-1, 1, 2)
pts
will be an array
of keypoints.
OpenCV provides a function for this. You can run:
pts = cv2.KeyPoint_convert(kp)