I'm trying to extract the pixel coordinates from a given cv::KeyPoint
. This class has a variable named pt
of type cv::Point2f
which is simply a tuple containing two floats.
I'm not sure casting the cv::Point2f
to cv::Point2i
works since I cannot find in the docs what are these float numbers representing.
I'm trying to do this in python, but I can't find a proper OpenCV 3 documentation for python neither.
My code:
import cv2
feature_detector = cv2.xfeatures2d.SURF_create()
key_points = feature_detector.detect(img, None)
# this is a list of float tuples e.g. (100.3224, 451.2334)
float_coordinates = list(map(lambda key_point: key_point.pt))
# pixel_coordinates = ?