Digital Image Processing : Philadelphia University Faculty of IT
Digital Image Processing : Philadelphia University Faculty of IT
Faculty of IT
Marking Scheme
Exam Paper
BSc CS
Question 3: This question is attributed with 3 marks if answered properly, the answers are as following:
Number
Image Type Data Classes Range of
matrices
1. Intensity uint8 0-255
(Grayscale uint16 0-65535 1
images) double 0-1
2. Binary Image logical 0 or 1 1
As in
3. Indexed Index image ( uint8, uint16,double)
intensity 2
Image Color mapped image (double)
images
uint8 As in
4. RGB Images uint16 intensity 3
double images
Question 4: This question is attributed with 3 marks if answered properly, the answers are as following:
The complete code for this question as the following:
RGB = imread('peppers.png'); (1 mark)
red = RGB(:,:,1);
green = RGB(:,:,2);
blue = RGB(:,:,3); (1 mark)
imshow(red), figure ,
imshow(green),figure
imshow(blue), figure,
imshow (RGB); (1 mark)
Question 5: This question is attributed with 3 marks if answered properly, the answers are as following:
The complete code for this question as the following:
function [q] = imblend(p1,p2,br)
%IMBLEND Computes the blended version of two grayscale input images
%[Q]=IMBLEND(P1,P2,BR) Computes Q blended image
%using the equation Q(I,J)=BR*P1(I,J)+(1-BR)*P2(I,J)
%using low-level processing
%X: Mixing proportion or blending ratio, which determine the influences
[M N d] = size(p1);
q = uint8(zeros(M,N)); (1.5 mark)
for x= 1:M
for y=1:N
q(x,y)=uint8(br*p1(x,y)+(1-br)*p2(x,y));
end
end
image(q),figure, image(p1), figure, image(p2) (1.5 mark)
Question 6: This question is attributed with 5 marks if answered properly, the answers are as following:
The complete code for this sub question as the following:
A=imread('cameraman.tif'); % Read in 1st image
B=imread('pout.tif'); % Read in 2nd image (1 mark)
A1 = A(1:200,1:200);
B1 = B(end-199:end,end-199:end); (1.5 mark)
subplot(1,3,1), imshow(A); title('1st image') % Display 1st image
subplot(1,3,2), imshow(B); title('2nd image') % Display 2nd image
Output = imsubtract(A1, B1); (1.5 mark)
subplot(1,3,3), imshow(Output);
title('subtract images') % subtract images (1 mark)