【图像配准】基于SIFT实现图像配准拼接含Matlab源码
【图像配准】基于SIFT实现图像配准拼接含Matlab源码
TT_Matlab
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,完整matlab代码或者程序定制加qq1575304183。
1 简介
2 部分代码
function varargout = OpenImage(varargin)
% OPENIMAGE MATLAB code
for
OpenImage.fig
% OPENIMAGE, by itself, creates a new OPENIMAGE
or
raises the existing
% singleton*.
%
% H = OPENIMAGE returns the handle to a new OPENIMAGE
or
the handle to
% the existing singleton*.
%
% OPENIMAGE(
’CALLBACK’
,hObject,eventData,handles,...) calls the local
% function named CALLBACK
in
OPENIMAGE.M with the given input arguments.
%
% OPENIMAGE(
’Property’
,
’Value’
,...) creates a new OPENIMAGE
or
raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before OpenImage_OpeningFcn gets called. An
% unrecognized property name
or
invalid value makes property application
% stop. All inputs are passed to OpenImage_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE
’s Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help OpenImage
% Last Modified by GUIDE v2.5 04-Jul-2016 15:53:58
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(’
gui_Name
’, mfilename, ...
’
gui_Singleton
’, gui_Singleton, ...
’
gui_OpeningFcn
’, @OpenImage_OpeningFcn, ...
’
gui_OutputFcn
’, @OpenImage_OutputFcn, ...
’
gui_LayoutFcn
’, [] , ...
’
gui_Callback
’, []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before OpenImage is made visible.
function OpenImage_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to OpenImage (see VARARGIN)
% Choose default command line output for OpenImage
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes OpenImage wait for user response (see UIRESUME)
% uiwait(handles.figure1);
initital_dir=pwd;
FileInformation=load_listbox(initital_dir,handles);
handles.FileInformation=FileInformation;
guidata(handles.figure1,handles);
uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = OpenImage_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Image_I;
% Get default command line output from handles structure
if isstruct(handles)==1
varargout{1} = handles.output;
Image_I.flag = 0;
else %区分是否选择图片
varargout{1} = 0;
Image_I.flag = 1;
end
% --- Executes on selection change in listbox1.
function listbox1_Callback(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,’
String
’)) returns listbox1 contents as cell array
% contents{get(hObject,’
Value
’)} returns selected item from listbox1
index_selected=get(handles.listbox1,’
Value
’);
filename=handles.FileInformation.sorted_names{index_selected};
handles.FileInformation.filename=[pwd,’
’,filename];
handles.FileInformation.names_disp=handles.FileInformation.sorted_names_disp{index_selected};
handles.FileInformation.imsize=handles.FileInformation.imsize_disp{index_selected};
if index_selected<=handles.FileInformation.cnPiont
cd(handles.FileInformation.filename)
FileInformation=load_listbox(pwd,handles);
handles.FileInformation=FileInformation;
handles.FileInformation.IsImage=0;
else
handles.FileInformation.IsImage=1;
end
global Image_I;
Image_I.figure1 = handles.figure1;
Image_I.FileInformation = handles.FileInformation;
guidata(handles.figure1,handles);
uiresume(handles.figure1);
% --- Executes during object creation, after setting all properties.
function listbox1_CreateFcn(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,’
BackgroundColor
’), get(0,’
defaultUicontrolBackgroundColor
’))
set(hObject,’
BackgroundColor
’,’
white
’);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function FileInformation=load_listbox(dir_path,handles)
cd(dir_path)
dir_struct=dir(dir_path);
[sorted_names1,sorted_index1]=sortrows({dir_struct.name}’
);
k=max(sorted_index1);
if
k==
2
sorted_names{
1
}=
’.’
;
sorted_names{
2
}=
’..’
;
sorted_names_disp{
1
}=
’.’
;
sorted_names_disp{
2
}=
’..’
;
imsize_disp{
1
}=
’null’
;
imsize_disp{
2
}=
’null’
;
cnPiont=
2
;
else
sorted_names{
1
}=
’.’
;
sorted_names{
2
}=
’..’
;
sorted_names_disp{
1
}=
’.’
;
sorted_names_disp{
2
}=
’..’
;
imsize_disp{
1
}=
’null’
;
imsize_disp{
2
}=
’null’
;
cn=
2
;
%%%
%%%
%%%
%%%
%%查找文件夹
for i=1:k
[path,name,ext]=fileparts(sorted_names1{i});
switch ext
case ’’
cn=cn+1;
cnarray(cn)=cn;
sorted_names{cn}=name;
sorted_names_disp{cn}=name;
imsize_disp{cn}=’null’;
end
end
cnPiont=cn;
%
%%%
%%%
%%%
%%%
%%%
%查找图片文件
for
i=
1
:k
[path,name,ext]=fileparts(sorted_names1{i});
switch ext
case
{
’.bmp’
,
’.jpg’
,
’.jpeg’
,
’.tif’
,
’.png’
,
’.gif’
}
cn=cn+
1
;
cnarray(cn)=cn;
name=[name,ext];
sorted_names{cn}=name;
temp=imread(name);
[m,n]=size(temp);
m=num2str(m);
n=num2str(n);
imsize=[
’ ’
,m,
’*’
,n];
name_disp=[name,imsize];
sorted_names_disp{cn}=name_disp;
imsize_disp{cn}=imsize;
end
end
end
FileInformation.sorted_names=sorted_names;
FileInformation.sorted_names_disp=sorted_names_disp;
FileInformation.imsize_disp=imsize_disp;
FileInformation.cnPiont=cnPiont;
set(handles.listbox1,
’String’
,sorted_names_disp,...
’Value’
,
1
);
set(handles.text1,
’String’
,pwd);
3 仿真结果
4 参考文献
[1]袁杰. 基于SIFT的图像配准与拼接技术研究[D]. 南京理工大学.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
-
2023年血糖新标准公布,不是3.9-6.1,快来看看你的血糖正常吗? 2023-02-07
-
2023年各省最新电价一览!8省中午执行谷段电价! 2023-01-03
-
GB 55009-2021《燃气工程项目规范》(含条文说明),2022年1月1日起实施 2021-11-07
-
PPT导出高分辨率图片的四种方法 2022-09-22
-
2023年最新!国家电网27家省级电力公司负责人大盘点 2023-03-14
-
全国消防救援总队主官及简历(2023.2) 2023-02-10
-
盘点 l 中国石油大庆油田现任领导班子 2023-02-28
-
我们的前辈!历届全国工程勘察设计大师完整名单! 2022-11-18
-
关于某送变电公司“4·22”人身死亡事故的快报 2022-04-26
