1 简介
2 部分代码
function varargout = gui(varargin)
% GUI M-file for gui.fig
% GUI, by itself, creates a new GUI or raises the existing
% singleton*.
%
% H = GUI returns the handle to a new GUI or the handle to
% the existing singleton*.
%
% GUI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUI.M with the given input arguments.
%
% GUI('Property','Value',...) creates a new GUI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before gui_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to gui_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 gui
% Last Modified by GUIDE v2.5 27-May-2011 17:39:18
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @gui_OpeningFcn, ...
'gui_OutputFcn', @gui_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 gui is made visible.
function gui_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 gui (see VARARGIN)
% Choose default command line output for gui
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes gui wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = gui_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)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --------------------------------------------------------------------
function Open_Callback(hObject, eventdata, handles)
[name,path]=uigetfile( ...
{'*.jpg;*.tif;*.png;*.gif;*.bmp','All Image Files';...
'*.*','All Files' },...
'请选择要融合的低分辨率图片');
fullpath=strcat(path,name);
[name2,path2]=uigetfile( ...
{'*.jpg;*.tif;*.png;*.gif;*.bmp','All Image Files';...
'*.*','All Files' },...
'请选择要融合的高分辨率图片(');
fullpath2=strcat(path2,name2);
save path.mat fullpath fullpath2
% hObject handle to Open (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes during object creation, after setting all properties.
function axes1_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate axes1
% --- Executes on button press in add_fu_button.
function add_fu_button_Callback(hObject, eventdata, handles)
axes(handles.axes1);
cla;
axes(handles.axes2);
cla;
axes(handles.axes3);
cla;
a=get(handles.radiobutton5,'value');
b=get(handles.radiobutton6,'value');
c=get(handles.radiobutton7,'value');
if a==1
load path.mat
axes(handles.axes1);
low=imread(fullpath);
imshow(low);
axes(handles.axes2);
high=imread(fullpath2);
imshow(high);
addfusion;
load image.mat
axes(handles.axes3);
imshow(fusionresult);
%
end
if b==1
load path.mat
axes(handles.axes1);
low=imread(fullpath);
imshow(low);
axes(handles.axes2);
high=imread(fullpath2);
imshow(high);
sel_h_fusion;
load image.mat
axes(handles.axes3);
imshow(fusionresult);
%
end
if c==1
load path.mat
axes(handles.axes1);
low=imread(fullpath);
imshow(low);
axes(handles.axes2);
high=imread(fullpath2);
imshow(high);
sel_l_fusion;
load image.mat
axes(handles.axes3);
imshow(fusionresult);
%
end
%axes(handles.axes4);
%cla;
%load path.mat
%axes(handles.axes1);
%low=imread(fullpath);
%imshow(low);
%axes(handles.axes2);
%high=imread(fullpath2);
%imshow(high);
%addfusion;
%load image.mat
%axes(handles.axes3);
%imshow(fusionresult);
% hObject handle to add_fu_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pretreat_button.
function pretreat_button_Callback(hObject, eventdata, handles)
load path.mat
axes(handles.axes4);
low=imread(fullpath);
imshow(low);
axes(handles.axes5);
high=imread(fullpath2);
imshow(high);
pretreat;
load image.mat
NbColors=255;
map=gray(NbColors);
axes(handles.axes6);
image(pretreat_result_low);
colormap(map);
axes(handles.axes7);
image(pretreat_result_high);
colormap(map);
% hObject handle to pretreat_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in gauss_button1.
function gauss_button1_Callback(hObject, eventdata, handles)
axes(handles.axes4);
cla;
axes(handles.axes5);
cla;
axes(handles.axes6);
cla;
axes(handles.axes7);
cla;
gauss;
load image.mat
NbColors=255;
map=gray(NbColors);
axes(handles.axes4);
image(g0l);
colormap(map);
axes(handles.axes5);
image(g1l);
colormap(map);
axes(handles.axes6);
image(g2l);
colormap(map);
axes(handles.axes7);
image(g3l);
colormap(map);
% hObject handle to gauss_button1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in gauss_button2.
function gauss_button2_Callback(hObject, eventdata, handles)
axes(handles.axes4);
cla;
axes(handles.axes5);
cla;
axes(handles.axes6);
cla;
axes(handles.axes7);
cla;
%gauss;
load image.mat
NbColors=255;
map=gray(NbColors);
axes(handles.axes4);
image(g0h);
colormap(map);
axes(handles.axes5);
image(g1h);
colormap(map);
axes(handles.axes6);
image(g22h);
colormap(map);
axes(handles.axes7);
image(g3h);
colormap(map);
% hObject handle to gauss_button2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in lap_button1.
function lap_button1_Callback(hObject, eventdata, handles)
axes(handles.axes4);
cla;
axes(handles.axes5);
cla;
axes(handles.axes6);
cla;
axes(handles.axes7);
cla;
lap
load image.mat
NbColors=255;
map=gray(NbColors);
axes(handles.axes4);
image(lp0l);
colormap(map);
axes(handles.axes5);
image(lp1l);
colormap(map);
axes(handles.axes6);
image(lp2l);
colormap(map);
axes(handles.axes7);
image(lp3l);
colormap(map);
% hObject handle to lap_button1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in lap_button2.
function lap_button2_Callback(hObject, eventdata, handles)
axes(handles.axes4);
cla;
axes(handles.axes5);
cla;
axes(handles.axes6);
cla;
axes(handles.axes7);
cla;
%lap
load image.mat
NbColors=255;
map=gray(NbColors);
axes(handles.axes4);
image(lp0h);
colormap(map);
axes(handles.axes5);
image(lp1h);
colormap(map);
axes(handles.axes6);
image(lp2h);
colormap(map);
axes(handles.axes7);
image(lp3h);
colormap(map);
% hObject handle to lap_button2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in fu_button.
function fu_button_Callback(hObject, eventdata, handles)
axes(handles.axes4);
cla;
axes(handles.axes5);
cla;
axes(handles.axes6);
cla;
axes(handles.axes7);
cla;
fusion
load image.mat
NbColors=255;
map=gray(NbColors);
axes(handles.axes4);
image(fu0);
colormap(map);
axes(handles.axes5);
image(fu1);
colormap(map);
axes(handles.axes6);
image(fu2);
colormap(map);
axes(handles.axes7);
image(fu3);
colormap(map);
% hObject handle to fu_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in refactory_button.
function refactory_button_Callback(hObject, eventdata, handles)
axes(handles.axes4);
cla;
axes(handles.axes5);
cla;
axes(handles.axes6);
cla;
axes(handles.axes7);
cla;
refactory
load image.mat
NbColors=255;
map=gray(NbColors);
axes(handles.axes4);
image(output);
colormap(map);
% hObject handle to refactory_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
3 仿真结果
4 参考文献
[1]李俊峰. 基于像素级的图像融合方法研究[D]. 南昌航空大学, 2008.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。