CLC
Clear all;
X1=imread (' cs1.jpg ');
X1=double (X1)/256; % here is converted to double type, otherwise using the wavelet transform output will have a large number of more than 1 of the existence, will cause the image to display a problem
% X1=rgb2gray (X1); % originally thought that the wavelet transform can only use one-dimensional, it seems to be able to use 3-D
Figure
Imshow (X1), title (' Left focal length ');
Axis Square;
X2=imread (' cs2.jpg ');
X2=double (X2)/256;
% X2=rgb2gray (X2);
Figure
Imshow (X2), title (' Right focal length ');
Axis Square;
[C1,s1]=wavedec2 (x1,2, ' sym4 '); % will be X1 for 2 D, using ' sym4 ' to transform Sizec1=size (C1);
For I=1:SIZEC1 (2);
C1 (i) =1.2*c1 (i); The decomposed values are enlarged by 1.2 times times
End
[C2,s2]=wavedec2 (x2,2, ' sym4 ');
C=C1+C2; % calculate average
C=0.5*c;
S=S1+S2;
s=0.5*s;
XX=WAVEREC2 (c,s, ' sym4 '); % for refactoring
Figure
Imshow (XX), title (' Fused ');
Axis Square;
Conclusion: There is no special processing of the image, so the effect is not very good, but the method of demonstrating the wavelet fusion image.
Use of the "C,s" WAVEDEC2 (x, N, ' name ') function
C is the decomposition of the various coefficients, which are divided into two layers, c, stored in the "ABBCCC" data is stored in rows, in S is the number of rows in a, the number of columns in a, the number of rows in B, the number of columns in B, the number of rows in C, the number of columns in C, the number of rows in the original, and the number of columns in the original. The L-layer has a small picture of 3l+1.