本文程序是根据"Zhao J, Feng H, Xu Z, et al. Detail enhanced multi-source fusion using visual weight map extraction based on multi scale edge preserving decomposition[J]. Optics Communications, 2013, 287: 45-52."编写的,最大的问题是运行时间太长了,有五六分钟,还有就是最后的融合效果并不是很理想。
具体matlab程序为:
clear all;
%path_A = '..\IR and Vis\Camp_Vis.jpg'; path_B = '..\IR and Vis\Camp_IR.jpg';
%path_A = '..\IR and Vis\Dune_Vis.jpg'; path_B = '..\IR and Vis\Dune_IR.jpg';
path_A = '..\Medical Images\source1_1.tif'; path_B = '..\Medical Images\source1_2.tif';
img1 = double(imread(path_A))/255.0;
img2 = double(imread(path_B))/255.0;
if(size(img1,3)~=1)
img1=rgb2gray(img1);
end
if(size(img2,3)~=1)
img2=rgb2gray(img2);
end
%% ---------- L0 Decomposition --------------
nLevel = 3;
lambda=[0.0005 0.003 0.018];
f1 = cell(1, nLevel+1);
d1 = cell(1, nLevel+1);
f1{1}=img1;
for L = 2:nLevel+1,
f1{L} = L0Smoothing(f1{L-1},lambda(L-1));
d1{L} = f1{L-1} - f1{L};
end
% figure;imshow([mat2gray(f1{2}),mat2gray(f1{3}),mat2gray(f1{4});...
% mat2gray(d1{2}),mat2gray(d1{3}),mat2gray(d1{4})])