Fundamentals of Computer Vision - Spring 1401 (2022) Midterm Exam
B. Nasihatkon
Name: ID:
Question 1- Filtering and Gradients (30 points)
Below are an input image, the derivative filters, and the partial derivatives obtained by applying the filters (as correlations). Notice that the derivatives are computed only for locations where the filters fit inside the image.
Input image
4 A B C
-2 D E 6
F G H 0
Derivative Filter along x
-½ 0 ½
Partial derivative along x
? -3 -2 ?
? 6 6 ?
? -3 -4 ?
Derivative Filter along y
-½
0
½
Partial derivative along y
? ? ? ?
-1 1 -1 -1
? ? ? ?
Find the pixel valuesA,B,C, D, E, F, G,and H. Write down the complete solution.
Question 2- Separable filters (20 points)
We learned thatW2N2multiplications are needed to filter anNbyNimage with a generic WbyWfilter. (We put the filter on every pixel.)
Now, assume that theWbyWfilter can be written as the sum ofKseparable filters, that is 𝐹 =
𝑖 = 1 𝐾
∑ ℎ𝑖 * 𝑣
𝑖,
wherehi-s are row filters (1 by W),vi-s are column filters (W by 1), and "*" is the convolution operator.
a) Using this assumption and by first applying the vertical and then the horizontal filters, how many multiplications are needed to filter anNbyN? Why?(15 points)
b) For what values ofKis it worth to use (sum of) separability to apply the filter, instead of applying the filter directly? Why? (Ignore the addition operations.)(5 points)
K. N. Toosi University of Technology
Question 3- Non-maximum suppression in corner detection (20 points)
Below are the Harris scores for different pixel locations of an image.
0 1 2 3 4 5 6
0 -3 -2 3 3 2 1 0
1 -10 -21 6 4 5 8 6
2 -2 -8 4 5 7 7 2
3 0 -1 6 8 12 11 10
4 0 4 6 7 10 9 8
To detect the corners, we first apply a thresholdtto the scores, and then perform
non-maximum suppression. What are the locations of the detected corners for each of the following cases?Explain your answer.
Denote each corner as (y,x; harris-score). For example (2,1; -8).
1. t=4.5
2. t=6.5
3. t=9.5
K. N. Toosi University of Technology
Question 4- Hough Transform (30 points)
We intend to use the Hough transform to detect parabolas tangent to the x-axis. We parameterize this family of parabolas using two parameters𝑑 andσas in the figure below.
a) Show that the above parabola can be represented by 𝑦 = (𝑥 − 𝑑)2 / σ.
b) Consider all parabolas passing through the point(𝑥 . Find the corresponding
0, 𝑦
0)
curve in the Hough space in the form ofσ = 𝑓(𝑑). What shape does this represent? Draw it for(𝑥 .
0, 𝑦
0) = (4, 2)
K. N. Toosi University of Technology