









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A practice final exam with solutions for the CS131 Computer Vision: Foundations and Applications course at Stanford University. The exam covers topics such as filters, features, segmentation, classification, optical flow, and tracking. The exam consists of multiple-choice, true/false, and short answer questions, and students are allowed to use one double-sided 8.5”×11” hand-written page with notes that they have prepared. The exam also includes an honor code statement that students must sign.
Typology: Exams
1 / 15
This page cannot be seen from the preview
Don't miss anything!










Question Total Points Multiple Choice 11 True/False 11 Filters, features, etc. 12 Segmentation and seam carving 15 Classification and detection 10 Optical flow and tracking 7 Total 66
Instructions:
In recognition of and in the spirit of the Stanford University Honor Code, I certify that I will neither give nor receive unpermitted aid on this examination.
Signature:
2
matrix: T =
a 0 0 0 0 b 0 0 0 0 c 0 (^0 0 0) abc^1
Figure 1: Left: Original image; Center: Result 1; Right: Result 2
a. (1 point.) A dimming filter (only decrease the image intensity)
b. (1 point.) Approximation for difference of Gaussian filter
c. (1 point.) A filter for detecting diagonal edge from top-right to bottom-left
d. (1 point.) A filter that shifts pixels to the right by one pixel
(S[f ])[m, n] = (f? h)[m, n] def =
k
l
f [m + k, n + l]h[k, l]
The superposition principle for system S is:
S[
i
αifi] =
i
αiS[fi]
. where S is the the cross correlation system operator associated with filter h:
S[f ] = f? h
The αi are all constants in R, and the fi are images defined on R^2.
A cluster center function μ is invariant to a transformation φ : Rn^ → Rn^ if
φ(μ(x(1),... , x(m))) = μ(φ(x(1)),... , φ(x(m)))
for all sets of points x(1),... , x(m)^ ∈ Rn. A clustering algorithm is said to be invariant to a transformation φ if its choice of clusters is not affected when all points x are transformed to φ(x) Prove or reject with a counter-example: k-means algorithm is invariant to a transformation φ if and only if the distance and cluster center function are invariant to φ.
(c) (5 points). Suppose we want to resize an image I of size n × m to size n′^ × m′, where n′^ < n and m′^ < m. We can accomplish this by first removing vertical seams and then removing horizontal seams. Or we first remove the horizontal seams followed by the vertical seams. This begs the question of what is the correct order of removing seams. Remove vertical or horizontal seams first? Or alternate between the two? Here, we will derive the optimal list of seams to remove by finding the best vertical or horizontal seam to remove at every step. From the previous parts of the question, we have defined sy^ to be a vertical seam. Since, we will need to remove multiple vertical seams, let’s define a new variable syt , which is the vertical seam we want to remove at step t. Similarly, let’s define that sxt as the horizontal seam we want to remove step t. At every step of this problem, we need to choose whether to remove the optimal vertical seam or the optimal horizontal seam. Let αt be the variable that determines which seam to remove. When αt = 0, we will remove the vertical seam at step t and when αt = 1, we will remove the horizontal seam. We can write this as the following objective function:
min sxt ,syt ,αt
(n−n′)+( ∑m−m′)
t=
Cost(αtsxt + (1 − αt)syt )
such that
(n−n′)+( ∑m−m′)
t=
αt = n − n′
(n−n′)+( ∑m−m′)
t=
(1 − αt) = m − m′
Given that you already know how to find sxt and syt at every step, describe how you would use dynamic programming to find the values αt. Let T(i, j) be the optimal cost of removing i rows and j columns from the image I. Write a recurrence relationship for T(i, j) using the functions T(·) and Cost(·).
Figure 2: A database of penguins
You have collected a small dataset of penguin statues from different angles and under different lighting conditions, shown in Figure 2. In this figure note that each row contains images of penguin statues taken from the same angle, and each column contains penguin statues under the same lighting conditions. You would like to use this dataset to recognize the angle from which a photo of a penguin statue has been taken, and you decide to use the Eigenfaces (Eigenpenguins?) algorithm. More concretely, you want to determine the angle from which the image in the upper left corner was taken, using the other images as a training dataset. You use the other images to choose a low-dimensional Eigenpenguin space, project all of the images into this space, and declare that the angle of the query image is the angle of its nearest neighbor in Eigenpenguin space. Do you expect this algorithm to work correctly for this dataset? Justify your answer or explain why it isn’t a good algorithm choice.
(a) ((2 points). Draw on the image (figure 3) the decision boundaries for k = 1. Use L2 distance to get nearest neighbors.
Figure 3: Decision boundaries for k-NN with k = 1 and L 2 distance
(b) ((2 points). Draw on the image (figure 4) the decision boundaries for k = 3. Use L2 distance to get nearest neighbors.
Figure 4: Decision boundaries for k-NN with k = 3 and L 2 distance