0% found this document useful (0 votes)
107 views3 pages

Computer Vision Quiz 1 Overview

Uploaded by

Muhammad Sair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views3 pages

Computer Vision Quiz 1 Overview

Uploaded by

Muhammad Sair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

COMSATS University Islamabad, Lahore Campus

Quiz 1 – Fall 2023


Course Title: Computer Vision
Resource Person: Dr. zeeshan gillani
Time allowed: 35 Mins Total
Marks: 12

Student Name: Registration Number:


Question 1.
Given a 5x5 image matrix below, calculate the gradient of the image using the
central difference operator. Assume zero-padding around the borders.

Hint:
Horizontal gradient (Gx) for a pixel (i, j) is given by:

Question 1 Solution:
Question 2.
Given Image Matrix:

a. If V = {0, 1}, are pixels at (1, 1) and (2, 2) m-adjacent?

b. Is V={0, 1, 2}, what is the shortest 8-path from the pixel at (3, 2) to the top-
left pixel?
c. If V={1,2}, how many connected components are there based on 4-
adjacency? Draw these connected components.

Question 2 Solution.

a. No, because the pixel at (1, 2) is in N 4 of both the pixels.


b.

(3,2)(2,2)(1,1)(0,0)
c. 5 connected components
Question 3.
In the context of noise reduction, why might a Gaussian kernel be preferred over a
uniform (box) filter? Discuss how the choice of variance affects this preference.
Question 3 Solution:
 Gaussian Kernel: It assigns higher weights to the pixels closer to the center
of the kernel and lower weights to those further away. This weighting scheme
is based on the Gaussian function, which decreases exponentially from the
center. As a result, the Gaussian filter preserves edges better while
smoothing, as it blends the pixel values more naturally according to their
spatial closeness.
The variance (σ2) of the Gaussian kernel controls the extent of smoothing. A
larger σ results in a wider kernel where the weights decrease more slowly
from the center, leading to more substantial smoothing and noise reduction
but with a higher risk of blurring edges. A smaller σ produces a narrower
kernel that focuses more on nearby pixels, resulting in less smoothing but
better preservation of details and edges.
 Uniform (Box) Filter: It assigns equal weights to all pixels within the
kernel's window, regardless of their distance from the center. This can lead to
a blurring effect that is more pronounced and less natural, especially around
edges, as it does not distinguish between pixels based on their proximity to
the center pixel.

You might also like