Professional Documents
Culture Documents
for i=1:Rows
for j=1:Cols
if(i >Rows/4 && i<3*Rows/4)
if(j>Cols/4 && j<3*Cols/4)
imgData(i,j)=0;
end
end
end
end
figure(2);
imshow(imgData);
i=imread('pout.bmp');
figure(3);
imshow(i);
z=rgb2gray(image);
figure(4);
imshow(z);
[Rows,cols]=size(i)
y=imresize(z,[256,256],'nearest');
figure(5);
imshow(y);
figure()
subplot(1,2,1)
imshow(z)
title('Original image')
subplot(1,2,2)
imshow(ot./255)
title('Contrast stretching')
Piece-wise linear transformation : Contrast stretching function
400
350
300
250
200
150
100
50
50
100
150
200
Intensity in input image
250
300
Original image
Contrast stretching
Learning outcome
In this experiment I learnt about Digital image processing basics. In this I learnt how to read a
image show it on screen then I learnt how to change dimension of a image and change it into
gray scale from RGB scale then check threshold of a image and then converting color image into
binary image and perform contrast sketching and adding brightness to it.