All All 'Image1.jpg' 'Image2.jpg': % Displaying Images
All All 'Image1.jpg' 'Image2.jpg': % Displaying Images
more images. The operators are applied in a pixel-by-pixel way, i.e. the value of a pixel in the
output image depends only on the values of the corresponding pixels in the input images. Hence,
the images must be of the same size. Although image arithmetic is the most simple form of
image processing, there is a wide range of applications. A main advantage of arithmetic
operators is that the process is very simple and therefore fast.
Logical operators are often used to combine two (mostly binary) images. In the case of integer
images, the logical operator is normally applied in a bitwise way.
clear all;
close all
img1=imread('image1.jpg');
img2=imread('image2.jpg');
% displaying images
subplot(1,2,1);
imshow(img1);
title('image 1');
subplot(1,2,2);
imshow(img2);
title('image 2');
W=uint16(img1)+uint16(img2);
Wmax=max(W(:));
Wmin=min(W(:));
normaziled=uint8(255*double(W-Wmin)/double(Wmax-Wmin));
subplot(1,2,2);
imshow(normaziled);
title('Normalized Image Addition');
2.
clear all;
close all
img1=imread('image1.jpg');
img2=imread('image2.jpg');
3. clear all;
close all
img1=imread('image1.jpg');
img2=imread('image2.jpg');