clear all; close all; home;
% User selection (1,2,3,…)
J = 6; % number of decomposition levels used in the fusion[Faf,Fsf] = FSfarras; % first stage filters
[af,sf] = dualfilt1; % second stage filters% images to be fused
im1 = double(imread(‘saras91.jpg’));
im2 = double(imread(‘saras92.jpg’));
figure; subplot(121);imshow(im1,[]); subplot(122); imshow(im2,[]);% image decomposition
w1 = cplxdual2D(im1,J,Faf,af);
w2 = cplxdual2D(im2,J,Faf,af);% Image fusion process start here
for j=1:J % number of stages
for p=1:2 %1:real part & 2: imaginary part
for d1=1:2 % orientations
for d2=1:3
x = w1{j}{p}{d1}{d2};
y = w2{j}{p}{d1}{d2};
D = (abs(x)-abs(y)) >= 0;
wf{j}{p}{d1}{d2} = D.*x + (~D).y; % image fusion
end
end
end
end
for m=1:2 % lowpass subbands
for n=1:2
wf{J+1}{m}{n} = 0.5(w1{J+1}{m}{n}+w2{J+1}{m}{n}); % fusion of lopass subbands
end
end% fused image
imf = icplxdual2D(wf,J,Fsf,sf);
figure; imshow(imf,[]);
function [af, sf] = dualfilt1% Kingsbury Q-filters for the dual-tree complex DWT
%
% USAGE:
% [af, sf] = dualfilt1
% OUTPUT:
% af{i}, i = 1,2 - analysis filters for tree i
% sf{i}, i = 1,2 - synthesis filters for tree i
% note: af{2} is the reverse of af{1}
% REFERENCE:
% N. G. Kingsbury, “A dual-tree complex wavelet
% transform with improved orthogonality and symmetry
% properties”, Proceedings of the IEEE Int. Conf. on
% Image Proc. (ICIP), 2000
% See dualtree
%
% WAVELET SOFTWARE AT POLYTECHNIC UNIVERSITY, BROOKLYN, NY
% http://taco.poly.edu/WaveletSoftware/% These cofficients are rounded to 8 decimal places.
af{1} = [
0.03516384000000 0
0 0
-0.08832942000000 -0.11430184000000
0.23389032000000 0
0.76027237000000 0.58751830000000
0.58751830000000 -0.76027237000000
0 0.23389032000000
-0.11430184000000 0.08832942000000
0 0
0 -0.03516384000000
];af{2} = [
0 -0.03516384000000
0 0
-0.11430184000000 0.08832942000000
0 0.23389032000000
0.58751830000000 -0.76027237000000
0.76027237000000 0.58751830000000
0.23389032000000 0
-0.08832942000000 -0.11430184000000
0 0
0.03516384000000 0
];sf{1} = af{1}(end👎1, 😃;
sf{2} = af{2}(end👎1, 😃;