失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > SURF特征提取(使用matlab自带函数)

SURF特征提取(使用matlab自带函数)

时间:2021-02-16 23:31:22

相关推荐

SURF特征提取(使用matlab自带函数)

用matlab自带函数showMatchedFeatures中给的示例进行SURF特征提取匹配,显示出匹配结果图片

用points1是n×1的SURFpoints数组,f1是一个n×64的矩阵(n是特征点个数,64是SURF描述子的维度),vpts1是n×1的SURFpoints数组,indexPairs是m×2的矩阵(m是匹配对数,第一列是图1的,第二列图2的)

I1 = imread('cameraman.tif');I2 = imresize(imrotate(I1,-20), 1.2);points1 = detectSURFFeatures(I1);points2 = detectSURFFeatures(I2);[f1, vpts1] = extractFeatures(I1, points1);[f2, vpts2] = extractFeatures(I2, points2);indexPairs = matchFeatures(f1, f2) ;matchedPoints1 = vpts1(indexPairs(:, 1));matchedPoints2 = vpts2(indexPairs(:, 2));% Visualize putative matches% figure; showMatchedFeatures(I1,I2,matchedPoints1,matchedPoints2);%一张图中显示figure; showMatchedFeatures(I1,I2,matchedPoints1,matchedPoints2,'montage');%两张图中显示title('Putative point matches');legend('matchedPts1','matchedPts2');

结果

用自己的图片替换

I1_rgb = imread('F:\stitching\imagess\theater_01.jpg');I2_rgb = imread('F:\stitching\imagess\theater_02.jpg');I1 = rgb2gray(I1_rgb);I2 = rgb2gray(I2_rgb);points1 = detectSURFFeatures(I1);points2 = detectSURFFeatures(I2);[f1, vpts1] = extractFeatures(I1, points1);[f2, vpts2] = extractFeatures(I2, points2); indexPairs = matchFeatures(f1, f2) ;matchedPoints1 = vpts1(indexPairs(:, 1));matchedPoints2 = vpts2(indexPairs(:, 2));% Visualize putative matchesfigure; showMatchedFeatures(I1_rgb,I2_rgb,matchedPoints1,matchedPoints2,'montage');title('Putative point matches');legend('matchedPts1','matchedPts2');

结果

如果觉得《SURF特征提取(使用matlab自带函数)》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。