MATLAB Curvelet-2PCNN图像融合算法


curvelet-2PCNN图像融合算法核心源码 by vincent 
close all;
clear all;
path(path,'PCNN_toolbox/')
path(path,'nsct_toolbox')
path(path,'FusionEvaluation/')
path(path,'fusetool/')
A=double(imread('1.jpg')); 
B=double(imread('2.jpg')); 
%% Parameters for PCNN
Para.iterTimes=200;
Para.link_arrange=3;
Para.alpha_L=0.06931;% 0.06931 Or 1
Para.alpha_Theta=0.2;
Para.beta=3;% 0.2 or 3
Para.vL=1.0;
Para.vTheta=20;
%%
disp('Decompose the image curvelet ...')
yA = fdct_wrapping(A,1,2); 
yB = fdct_wrapping(B,1,2);
n = length(yA);
%% Initialized the coefficients of fused image
Fused=yB;
=========================================
% Lowpass subband
disp('Process in Lowpass subband...')
        ALow1 = yA{1}{1};
        BLow1 = yB{1}{1};
[Abeta,Bbeta] = weighting(ALow1,BLow1);
Fused{1}{1}=Dual_PCNN(ALow1,BLow1,Abeta,Bbeta);
%Fused{2}=fusion_NSCT_SF_PCNN(ALow2,BLow2,Para);
%%
%=============================================
% Bandpass subbands
disp('Process in  Bandpass subbands...')
for l = 2:n
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    for d = 1:length(yA{l})
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        Ahigh = yA{l}{d};
        Bhigh = yB{l}{d};
      [Abeta,Bbeta] = weighting(Ahigh,Bhigh);
 %%       Fused{l}{d} = fusion_NSCT_SF_PCNN(Ahigh,Bhigh,Para);
       
         Fused{l}{d}=Dual_PCNN(Ahigh,Bhigh,Abeta,Bbeta);
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    end
end
disp('High frequecy field process is ended')
%=============================================
disp('Reconstruct the image curvelet ...')
f_im = real(ifdct_wrapping(Fused,1)); 
disp('Reconstruct is ended...')
%%
f_im=f_im/255;
imwrite(f_im ,'6.jpg','jpg');
im2=imread('6.jpg');
im=imread('1.jpg');
im1=imread('2.jpg');
grey_level=256;
Result=zeros(1,2);
Result(1,1)=mutural_information(im,im1,im2,grey_level);
Result(1,2)=edge_association(im,im1,im2);
Result


你可能感兴趣的:(MATLAB Curvelet-2PCNN图像融合算法)