Lab 3
Lab 3
ISLAMABAD
NC SHAIZA AKHTAR
BESE-27 C
Basic Image Operation
Question # 1
Load coloured image and convert it into gray scale image (gray_img) and display both
images. You can use built in images from MATLAB toolbox.
(C:\Program Files\MATLAB\R2013a\toolbox\images\imdemos)
Question # 2
Find the size of grayscale image in last question.
Question # 3
Load coloured image and then write the image into a text file and observe output.
Question # 4
What is the outcome of this command fp = gray_img(end: −1 :1, :) ?
This command flips the image upside down. end:-1:1 means reversing the rows, keeping
columns unchanged. The flipped image is stored in fp.
Question # 5
Write MATLAB code to produce mirror image of the input image. Display both images.
Question # 6
Write MATLAB code to produce negative of input image. Display both images.
Question # 7
Write a new M-function to reduce the number of grey levels in a given image to 8. The
input to your function should be a grey-scale image and the output should be another grey-
scale image.