資源簡(jiǎn)介
低頻采用基于區(qū)域能量和加權(quán)平均相結(jié)合的方法,高頻采用絕對(duì)值最大
代碼片段和文件信息
%圖象融合(基于小波變化與局部能量)
clc;
clear?all;
Y=imread(‘clockA-t.jpg‘);?%裝入原圖像
figure(1)
subplot(221)
imshow(Y);
title(‘clockA-t.jpg‘)
X1=double(Y)/255;
subplot(222)
imhist(X1);
Y1=imread(‘clockB-t.jpg‘);?%裝入原圖像
subplot(223);
imshow(Y1);
title(‘clockB-t.jpg‘)
X2=double(Y1)/255;
subplot(224);
imhist(X2);
%對(duì)上述二圖像進(jìn)行三層小波分解
%X1=double(X1)/255;
%X2=double(X2)/255;
[c1s1]=wavedec2(X13‘sym4‘);
[c2s2]=wavedec2(X23‘sym4‘);
cA31=appcoef2(c1s1‘sym4‘3);
?cH31=detcoef2(‘h‘c1s13);
?cV31=detcoef2(‘v‘c1s13);
?cD31=detcoef2(‘d‘c1s13);
?cH21=detcoef2(‘h‘c1s12);????
?cV21=detcoef2(‘v‘c1s12);
?cD21=detcoef2(‘d‘c1s12);
cH11=detcoef2(‘h‘c1s11);
cV11=detcoef2(‘v‘c1s11);
cD11=detcoef2(‘d‘c1s11);
?cA32=appcoef2(c2s2‘sym4‘3);
?cH32=detcoef2(‘h‘c2s23);
?cV32=detcoef2(‘v‘c2s23);
?cD32=detcoef2(‘d‘c2s23);
?cH22=detcoef2(‘h‘c2s22);
?cV22=detcoef2(‘v‘c2s22);
?cD22=detcoef2(‘d‘c2s22);
cH12=detcoef2(‘h‘c2s21);
cV12=detcoef2(‘v‘c2s21);
cD12=detcoef2(‘d‘c2s21);
?cA33=cA31.*cA32;
?
?Ea=nlfilter(cA31[3?3]@myfunction1);
?Eb=nlfilter(cA32[3?3]@myfunction1);
?E=nlfilter(cA33[3?3]@myfunction1);
?T=1.5;
?for?i=1:numel(Ea)
?M(i)=2*E(i)/(Ea(i)+Eb(i));
?Wmin(i)=0.5-0.5*((1-M(i))/(1-T));
?end
Wmax=1-Wmin;
for?k=1:n
評(píng)論
共有 條評(píng)論