1 简介

提出了一种基于小波变换的融合算法,算法针对小波变换后的低频分量和高频分量的不同特点,选用了不同的准则进行融合,通过小波逆变换得到融合图像.实验结果表明,这种算法充分考虑了小波变换的特点和人眼视觉特性,具有增强图像的空间细节能力,融合效果良好.

【图像融合】基于小波变换算法实现图像融合matlab代码_小波变换

【图像融合】基于小波变换算法实现图像融合matlab代码_图像融合_02

【图像融合】基于小波变换算法实现图像融合matlab代码_图像融合_03

【图像融合】基于小波变换算法实现图像融合matlab代码_图像融合_04

2 部分代码

function varargout = MainForm(varargin)
% MAINFORM MATLAB code for MainForm.fig
%     MAINFORM, by itself, creates a new MAINFORM or raises the existing
%     singleton*.
%
%     H = MAINFORM returns the handle to a new MAINFORM or the handle to
%     the existing singleton*.
%
%     MAINFORM('CALLBACK',hObject,eventData,handles,...) calls the local
%     function named CALLBACK in MAINFORM.M with the given input arguments.
%
%     MAINFORM('Property','Value',...) creates a new MAINFORM or raises the
%     existing singleton*. Starting from the left, property value pairs are
%     applied to the GUI before MainForm_OpeningFcn gets called. An
%     unrecognized property name or invalid value makes property application
%     stop. All inputs are passed to MainForm_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 MainForm
% Last Modified by GUIDE v2.5 22-Dec-2013 09:58:50
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
'gui_Singleton',  gui_Singleton, ...
'gui_OpeningFcn', @MainForm_OpeningFcn, ...
'gui_OutputFcn',  @MainForm_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 MainForm is made visible.
function MainForm_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 MainForm (see VARARGIN)
% Choose default command line output for MainForm
handles.output = hObject;
clc;
axes(handles.axes1); cla reset; box on; set(gca, 'XTickLabel', '', 'YTickLabel', '');
axes(handles.axes2); cla reset; box on; set(gca, 'XTickLabel', '', 'YTickLabel', '');
axes(handles.axes3); cla reset; box on; set(gca, 'XTickLabel', '', 'YTickLabel', '');
% Update handles structure
wtype = 'haar';
[c0, s0] = Wave_Decompose(M1, zt, wtype);%对处理过的图像分别进行小波分解,
[c1, s1] = Wave_Decompose(M2, zt, wtype);%对处理过的图像分别进行小波分解,
Coef_Fusion = Fuse_Process(c0, c1, s0, s1);%对低频和高频分量采用不同的融合规则进行融合;
Y = Wave_Reconstruct(Coef_Fusion, s0, wtype);%进行小波逆变换;
handles.result = im2uint8(mat2gray(Y));
guidata(hObject, handles);
msgbox('小波融合处理完毕!', '提示信息', 'modal');
filename=inputdlg({'融合图像命名'},'请输入',[1 30],{'.\images\实验图像1\12.jpg'});
imwrite(im2uint8(mat2gray(Y)),char(filename));
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject   handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles   structure with handles and user data (see GUIDATA)
if isempty(handles.result)
msgbox('请进行填充处理!', '提示信息', 'modal');
return;
end
axes(handles.axes3);
imshow(handles.result, []);%显示融合后图

3 仿真结果

【图像融合】基于小波变换算法实现图像融合matlab代码_ide_05

4 参考文献

[1]许开宇, and 李双一. "基于小波变换的图像融合算法的实现." 红外技术 29.8(2007):4.​

【图像融合】基于小波变换算法实现图像融合matlab代码_参考文献_06