|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
) k+ C# X0 G) M1 t1 l7 ^一、源代码6 v6 m+ H' o: n+ c2 h" {
+ m8 \3 C2 q: J) E
- close all;
- clear all;
- clc;
- %%% Fusion Method Parameters.
- cov_wsize=5;
- %%% Bilateral Filter Parameters.
- sigmas=1.8; %%% Spatial (Geometric) Sigma. 1.8
- sigmar=25; %%% Range (Photometric/Radiometric) Sigma.25 256/10
- ksize=11; %%% Kernal Size (should be odd).
- arr=['A';'B'];
- for m=1:2
- string=arr(m);
- % inp_image=strcat('images\med256',string,'.jpg');
- inp_image=strcat('images\office256',string,'.tif');
- % inp_image=strcat('images\gun',string,'.gif');
- x{m}=imread(inp_image);
- if(size(x{m},3)==3)
- x{m}=rgb2gray(x{m});
- end
- end
- [M,N]=size(x{m});
- %%% Cross Bilateral Filter.
- tic
- cbf_out{1}=cross_bilateral_filt2Df(x{1},x{2},sigmas,sigmar,ksize);
- detail{1}=double(x{1})-cbf_out{1};
- cbf_out{2}= cross_bilateral_filt2Df(x{2},x{1},sigmas,sigmar,ksize);
- detail{2}=double(x{2})-cbf_out{2};
- %%% Fusion Rule (IEEE Conf 2011).
- xfused=cbf_ieeeconf2011f(x,detail,cov_wsize);
- toc
- xfused8=uint8(xfused);
- if(strncmp(inp_image,'gun',3))
- figure,imagesc(x{1}),colormap gray
- figure,imagesc(x{2}),colormap gray
- figure,imagesc(xfused8),colormap gray
- else
- figure,subplot(131);imshow(x{1});title('图1')
- subplot(132);imshow(x{2});title('图2')
- subplot(133),imshow(xfused8) ;title('融合后')
- end
- % axis([140 239 70 169]) %%% Office.
- fusion_peRForm_fn(xfused8,x);
* I, A- y5 c9 N/ [ : Y( }, T5 s6 z# ]& D7 Y
1 v5 T- m2 U) \* B8 J9 n二、运行结果& D7 \) _/ x* T% a o' u* o
9 N0 k4 ?% D# e4 x! U, Q* j" E
|
|