您现在的位置:首页 >> 图像处理 >> 内容

基于SIFT特征提取的图像特征提取配准和拼接matlab仿真

时间:2023/1/1 19:31:03 点击:

  核心提示:A170,包括程序操作录像...

1.完整项目描述和程序获取

>面包多安全交易平台:https://mbd.pub/o/bread/Y52bmZ9y

>如果链接失效,可以直接打开本站店铺搜索相关店铺:

点击店铺

>如果链接失效,程序调试报错或者项目合作可以加微信或者QQ联系。

2.部分仿真图预览



3.算法概述

       SIFT 是一种从图像中提取独特不变特征的方法,其特点为基于图像的一些局部特征,而与图像整体的大小和旋转无关。并且该方法对于光照、噪声、仿射变换具有一定鲁棒性,同时能生成大量的特征点。SIFT (Scale-invariant feature transform), 尺度不变特征转换,是一种图像局部特征提取算法,它通过在不同的尺度空间中寻找极值点(特征点,关键点)的精确定位和主方向,构建关键点描述符来提取特征。

4.部分源码

function [matchLoc1 matchLoc2] = siftMatch(img1, img2)

[des1, loc1] = sift(img1);

[des2, loc2] = sift(img2);

distRatio = 0.6;   

% For each descriptor in the first image, select its match to second image.

des2t = des2';                          % Precompute matrix transpose

matchTable = zeros(1,size(des1,1));

for i = 1 : size(des1,1)

   dotprods = des1(i,:) * des2t;        % Computes vector of dot products

   [vals,indx] = sort(acos(dotprods));  % Take inverse cosine and sort results

 

   % Check if nearest neighbor has angle less than distRatio times 2nd.

   if (vals(1) < distRatio * vals(2))

      matchTable(i) = indx(1);

   else

      matchTable(i) = 0;

   end

end

img3 = appendimages(img1,img2);

% Show a figure with lines joining the accepted matches.

figure('Position', [100 100 size(img3,2) size(img3,1)]);

colormap('gray');

imagesc(img3);

hold on;

cols1 = size(img1,2);

for i = 1: size(des1,1)

  if (matchTable(i) > 0)

    line([loc1(i,2) loc2(matchTable(i),2)+cols1], ...

         [loc1(i,1) loc2(matchTable(i),1)], 'Color', 'c');

  end

end

hold off;

num = sum(matchTable > 0);

fprintf('Found %d matches.\n', num);

 

idx1 = find(matchTable);

idx2 = matchTable(idx1);

x1 = loc1(idx1,2);

x2 = loc2(idx2,2);

y1 = loc1(idx1,1);

y2 = loc2(idx2,1);

matchLoc1 = [x1,y1];

matchLoc2 = [x2,y2];

end

A170

作者:我爱C编程 来源:我爱C编程
本站最新成功开发工程项目案例
相关评论
发表我的评论
  • 大名:
  • 内容:
本类固顶
  • 没有
  • FPGA/MATLAB商业/科研类项目合作(www.store718.com) © 2025 版权所有 All Rights Reserved.
  • Email:1480526168@qq.com 站长QQ: 1480526168