MATLAB ,选取点特征作为配准基元;使用 SIFT 算法对两幅距离图像提取特征点 进行匹配
时间: 2024-05-22 20:14:45 浏览: 90
sift-matlab.rar_SIFT 图像_sift_sift matlab 20_图像 sift_特征点提取
以下是MATLAB代码示例:
% 读入两幅距离图像
image1 = imread('image1.jpg');
image2 = imread('image2.jpg');
% 提取SIFT特征点和描述符
points1 = detectSURFFeatures(rgb2gray(image1));
[features1, validPoints1] = extractFeatures(rgb2gray(image1), points1);
points2 = detectSURFFeatures(rgb2gray(image2));
[features2, validPoints2] = extractFeatures(rgb2gray(image2), points2);
% 进行特征点匹配
indexPairs = matchFeatures(features1, features2);
% 选取点特征作为配准基元
matchedPoints1 = validPoints1(indexPairs(:,1));
matchedPoints2 = validPoints2(indexPairs(:,2));
% 显示匹配结果
figure;
showMatchedFeatures(image1,image2,matchedPoints1,matchedPoints2);
legend('Image 1','Image 2');
阅读全文