CS131 Computer Vision: Foundations and Applications Practice Final (Solution), Exams of Optics

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

2020/2021

Uploaded on 05/11/2023

anasooya
anasooya 🇺🇸

4.1

(13)

244 documents

1 / 15

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS131 Computer Vision: Foundations and Applications
Practice Final (Solution)
Stanford University
December 11, 2017
Name:
SUNet ID: @stanford.edu
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:
1. This examination contains 15 pages, including this page. You have three (3) hours to complete
the examination. As a courtesy to your classmates, we ask that you not leave during the last fifteen
minutes.
2. For Multiple-Choice and True False sections, correct answers will get the points listed next to the
question. You will receive 0 for all unanswered questions and 1 for all incorrect answer. You can
choose to not answer questions that you are unsure of to avoid receiving a negative point.
3. For Short Answers, you will NOT get negative points for incorrect answers. Partial credit will be
assigned for showing your work and reasoning.
4. You may use one double-sided 8.5” ×11” hand-written page with notes that you have prepared.
You may not use any other resources, including lecture notes, books, other students or other engineers.
These notes must be submitted along with your booklet.
5. You may use a calculator however, you should not require one. You may not share a calculator with
anyone.
6. Please sign the below Honor Code statement.
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:
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download CS131 Computer Vision: Foundations and Applications Practice Final (Solution) and more Exams Optics in PDF only on Docsity!

CS131 Computer Vision: Foundations and Applications

Practice Final (Solution)

Stanford University

December 11, 2017

Name:

SUNet ID: @stanford.edu

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:

  1. This examination contains 15 pages, including this page. You have three (3) hours to complete the examination. As a courtesy to your classmates, we ask that you not leave during the last fifteen minutes.
  2. For Multiple-Choice and True False sections, correct answers will get the points listed next to the question. You will receive 0 for all unanswered questions and −1 for all incorrect answer. You can choose to not answer questions that you are unsure of to avoid receiving a negative point.
  3. For Short Answers, you will NOT get negative points for incorrect answers. Partial credit will be assigned for showing your work and reasoning.
  4. You may use one double-sided 8.5” × 11” hand-written page with notes that you have prepared. You may not use any other resources, including lecture notes, books, other students or other engineers. These notes must be submitted along with your booklet.
  5. You may use a calculator however, you should not require one. You may not share a calculator with anyone.
  6. Please sign the below Honor Code statement.

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:

Multiple choice answers (11points)

  1. RANSAC vs Least squares (1 point). What are the benefits of RANSAC compared to the least squares method? Circle all that apply. A. RANSAC is faster to compute in all cases B. RANSAC has a closed form solution C. RANSAC is more robust to outliers D. RANSAC handles measurements with small Gaussian noise better
  2. SIFT (1 point). What does each entry in a 128-dimensional SIFT feature vector represent? (Choose the best answer) A. A principal component. B. A sum of pixel values over a small image patch. C. One bin in a histogram of gradient directions. D. The number of pixels whose gradient magnitude falls within some range.
  3. Clustering (1 point). Which of the following statement is true for k-means and HAC clustering algorithm? (Choose the best answer) A. k-means and HAC are both sensitive to cluster center initialization. B. k-means and HAC can lead to different clusters when applied to the same data. C. k-means works well for non-spherical clusters. D. HAC starts with all examples in the same cluster, then each cluster is split until we have the desired number of predetermined clusters.
  4. Video Tracking (1 point). What kinds of image regions are hard to track? (Circle all that apply): A. low texture regions like sky B. Edges of objects C. Corners of objects D. Rotating spheres
  5. Optical flow (1 point).What are the methods for estimating optical flow that we covered in class? Circle all that apply. A. Seam carving. B. Gibbs random field motion estimation. C. Optical flow equation and Second order derivatives of optical flow field. D. Hidden Markov Model.
  6. Hessian (1 point). Given a vector in Rn^ (implying that the vector is n-dimensional), its Hessian is in: A. undefined B. Rn C. Rn×n D. Rn

2

  1. Similarity transformation (2 points). Which of the following always hold(s) under an similarity transformation? Circle all that apply. A. Parallel lines will remain parallel.

True and False (11points)

  1. (1 point.) A smoothing filter sums to 1.
  2. (1 point.) A scaling matrix by a, b, c in the x, y, and z directions, respectively, has the transformation

matrix: T =

a 0 0 0 0 b 0 0 0 0 c 0 (^0 0 0) abc^1

  1. (1 point.) In figure 1, we applied a Gaussian filter to the original image and computed the derivative in x and y directions. True or False: Result 1 is the x-derivative of Gaussian, and result 2 is the y- derivative of Gaussian.

Figure 1: Left: Original image; Center: Result 1; Right: Result 2

  1. (1 point.) If you compute optical flow in a video sequence, a nonzero optical flow vector always indicates real movement of an object in the scene depicted by the video.
  2. (1 point.) A set of eigenfaces can be generated by performing principal component analysis (PCA) on a large set of images depicting different human faces. Any human face from this large set can be considered to be a combination of these standard faces.
  3. (1 point.) Pyramidal Lucas-Kanade method can track large motions between frames while Lucas- Kanade without the pyramids can not.
  4. (1 point.) When using Harris detector, an image region is considered to be a corner if both λ 1 and λ 2 are small. (λ 1 and λ 2 are the eigenvalues of the second moment matrix.)
  5. (1 point.) Even without using non-maximum suppression, we know that all pixels with gradient magnitudes above the ‘high’ threshold will be considered an edgeb by a Canny edge detector.
  6. (1 point.) Optical illusions are NOT a type of optical flow.
  7. (1 point.) In texture free regions, there is no optical flow.
  8. (1 point.) Motion could be used to improve video resolution quality.

Short Answers 1: Filters, edges, corners, keypoints and descriptors

(12points.)

  1. Filters (4 points). Give ANY 3x3 example of each of the following types of image convolution filters:

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

  1. Cross-correlation (4 points). Prove that the superposition principle holds for cross-correlation or provide a counterexample. Recall that the cross-correlation between f and a template h is function S[f ] = f? h defined by:

(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.

Short Answers 2: Segmentation and seam carving (15points.)

  1. k-means (4 points.) A distance function d on Rn^ is said to be invariant under a transformation φ : Rn^ → Rn^ if ∀x, y ∈ Rn, d(x, y) = d(φ(x), φ(y))

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(·).

Short Answers 3: Classification and detection (10points.)

  1. Eigenpenguins (4 points).

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.

  1. kNN Boundaries (4 points). Figure 3 shows a training set of 14 examples, with 5 example for class 1 (with the crosses) and 3 examples for class 2 (with the circles). If we apply k-nearest neighbors, we can classify any testing point into class 1 or class 2. If we do that for every point in R^2 , we obtain decision boundaries which delimit zones of R^2 where the classification is either 1 or 2.

(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