Matlab实现sift特征检测+图像拼接共有12个m文件,其中main为主程序,点击运行即可。
一.部分代码示例: clear clc; im1=imread(test3.png ); im2=imread(test4.png ); gray1=img2gray(im1; gray2=img2gray(im2; [des1,LOC1]=sift(gray1); [des2,loc2]=sift(gray2); 图形; drawpoints(im1,loc1,im2,loc2); Num=3; Thresh=0.85; match=featurematch(des1,des2,Num,Thresh ); lo C1=lo C1 (match (:1 ), ); loc2=loc2(match (:2 ), ); 图形; linepoints(im1,loc1,im2,loc2); AGL=getrotagl(LOC1,loc2); 图形; drawrotaglhist(agl; opt=optindex(agl ); LOC1=LOC1(opt, ); loc2=loc2(opt, ); 图形; linepoints(im1,loc1,im2,loc2); t=gettransmat(gray1,loc1,gray2,loc2); im=imregist(im1,im2,t ); 图形; imshow(im );全部详细代码见资源:Matlab实现sift特征检测+图像拼接源码
二.运行结果1.对两幅图进行特征点检测:
2.全部对应点的匹配情况:
3.经过筛选后能作为图像配准控制点的SIFT匹配特征点连接:
4.图像拼接结果:
5.原图:
博主destiny0321