Code covered by the BSD License  

Highlights from
arithmetic filters

arithmetic filters

by

 

it deals in the arithmetic filters in image processing

arithmeticop.m
a=imread('lena.gif');
figure(1)
imshow(a);
a=double(a);
% Adding a constant to an image -- increasing the brightness of an image
b=imadd(a,128);
figure(2)
imshow(uint8(b));
title(' adding by a constant 128')
% Subract a constant to an image  --- Decreasing the brightness of an image
a=double(a);
b1=imsubtract(a,128);
figure(3)
imshow(uint8(b1));
title(' Subtracting by a constant 128')
% Multiply a constant to an image -- increasing the contrast of an image
b2=immultiply(a,2);
figure(4)
imshow(uint8(b2));
title(' multiply by 2')
% Divide a constant to an image -- Decreasing the contrast of an image
b3=imdivide(a,2)
figure(5)
imshow(uint8(b3));
title(' divide by 2')
figure(6)
subplot(2,2,1), imshow(uint8(b)), title('adding by a constant 128')
subplot(2,2,2), imshow(uint8(b1)) , title('subtracting by a constant 128')
subplot(2,2,3), imshow(uint8(b2)) ,title('multiplication by a constant 2')
subplot(2,2,4), imshow(uint8(b3)) ,title('divide by a constant 2')
% Image complement
a1=imread('lena.gif');
b4=255-a1
figure(7)
imshow(b4);
title(' image Negative')

Contact us