Matching features across three images?
I have three images. I have the storage:
cv::Mat desc1;
cv::Mat desc2;
cv::Mat desc3;
std::vector<cv::KeyPoint> keyPnts1;
std::vector<cv::KeyPoint> keyPnts2;
std::vector<cv::KeyPoint> keyPnts3;
std::vector<cv::DMatch> match12;
std::vector<cv::DMatch> match23;
I detect keypoints on all three, and fill the desc
Mats.
I match 1
and 2
, and fill match12
Now, i need to match the already matched features of image 2 with image 3, so that features are matched across all three images.
How can i do this? thanks!
you can't. feature matching is an operation between exactly 2 images, and their keypoints & descriptors.
any matches between image 1 & 2 are irrelevant for the matches between 2 & 3.
what are you trying to achieve, in general ?
Hi, thanks for getting back to me. I am building a solvePnp-based tracking setup with a stereo camera. I match previous and current frame points, then match current L and R frame points, and triangulate. Then use solvePnp to return camera pose. But, the pose is incorrect, jumping around every frame. I assume this is due to the pnp 'zero' point changing every frame, so i thought matching the points between previous - current and current R would help...
As wrote berak it is not possible but you can match 1 & 2. Then :
1 copy in desc2bis and keyPnts2bis copy only keypoint2 and desc2 match with keypoint1.
2 match 2 and 3 using desc3 and desc2bis
Thank you. Will this actually help me? I think this is a whole different question, but... can I get a smooth result from solvePnp when the points are changing as the camera moves?