Question 1-Canny Edge Detector (10 Points) : Fundamentals of Computer Vision - Midterm Exam Dr. B. Nasihatkon
Question 1-Canny Edge Detector (10 Points) : Fundamentals of Computer Vision - Midterm Exam Dr. B. Nasihatkon
Question 1-Canny Edge Detector (10 Points) : Fundamentals of Computer Vision - Midterm Exam Dr. B. Nasihatkon
Filter Image
0 0 1 3 2
-1 0 2
2 3 6 0 3
0 2 1
5 4 2 5 7
-3 1 2
1 2 0 4 4
A) What is the output of a correlation operation on the image using the above filter?
What is the result of convolution? Fill in the blank cells below (12 points.)
Correlation Convolution
X X X X X X X X X X
X X X X
X X X X
X X X X X X X X X X
B) Apply a 3 by 3 median filter to the image above and print the results in the blank
cells below (6 points.)
X X X X X
X X
X X
X X X X X
0 0 1 3 2
-1 0 1 -1 -2 -1
2 3 6 0 3
-2 0 2 0 0 0
5 4 2 5 7
-1 0 1 1 2 1
1 2 0 4 4
dx dy
A) For the image I above compute the gradient (dI/dx, dI/dy), magnitude of gradient
and the angle of gradient for pixel locations A, B and C marked below. You have
to use the Sobel filters (above) to compute the derivatives (no normalization is
needed). You need to write down how you derived each of these quantities. You
may use arctan to represent the angles. The y axis is pointing downwards. (15
points)
B C
A B C
D E F
B) Which of the images D and E has a higher contrast? Why? (4 points)
C) How does image B look like compared to image A? Explain. (4 points)
D) What is the relation between images C and D? Explain your answer. (4 points)
A) For each of the lines in the image space below (left), draw the corresponding point
in the hough space (right). Use letters A, B, C and D to mark the points. You need
to also write the point coordinates ( arctan(2) ≃ 64 degrees). Assume ρ ≥ 0 and
0 ≤ θ < 180. (12 points)
B) For each of the points in the hough space below (left), draw the equivalent line in the
image space (right). On each line draw at least two points (for example, intersection with
the x and y axes, if possible. Or two other points). You just need to draw a line segment in
the first quadrant of the coordinate system ( x ≥ 0, y ≥ 0) . (6 points)
I x = dI / dx I y = dI /dy
3 2 1 -1 -1 2 3 1 1 -1
4 3 2 0 -1 2 3 2 -1 1
4 3 4 2 1 2 4 4 1 2
1 1 3 2 2 -1 0 3 2 3
A) Compute the Harris matrix for the 3 by 3 window highlighted in the above images.
The Harris matrix is defined as (10 points)
B) Compute the cornerness score for the above matrix C = det(H) − k trace(H)2 for the
above window, where det and trace represent the determinant and trace (sum of
diagonal elements) of a matrix. Use k = 0.04. (3 points)
C) What do you think we have in the above window? A corner? An edge? Or a flat
region? Explain your answer. (5 points)