A list,

Image Fusion based on MATLAB GUI Mean + Region method (Fusion index)

Ii. Source code

function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu 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


% --- Executes on selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
val=get(hObject,'value');
global wavelet;
global X Y  ;
global ultimate;
switch val
case 3% Low frequency means, high frequency local variance is the largestif ndims(X)= =3     
        
     else
         [m,n]=size(X);
         zz=zeros(m,n,3);
         zz(:,:,1)=X;
         zz(:,:,2)=X;
         zz(:,:,3)=X;
         X=zz;
     end
     if ndims(Y)= =3
        
     else
        [m,n]=size(Y);
         zzz=zeros(m,n,3);
         zzz(:,:,1)=Y;
         zzz(:,:,2)=Y;
         zzz(:,:,3)=Y;
         Y=zzz;
     end
   X=double(X);
    Xr=X(:,:,1);
    Xg=X(:,:,2);
    Xb=X(:,:,3);
    
     [aA1,aH1,aV1,aD1]=dwt2(Xr,wavelet);
     [aA2,aH2,aV2,aD2]=dwt2(Xg,wavelet);
     [aA3,aH3,aV3,aD3]=dwt2(Xb,wavelet);
    
   Y=double(Y);
    Yr=Y(:,:,1);
    Yg=Y(:,:,2);
    Yb=Y(:,:,3); [bA1,bH1,bV1,bD1]=dwt2(Yr,wavelet); [bA2,bH2,bV2,bD2]=dwt2(Yg,wavelet); [bA3,bH3,bV3,bD3]=dwt2(Yb,wavelet); newA1=zeros(size(aA1)); newA2=zeros(size(aA2)); newA3=zeros(size(aA3)); newH1=zeros(size(aH1)); newV1=zeros(size(aV1)); newD1=zeros(size(aD1)); newH2=zeros(size(aH2)); newV2=zeros(size(aV2)); newD2=zeros(size(aD2)); newH3=zeros(size(aH3)); newV3=zeros(size(aV3)); newD3=zeros(size(aD3)); % low frequency fusion rule [m,n]=size(aA1);for i=1:m
      for j=1:n
          newA1(i,j)=(aA1(i,j)+bA1(i,j))/2;
      end;
   end;
  

   for i=1:m
     for j=1:n
        newA2(i,j)=(aA2(i,j)+bA2(i,j))/2;
     end;
   end;

   for i=1:m
     for j=1:n
        newA3(i,j)=(aA3(i,j)+bA3(i,j))/2; end; end; % Hf fusion rule fun=inline('var(x(:))'); % calculation3*3Region standard deviation H_aH1= NLfilter (aH1,[3 3],fun); % is divided on aH3*3H_aV1=nlfilter(aV1,[3 3],fun);
H_aD1=nlfilter(aD1,[3 3],fun);
H_bH1=nlfilter(bH1,[3 3],fun);
H_bV1=nlfilter(bV1,[3 3],fun);
H_bD1=nlfilter(bD1,[3 3],fun);

for i=1:m
    for j=1:n
        if H_aH1(i,j)>=H_bH1(i,j);
            newH1(i,j)=aH1(i,j);
        else
            newH1(i,j)=bH1(i,j);
        end
    end
end
for i=1:m
    for j=1:n
        if H_aV1(i,j)>=H_bV1(i,j);
            newV1(i,j)=aV1(i,j);
        else
            newV1(i,j)=bV1(i,j);
        end
    end
end
Copy the code

3. Operation results

Fourth, note

Version: 2014 complete code or write to add QQ 1564658423