I have 3 images and want to detect and extract SURF features that are common in all images, i know SURF detect features from 2 images at a time, I have made a pairs of 2 images like (2nd,1st)images and (2nd,3rd)images, but the surf gives me different index location for each image pairs how can i find indexes of those features that are common in all images, or the features that are common in all 3 images.
sample code is below what i tried
I don't understand what to do next? Any help or clue will be beneficial... Thanks
What I have tried:
Points1 = detectSURFFeatures(I1,'MetricThreshold',1000);
Points2 = detectSURFFeatures(I2,'MetricThreshold',1000);
Points3 = detectSURFFeatures(I3,'MetricThreshold',1000);
% Extract Features
[features1, valid_points1] = extractFeatures(I1, Points1);
[features2, valid_points2] = extractFeatures(I2, Points2);
[features3, valid_points3] = extractFeatures(I3, Points3);
% MatchFeatures
[indexPairs1, matchmetric1] = matchFeatures(features1, features2);
[indexPairs3, matchmetric3] = matchFeatures(features2, features3);
% Validate points
matched_pts1 = valid_points1(indexPairs1(:, 1));
matched_pts2 = valid_points2(indexPairs1(:, 2));
matched_pts5 = valid_points2(indexPairs3(:, 1));
matched_pts6 = valid_points3(indexPairs3(:, 2));
% Remove Outlies
[fLMedS1, inliers1] = estimateFundamentalMatrix(matched_pts1,matched_pts2, 'NumTrials', 2000);
[fLMedS3, inliers3] = estimateFundamentalMatrix(matched_pts5,matched_pts6, 'NumTrials', 2000);
Temp1 = indexPairs1;
Temp1(~inliers1,: ) = [];
Temp2 = indexPairs3;
Temp2(~inliers3,: ) = [];