Matlab using wavelet transform to image fusion __matlab Image Learning Introduction

Source: Internet
Author: User
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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.