Matlab code for Pixel level Image fusion using Maximum Method
The Selection method is also one of the trivial methods of image fusion. But unlike averaging method, instead of averaging every corresponding pixel, a selection process if performed here. The criterion of selection is self explained by the name of the method. Of every corresponding pixel of the input images, the pixel with maximum intensity is selected and is put in as the resultant pixel of the fused image. Thus, effectively, every pixel of the fused image will be the pixel with maximum intensity of the corresponding position pixels in the input image. One advantage of this method over averaging method is that there is no compromise made over the good information available in the input images. A straight forward selection of the better pixel intensity is made here. But of course, it is combined with the disadvantage that higher pixel intensity does not always mean better information. It depends on the type of image under consideration. Thus, you either take the whole of the information or totally avoid the same. The stepwise description of the algorithm is as the following:
- Compare the intensity value of the corresponding pixels of the input pair of images.
- Generate the selection matrix based on the comparison performed in 1, assigning value 1 for condition being true and 0 otherwise
- Multiply the corresponding value in the selection matrix with first image matrix
- Multiply the corresponding value in the negated selection matrix with second image matrix.
- Resultant image matrix id calculated by adding the matrices calculated in 3 and 4.
The maximum of the pixel intensities at every position (m,n) is selected as the (m,n) pixel of the fused image
Matlab code for Image Fusion using Maximum Method
M1 = imread('mri.jpg');
M2 = imread('ct.jpg');
mm = M1 > M2;
FusedImage = (mm.*M1) + ((~mm).*M2);
subplot(1,3,2);imshow(M2,[ ]);title('Image Fusion using Maximum');