You are on page 1of 3

Assignment-1

Contrast streching

RGB1 =
imread('football.jpg');
RGB2 = imadjust(RGB1,.2 .3 0; .6
.7 1,,,);
subplot(2,1,1)
imshow(RGB1)
title('Jriginal Image');
subplot(2,1,2)
imshow(RGB2)
title('Enhanced Image');











Image Negative

RGB1 = imread('bombay.jpg');
RGB2 = imcomplement(RGB1);
subplot(2,1,1)
imshow(RGB1)
title('Jriginal Image');
subplot(2,1,2)
imshow(RGB2)
title('Enhanced Image');


%hresholding


I = imread('river.jpg');
J = rgb2gray(I);
subplot(3,3,1)
imshow(I)
Title(`original image');
subplot(3,3,2)
BW = im2bw(I,0.1);
imshow(BW)
subplot(3,3,3)
BW = im2bw(I,0.2);
imshow(BW)
subplot(3,3,4)
BW = im2bw(I,0.3);
imshow(BW)
subplot(3,3,5)
BW = im2bw(I,0.4);
imshow(BW)
subplot(3,3,6)
BW = im2bw(I,0.5);
imshow(BW)
subplot(3,3,7)
BW = im2bw(I,0.6);
imshow(BW)
subplot(3,3,8)
BW = im2bw(I,0.7);
imshow(BW)
subplot(3,3,9)
BW = im2bw(I,0.8);
imshow(BW)


Logarithimic transformation

f=imread('bombay.jpg');
g=rgb2gray(f);
c=0.4;
M,N,=size(g);
for x = 1:M
for y = 1:N
m=double(g(x,y));

z(x,y)=c.log10(1+m);
end
end
imshow(f), figure, imshow(z);


program to implement gamma


function

rgb= imread ('insect.jpg');
I= rgb2gray(rgb);
subplot (3,1,1)
imshow (I)
title ('Gamma corrections ');
g3=imadjust(I,,,,,2);
subplot (3,1,2)
imshow (g3)
g4=imadjust(I,,,,,3);
subplot (3,1,3)
imshow (g4)

You might also like