Draw the strongest SIFT points on an image
Show older comments
Hello, I am working on an app, where I'm trying to visualize matching features of two images. Using showMatchedFeatures() I can get something like this:

However, if I use SIFT I would also like to visualize the strongest points on those two images. As stated in the documentation for visualizing strongest points on one image we can do something like this:

What would be the easiest way of implementing this alongside showMatchedFeatures() function. The simplest solution which comes to my mind would contain these steps: rewrite image matrieces by drawing these objects on them, before passing them to showMatchedFeatures() function -> pass these new images. Is there some way how to replace the plot() function from an example with somthing which will draw objects on our two original images?
Thank you.
Answers (1)
yes,sir,may be use it directly,such as
I1 = rgb2gray(imread('parkinglot_left.png'));
I2 = rgb2gray(imread('parkinglot_right.png'));
points1 = detectSIFTFeatures(I1);
points2 = detectSIFTFeatures(I2);
[f1, vpts1] = extractFeatures(I1, points1);
[f2, vpts2] = extractFeatures(I2, points2);
indexPairs = matchFeatures(f1, f2) ;
matchedPoints1 = vpts1(indexPairs(1:20, 1));
matchedPoints2 = vpts2(indexPairs(1:20, 2));
figure; ax = axes;
showMatchedFeatures(I1,I2,matchedPoints1,matchedPoints2,'montage','Parent',ax);
title(ax, 'Candidate point matches');
legend(ax, 'Matched points 1','Matched points 2');
2 Comments
Samuel G.
on 22 Feb 2022
yes,sir,may be use insertObjectAnnotation to add points on image,such as
I1 = rgb2gray(imread('parkinglot_left.png'));
I2 = rgb2gray(imread('parkinglot_right.png'));
points1 = detectSIFTFeatures(I1);
points2 = detectSIFTFeatures(I2);
[f1, vpts1] = extractFeatures(I1, points1);
[f2, vpts2] = extractFeatures(I2, points2);
indexPairs = matchFeatures(f1, f2) ;
matchedPoints1 = vpts1(indexPairs(1:20, 1));
matchedPoints2 = vpts2(indexPairs(1:20, 2));
strongest1 = points1.selectStrongest(10)
I1 = insertMarker(I1,strongest1.Location,'star','Size',12);
figure; imshow(I1,[]);
strongest2 = points2.selectStrongest(10)
I2 = insertMarker(I2,strongest2.Location,'star','Size',12);
figure; imshow(I2,[]);
figure; ax = axes;
showMatchedFeatures(I1,I2,matchedPoints1,matchedPoints2,'montage','Parent',ax);
title(ax, 'Candidate point matches');
legend(ax, 'Matched points 1','Matched points 2');
Categories
Find more on SIFT - Scale Invariant Feature Transform in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


