Multiple Image Matching using SURF detectors
Show older comments
I want to compare (features) 300 images with other 300 images using SURF detectors.
With the program below, I'm facing a problem. With the 1st folder, all images are matching with only 1 image of 2nd folder.
But I want to match all 300 images with 300 images.
Can anyone help ?
path_directory_1 = 'fall';
original_files_1 = dir([path_directory_1 '/*.png']);
path_directory_2 = 'winter';
original_files_2 = dir([path_directory_2 '/*.png']);
for i = 1:length(original_files_1)
filename = ([path_directory_1 '/' original_files_1(i).name]);
I1 = rgb2gray(imread(filename))
points1 = detectSURFFeatures(I1)
[f1,vpts1] = extractFeatures(I1, points1)
for j = 1:length(original_files_2)
filename = ([path_directory_2 '/' original_files_2(j).name]);
I2 = rgb2gray(imread(filename))
points2 = detectSURFFeatures(I2)
[f2,vpts2] = extractFeatures(I2, points2)
end
indexPairs = matchFeatures(f1,f2)
matchedPoints1 = vpts1(indexPairs(:,1))
matchedPoints2 = vpts2(indexPairs(:,2))
figure; ax = axes;
showMatchedFeatures(I1, I2, matchedPoints1, matchedPoints2,'montage','Parent',ax);
legend(ax,'matchedPoints1','matchedPoints2');
end
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB Support Package for USB Webcams in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!