matlab 图像点匹配模板代码

close all;clc,clear;

%% image name and read image
%双焦面c2图像 
fileName_c2 = 'G:\大仪器项目\我的工作\data\标定曲线测试\data2\two focal\c2-1\Image1_1.tif';
% 扫描图像
fileName_scan = 'G:\大仪器项目\我的工作\data\标定曲线测试\data2\scan-c2\scan-c2-copy\0_0_0_200_0.tif';

img_c2 = imread(fileName_c2);
img_scan = imread(fileName_scan);
%% find features
img_c2_Points = detectFASTFeatures(img_c2);         
img_scan_Points = detectFASTFeatures(img_scan);

%% image show
figure(1);
imshow(img_c2);
title('100 Feature Points');
hold on;
plot(selectStrongest(img_c2_Points,100));

figure(2);
imshow(img_scan);
title('300 Feature Points');
hold on;
plot(selectStrongest(img_scan_Points, 300));

%% Extract feature descriptor
[img_c2_Features, img_c2_Points] = extractFeatures(img_c2, img_c2_Points);
[img_scan_Features, img_scan_Points] = extractFeatures(img_scan, img_scan_Points);

%% find Putative point matches
Point_Pairs = matchFeatures(img_c2_Features, img_scan_Features);

%% display matched features
matchedImg_c2Points = img_c2_Points(Point_Pairs(:, 1), :);
matchedImg_scanPoints = img_scan_Points(Point_Pairs(:, 2), :);
figure(3);
showMatchedFeatures(img_c2, img_scan, matchedImg_c2Points, matchedImg_scanPoints, 'montage');
title('Putatively Matched Points(Including Outliers)');

 

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值