Select Keypoints with mouse
Hi all, I have a few Keypoints in a video stream:
vector<cv::KeyPoint> keypoints;
I need to add them to a point list in a specific order:
vector<Point2d> imagePoints;
So my question is.... How can i select a Keypoint with a mouse click, so that i can convert it to the point of my choosing?
I can get the coordinates with a setMouseCallback, but what is the best way to select a keypoint in that region?
thanks!
Probably going throught the vector of keypoints and finding the closest one to the mouse-click coordiantes. Where exactly is the problem?
ok, thanks for your reply. So I store the mouse click, then compare it to the vector list coordinates. Is there a function for finding the nearest one?
Well, not directly, but you could use http://docs.opencv.org/modules/featur... . However, it's not really complicated to do it on your own, it's only one for loop ^^