写一个能在matlab2017b版本运行的orb代码,要求:1 实现图片的特征点提取和匹配 2 显示匹配结果
时间: 2023-02-26 11:52:27 浏览: 54
以下是一段 Matlab 2017b 版本的 orb 代码,实现了图像的特征点提取和匹配,并显示了匹配结果:
```
% 读入两张图像
img1 = imread('图像1.jpg');
img2 = imread('图像2.jpg');
% 特征点提取
points1 = detectORBFeatures(img1);
points2 = detectORBFeatures(img2);
% 特征点描述
[features1, valid_points1] = extractFeatures(img1, points1);
[features2, valid_points2] = extractFeatures(img2, points2);
% 特征点匹配
indexPairs = matchFeatures(features1, features2);
% 显示匹配结果
matchedPoints1 = valid_points1(indexPairs(:, 1), :);
matchedPoints2 = valid_points2(indexPairs(:, 2), :);
figure;
showMatchedFeatures(img1, img2, matchedPoints1, matchedPoints2);
title('特征点匹配结果');
```
注意:上面的代码需要使用 Image Processing Toolbox,请确保已经安装了该工具箱。