www.pudn.com > duge.rar > twist.m, change:2015-06-03,size:434b


function [ value ] = twist(I,J) 
%TOTAST Summary of this function goes here 
%   光谱扭曲程度,值越小融合效果越好。J为融合图像 
 [M,N,color1]=size(I); 
 [M,N,color2]=size(J); 
 if color1==3||color2==3 
     I=rgb2gray(I); 
     J=rgb2gray(J); 
 end 
 I=double(I); 
 J=double(J); 
%  total=sum(sum(abs(J-I))); 
total=0; 
 for i=1:M 
     for j=1:N 
         total=total+abs(I(i,j)-J(i,j)); 
     end 
 end 
 value=total/(M*N); 
end