You are on page 1of 3

Digital Image Processing

Assignment 2
Chapters 2, 3 – Written Assignment
Distribution Date:
Due Date: 8-Oct-2021
Marks: 100
Late Submission Penalty: Not accepted, please don’t request to accept late submissions
Submission Method: Hard copy only by using handwritten

Question 1: Consider the 7x7 image segment shown below. Each value is gray level of a pixel.

1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35
36 37 38 39 40 41 42
43 44 45 46 47 48 49

Find the following distances between pixels with gray levels 25 and 36: [Marks: 2+2+2]

(a) Euclidean distance


(b) City block distance
(c) Chessboard distance

Question 2: Repeat Question 1 for pixels with gray levels 34 and 9. [Marks: 2+2+2]

Question 3: For the image of Question 1, write the gray levels of the pixels that are within a distance of 3 (distance
3 or less) from the pixel with gray level 25. Solve for the following distance types: [Marks: 3+3+3]

(a) Euclidean distance


(b) City block distance
(c) Chessboard distance

Question 4: Explain the advantages of using array sensors instead of line sensors to acquire an image. [Marks: 3]

Question 5: (a) What will be size of a 256 gray level image in bits if the size of the image is 1000x500 pixels.
(b) If the image is down-sampled to 500x250 and total number of gray levels is changed to 64, what will be the size
of the new image in bits? [Marks: 2+2]

Question 6: Consider the image segmentation of a binary image shown below. You have to find a path from the
two encircled pixels with gray level 1 (top-left and bottom-right pixels). Show the path by drawing the image and
connecting the points that make the path. If there is no path, just write “No Path Exists”. If multiple paths are
possible, show all paths. [Marks: 2+4+4]
1 1 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 1
0 0 0 0 1

(a) 4-Connectivity
(b) 8-Connectivity
(c) M-Connectivity

Question 7: Explain the difference (in terms of the values of the gray levels used for pixels) between the following
four types of images: [Marks: 4]

(a) Binary Image


(b) Gray level Image (e.g. 256 gray levels image)
(c) RGB Image
(d) Intensity Image

Question 8: Consider the 2x2 image shown below. Draw the new image if the original image is zoomed 1.5 times
along both rows and columns (i.e. to size 3x3) using: [Marks: 4+4]

(a) Nearest Neighborhood


(b) Bilinear Interpolation

2 4
6 8

Question 9: Consider the 3x3 image shown below. Draw the new image if the original image is zoomed 2 times
along both rows and columns (i.e. to size 6x6) using: [Marks: 2+2]

(a) Pixel Replication


(b) Nearest Neighborhood

2 4 6
4 6 8
2 4 6

Question 10: An image has a total of 8 gray levels ranging from 0 to 7.


(a) Find a square root transformation function for this image and draw it. Both x and y axes range from 0 to 7. First
scale gray level range 0 – 7 to range 0 – 1, then take square root of each scaled gray level to find transformed
gray level in range 0 – 1 and finally up-scale to range 0 – 7.
(b) Apply the above transformation to the following image and show the new image. [Marks: 5+5]

0 0 0
1 3 5
7 7 7

Question 11: Consider the image shown below. The image has a total of 8 gray levels ranging from 0 – 7. Draw the
histogram of this image. [Marks: 5]
0 1 2 6 7
2 5 3 5 0
2 3 5 6 0
1 5 3 2 4
4 7 6 2 1

Question 12: Consider the image shown below. The image originally had 16 gray levels but only 4 gray levels in
middle of the entire colors range were used. Use contrast stretching (slide 26 of chapter 3) to improve contrast of
this image to the entire range of 16 gray levels (0 – 15) [Marks: 5]

6 8
10 12

Question 13: Consider the 16 gray levels (0 -15) image shown below. We want to do histogram equalization of this
image. [Marks: 6+4]

(a) Find and draw the histogram equalization transformation function for this image.
(b) Find the histogram equalized image.

1 1 2 2
2 2 2 2
8 8 10 12
12 14 14 14

Question 14: Consider the 256 gray levels (0 - 255) image shown below. Run a 3x3 Min Filter on whole image and
write the resulting output image. There is no need to run mask on edges. [Marks: 5]

10 10 10 10 10
50 10 10 10 10
10 10 10 100 10
10 10 10 10 10
10 10 210 10 10

Question 15: Consider the 256 gray levels (0 - 255) image shown below. Run a 3x3 Median Filter on Central Pixel
with gray level 40 ONLY (Central Pixel) and tell the gray level that must be used for this location in the output
image. Note again that you have to run the filter only once by placing it at the central pixel. [Marks: 4]

10 10 10 10 10
10 10 12 14 10
10 12 40 12 10
10 10 12 12 10
10 10 10 10 10

Question 16: For the image of Question 15 above, run a box filter on Central pixel and find out the gray level that
must be used for this location in the output image. Note again that you have to run the filter only once by placing it
at the central pixel. [Marks: 4]

Question 17: In no more than 10 lines, explain the difference between point operations, local operations and global
operations used for image enhancement in spatial domain. [Marks: 3]

You might also like