Assignment Week 2-DIP 2024

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

NPTEL Online Certification Courses

Indian Institute of Technology Kharagpur

Digital Image Processing


Assignment- Week 2
TYPE OF QUESTION: MCQ/MSQ
Number of questions: 10 Total mark: 10 X 2 = 20
______________________________________________________________________________

QUESTION 1:
Which of the following option is true?
Q

a) Q ∈ N4 (P)
b) Q ∈ N8 (P)
c) Q ∈ ND (P)
d) {Q} ⊄ {ND (P)} ∪ {N4 (P)} ∪ {ND (P)}

Correct Answer: d
Detailed Solution:

From the definition of 8-connectedness and diagonal connectedness, The relations, Q ∈ N4 (P)
, Q ∈ N8 (P)and Q ∈ ND (P) do not hold.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 2:
5 5 5 5 5
5 5 5 5 5
 
Find the 2D convolution of the given matrices using zero padding. Input =  5 5 5 5 5 
 
10 10 10 10 10
10 10 10 10 10
− 1 − 2 − 1
and kernel =  0 0 0  .
 1 2 1 

− 15 − 20 − 20 − 20 − 15
 0
 0 0 0 0 
a) − 15 − 20 − 20 − 20 − 15
 
− 15 − 20 − 20 − 20 − 15
 30 40 40 40 30 

 15 20 20 20 15 
 0
 0 0 0 0 
b) − 15 − 20 − 20 − 20 − 15
 
− 15 − 20 − 20 − 20 − 15
 30 40 40 40 30 

 − 15 − 20 − 20 − 20 − 15 
 0
 0 0 0 0 
c)  15 20 20 20 15 
 
 15 20 20 20 15 
− 30 − 40 − 40 − 40 − 30

 − 15 − 20 − 20 − 20 − 15 
 0
 0 0 0 0 
d)  − 15 − 20 − 20 − 20 − 15 
 
 − 15 − 20 − 20 − 20 − 15 
− 30 − 40 − 40 − 40 − 30
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

− 15 − 20 − 20 − 20 − 15
 0
 0 0 0 0 
Correct Answer: a. − 15 − 20 − 20 − 20 − 15
 
− 15 − 20 − 20 − 20 − 15
 30 40 40 40 30 

Detailed Solution:

For convolution, we have to do either time reversal of input image or the kernel. Let’s perform time
reversal of kernel and move the kernel on the input image.

5 5 5 5 5
5 5 5 5 5
  1 2 1
Input image, I =  5 5 5 5 5  and time reversed kernel= 0
 0 0 
 
10 10 10 10 10 − 1 − 2 − 1
10 10 10 10 10

I(0,0) = 0x1 + 0x2 + 0x1 + 0x0 + 5x0 + 5x0 + 0x(-1) + 5x(-2) + 5x(-1) = -15

I(0,1) = 0x1 + 0x2 + 0x1 + 5x0 + 5x0 + 5x0 + 5x(-1) + 5x(-2) + 5x(-1) = -20

In this we move the time reversed kernel over the image I and finally obtain the convolved image
as
− 15 − 20 − 20 − 20 − 15
 0
 0 0 0 0 
− 15 − 20 − 20 − 20 − 15
 
− 15 − 20 − 20 − 20 − 15
 30 40 40 40 30 

Hence option a is correct.


NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 3:
Compute the Euclidean Distance (D1), City-block Distance (D2) and Chessboard distance (D3) for
points p and q, where p and q be (1, 2, 3) and (1, 5, 7) respectively. Give answer in the form (D1,
D2, D3).
a) (5, 3, 4)
b) (5, 4, 3)
c) (7, 5, 4)
d) (5, 7, 4)

Correct Answer: d. (5, 7, 4)

Detailed Solution:

Euclidean distance (D1) =�(𝑥𝑥 − 𝑢𝑢)2 + (𝑦𝑦 − 𝑣𝑣)2 + (𝑧𝑧 − 𝑤𝑤)2 =5


City block distance (D2) =|x-u|+|y-v| +|z-w|=7
Chessboard distance (D3) =max (|x-s|, |y-t|, |z-w|) = 4

Hence option d is correct.

______________________________________________________________________________

QUESTION 4:

What is the minimum bandwidth required to transmit a grayscale image scanned at 100 PPI of size
3 𝑖𝑖𝑖𝑖𝑖𝑖ℎ𝑒𝑒𝑒𝑒 × 4 𝑖𝑖𝑖𝑖𝑖𝑖ℎ𝑒𝑒𝑒𝑒, with a data compression ratio of 8:1, over a communication channel in 0.5
seconds, given that each pixel is digitized using 8 bits?
Hint: Data compression ratio is defined as the ratio between the uncompressed size and compressed
size: Thus, a representation that compresses a file's storage size from 10 MB to 2 MB has a
compression ratio of 10/2 = 5/1
a) 3.84 Gbps
b) 1.92 Gbps
c) 1.48 Gbps
d) 5.12 Gbps

Correct Answer: a

Detailed Solution:
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

First we need to convert continuous signal into discrete signal by the process of sampling and then
digitize using digital bits.
Therefore, size of pixel at a rate of [(3 × 400) × (4 × 400)] × 8 𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏 = 15.36 𝐺𝐺𝐺𝐺
Size of compressed data = Uncompressed data/Compression ratio = 15.36/8 = 1.92 𝐺𝐺𝐺𝐺
Bandwidth of Channel = 1.92/0.5 = 3.84 𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺
____________________________________________________________________________

QUESTION 5:
Which of the following is always True?
a) Chessboard distance > City block distance > Euclidean
b) Chessboard distance < City block distance < Euclidean
c) Chessboard distance < Euclidean < City block distance
d) 𝑁𝑁𝑁𝑁𝑁𝑁𝑁𝑁 𝑜𝑜𝑜𝑜 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎

Correct Answer: d
Detailed Solution:

Given points (𝑥𝑥, 𝑦𝑦) and (𝑢𝑢, 𝑣𝑣)


City block distance (D1) =|x-u|+|y-v|

Euclidean distance (D2) =�(𝑥𝑥 − 𝑢𝑢)2 + (𝑦𝑦 − 𝑣𝑣)2


Chessboard distance (D3) =max (|x-u|, |y-v|)
D2 ≥ D3; (D2=D3 when 𝑦𝑦 = 𝑣𝑣 𝑜𝑜𝑜𝑜 𝑥𝑥 = 𝑢𝑢 𝑜𝑜𝑜𝑜 𝑏𝑏𝑏𝑏𝑏𝑏ℎ)
D1 ≥ D2; (By triangle inequality, D2 is hypotenuse to right angles with sides |x-u| and |y-v| )
Thus D1 ≥ D2≥ D3, Option C is special case which is not always True.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 6:
Find the value of logical operation XOR for the binary images A and B (A XOR B). Assume 1 to
be foreground and 0 to be background pixels.

Image-A Image-B

Correct Answer: A.

Detailed Solution:

Following the truth table for XOR operation


XYZ
-------
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

001
010
100
111
-------

XOR between and is

Hence option a is correct.


______________________________________________________________________________
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 7:
Perform only first pass of connected component labelling algorithm considering 4-connected
component labelling in following image and choose the correct option. (labelling starts from label
index=1)

1 1 1

1 1

1 1 1

a 1

4 4 4

4 4

4 4 4

3 3 3

3 3

3 3 3
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

4 5 6

7 8

9 10 11

d None of These

Correct Answer: a

Detailed Solution:

Run Connected Component Algorithm as discussed in class.


______________________________________________________________________________

QUESTION 8:

Consider a 2D point [1,1]T in a continuous image. The point is rotated by 30 o in anticlockwise


direction and scaled by 2 both in x-direction and y-direction. The transformed point is given by
a) [(√3 − 1), (√3 + 1)]T
b) [(√3 + 1), (√3 + 1)]T
c) [2√2, 0]T
d) [(√3 − 1), (√3 − 1)]T

Correct Answer: a
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

Detailed Solution:

Rotation matrix in homogenous coordinate system for anti-clockwise direction is given as


cosθ -sinθ 0
𝑅𝑅(𝜃𝜃) = � sinθ cosθ 0�.
0 0 1
Scaling matrix α in x direction and β in y-direction is given by
α 0 0
𝑆𝑆 = � 0 β 0�.
0 0 1

𝑥𝑥′ 2 0 0 cos300 -sin300 0 1


�𝑦𝑦′� = �0 2 0� � sin300 cos300 0� �1�.
1 0 0 1 0 0 1 1

On solving this equation, we get option 𝑎𝑎

______________________________________________________________________________

QUESTION 9:
Consider the following transformation matrix T:
αcosθ αsinθ 0
𝑇𝑇 = �−βsinθ βcosθ 0�
0 0 1

a) T rotates point clockwise by angle θ about x axis, scales x-axis by α and y-axis by β
b) T rotates point anticlockwise by angle θ about x axis, scales x-axis by α and y-axis by
β
c) T rotates point clockwise by angle θ about x axis, scales x-axis by β and y-axis by α
d) T rotates point anticlockwise by angle θ about x axis, scales x-axis by β and y-axis
by α

Correct Answer: a
Detailed Solution:

𝑇𝑇 = 𝑆𝑆 𝑅𝑅(θ)

𝑅𝑅(θ) = Rotation Matrix 𝑖𝑖𝑖𝑖 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑


NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

For clockwise rotation angle

= −θ

𝑆𝑆 = Scaling Matrix

α 0 0 cos(-θ) -sin(-θ) 0
𝑇𝑇 = � 0 β 0� � sin(-θ) cos(-θ) 0�
0 0 1 0 0 1

α 0 0 cosθ sinθ 0
𝑇𝑇 = � 0 β 0� �-sinθ cosθ 0�
0 0 1 0 0 1

______________________________________________________________________________

QUESTION 10:
An image sensor takes values between 1.0 and 11.0. If it is quantized by a uniform quantizer with
128 levels, what will be the transition (𝑡𝑡𝑘𝑘 ) and reconstruction level (𝑟𝑟𝑘𝑘 )?
10(𝑘𝑘+1) 5
a) 𝑡𝑡𝑘𝑘 = 128
, 𝑘𝑘 = 1,2,3, . . . . ,129; 𝑟𝑟𝑘𝑘 = 𝑡𝑡𝑘𝑘 + 128 , 𝑘𝑘 = 1,2,3, . . . . ,128

10(𝑘𝑘+1) 10
b) 𝑡𝑡𝑘𝑘 = 128
, 𝑘𝑘 = 1,2,3, . . . . ,129; 𝑟𝑟𝑘𝑘 = 𝑡𝑡𝑘𝑘 + 128 , 𝑘𝑘 = 1,2,3, . . . . ,128

10(𝑘𝑘−1) 5
c) 𝑡𝑡𝑘𝑘 = 128
, 𝑘𝑘 = 1,2,3, . . . . ,129; 𝑟𝑟𝑘𝑘 = 𝑡𝑡𝑘𝑘 + 128 , 𝑘𝑘 = 1,2,3, . . . . ,128

10(𝑘𝑘) 5
d) 𝑡𝑡𝑘𝑘 = 128
, 𝑘𝑘 = 1,2,3, . . . . ,129; 𝑟𝑟𝑘𝑘 = 𝑡𝑡𝑘𝑘 + 128 , 𝑘𝑘 = 1,2,3, . . . . ,128

Correct Answer: c
Detailed Solution:

Using the uniform quantizer design, transition and reconstruction levels can be defined as
10(𝑘𝑘−1) 5
𝑡𝑡𝑘𝑘 = 128 , 𝑘𝑘 = 1,2,3, . . . . ,129; 𝑟𝑟𝑘𝑘 = 𝑡𝑡𝑘𝑘 + 128 , 𝑘𝑘 = 1,2,3, . . . . ,128.
______________________________________________________________________________

______________________________________________________________________________

************END*******

You might also like