## MATLAB implementation of Multi-focus image fusion using wavelet transform

1. Image fusion is one of the most researched area in the field of image processing.
2. There are also many other methods apart from wavelet transform that are very effective in generating efficient fusion results like PCA, etc.
3. But using wavelet transform like DWT, SWT, etc makes it easy to understand and implement and also highly efficient in producing brilliant results.
4. In my previous blog, I have discussed about the DWT implementation in general. So here I am discussing about SWT in the field of image fusion.
5. Image fusion is the process of gathering useful information from multiple images of same scene and producing a single high quality image that holds the maximum information.
6. Here we discuss the MATLAB implementation of multi-focus image fusion in DWT.

## Step by Step process of Multi-focus image fusion using wavelet transform

Input images: Two degraded multi-focused images, let say A and B.
Output image: High quality image i.e. X.

Step 1. Read the image A and B using below MATLAB code.
a) Image names are A and B respectively and after reading they are stored in A1 and B1.

Step 2. Image decomposition using SWT.
[A1, H1, V1, D1] = swt2(A1,1,'db2');
[A2, H2, V2, D2] = swt2(B1,1,'db2');
a) The discussion of decomposition of SWT is same as DWT as discussed in the previous blog.
b) The level of decomposition is 1 and wavelet family used is db2. You can also take sym2.

Step 3. Fusion process.
a) The detailed parts (H1, V1, D1) and (H2, V2, D2) holds the maximum information so
it is necessary to get of best of two, therefore the max operation is applied on the
detailed part of the two images.
b) The approximate parts (A1 and A2) also holds information but not much therefore,
average operation is applied on the approximate part of the two images.
A = (A1+A2)*0.5;
H = max (H1, H2);
V = max (V1, V2);
D = max (D1, D2);

Step 4. Fused image
a) The Inverse SWT is used to get the final high quality fused image.
X = iswt2(A, H, V, D,'db2');
b) X is final high quality fused image.
c) The implementation is very easy of this method.

For more image processing topics refer: https://www.gofastresearch.com/
MATLAB implementation of Multi-focus image fusion using wavelet transform Reviewed by Dr. Prabhishek Singh on April 18, 2020 Rating: 5