Matching features across three images?

asked 2017-06-26 07:18:04 -0600

antithing gravatar image

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 1and 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!

edit retag flag offensive close merge delete

Comments

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 ?

berak gravatar imageberak ( 2017-06-26 09:13:59 -0600 )edit

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...

antithing gravatar imageantithing ( 2017-06-26 10:17:12 -0600 )edit

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

LBerger gravatar imageLBerger ( 2017-06-26 10:23:04 -0600 )edit

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?

antithing gravatar imageantithing ( 2017-06-26 10:36:41 -0600 )edit