Assignment Week 2-DIP 2024
Assignment Week 2-DIP 2024
Assignment Week 2-DIP 2024
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
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)
Detailed Solution:
______________________________________________________________________________
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:
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:
001
010
100
111
-------
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:
QUESTION 8:
Correct Answer: a
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Detailed Solution:
______________________________________________________________________________
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:
𝑇𝑇 = 𝑆𝑆 𝑅𝑅(θ)
= −θ
𝑆𝑆 = 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*******