Practice Final 09

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

NAME: _____________________________________________________

Computer Vision Prof. Rajesh Rao


TA: Jiun-Hung Chen
CSE 455 Winter 2009

Sample Final Exam


(based on previous CSE 455 exams by Profs. Seitz and Shapiro)

Directions

Write your name at the top of every page.

Start only when you are the given the “green signal”.

Make sure you have 8 pages (and none are blank).

Please provide answers to the questions in the space provided, or on the back of the
page.

This exam is closed book/notes except for one 8 1/2'' x 11'' review sheet.

1
NAME: _____________________________________________________

Problem 1: Short answer

For each of the following, explain how it may be used to help solve a computer vision
problem (and specify the problem).

1. K-means

[For solution, see Segmentation lecture]

2. Principal components

[For solution, see Object Recognition lecture]

3. Sum-of-squared distances (SSD)

[For solution, see, e.g, Features lecture]

4. Epipolar lines

[For solution, see Stereo lecture]

5. Image pyramid

[For solution, see, e.g., Motion lecture]

2
NAME: _____________________________________________________

Problem 2: Filters

Part 1. Consider the 1D image below:

a b c d e f g
Image I

a) Suppose we apply a width-3 mean filter TWICE to this image. In other words, we
apply a width-3 mean filter to I to produce a smoothed image J, and then re-apply the
same width-3 mean to J. Give the expression for the center pixel after both filters have
been applied.

b) Define a single 1D kernel that, when applied only once to the image, will produce the
same results as applying the 1D width-3 mean filter twice. Specify your filter in the
boxes below

Kernel

c) Convolutions are associative, meaning that if H1 and H2 are filters and F is an image,
then
H1 * (H2 * F) = (H1 * H2) * F
Let’s test this out with our mean filter example. Try applying a width-3 mean to the
mean filter image below and specify the result below (give the center 5 pixels values).

0 0 1/3 1/3 1/3 0 0


Mean filter image

0 0
Result

[Solution: Read Image Processing lecture slides]

3
NAME: _____________________________________________________

Problem 3: Texture Synthesis

Given the two color image below, the goal of this problem is to determine the most likely
value of the pixel labeled p.

Part A

(i) Outline the 3x3 windows in the image above that exactly match the neighborhood of
p (there should be 5 total, not including the one centered at p).

(ii) Compute the probability of p being each color:

P(p is dark pixel | 3x3Neighborhood(p)) = _________

P(p is light pixel | 3x3Neighborhood(p)) = _________

4
NAME: _____________________________________________________

Part B

(iii) Now consider a 5x5 neighborhood of pixels.


Outline the areas that match now.

(iv) What are the probabilities for the pixel color given the 5x5 neighborhoods?

P(p is dark pixel | 5x5Neighborhood(p)) = _________

P(p is light pixel | 5x5Neighborhood(p)) = _________

Part C

How does increasing the size of the neighborhood affect the texture synthesis results?

[Solution: Read Texture lecture slides]

5
NAME: _____________________________________________________

Problem 4: Dilation and Erosion

Let H[u,v] be a 3x3 matrix. Recall the definitions of


Erosion:
G[x,y] = 1 if F[x+u-1,y+v-1] is 1 everywhere that H[u,v] is 1
G[x,y] = 0 otherwise

Dilation:
G[x,y] = 1 if F[x+u-1,y+v-1] is 1 somewhere that H[u,v] is 1
G[x,y] = 0 otherwise

1 1
1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1

Input image F Desired image D

The image D above can be generated from F using a dilation or erosion operation
followed by a second dilation or erosion. Assume H is a 3x3 matrix containing all ones.
Ignore the border pixels. Below, specify the two operations (circle one), and for each one
draw the entries of the image after that operation has been performed.

I = H applied to F D = H applied to I

Circle one: dilation or erosion Circle one: dilation or erosion

[Solution: Read Segmentation lecture slides]

6
NAME: _____________________________________________________

Problem 5: Recognition

You are working for a special effects company and want to have real actors inserted into
a computer-generated world. One way to do this is to film the actors in front of a blue
screen, so that the background can easily be segmented and substituted with a computer-
generated one.

Due to lighting variations, the background will not appear pure blue, so checking for a
single intensity value might not work well. Instead, you decide to model the distribution
of background colors as a probability function. You are given a training image T with
pixels labeled as foreground (F) and background (B).

Part A

Define each of the following probability functions based on T. In your functions, you
can refer to properties of the image T like “number of pixels labeled as foreground in T”.

Let P(B) denote the probability that a particular pixel is a background pixel, irregardless
of its color or position in the image.

P(B) = _______________________________________________________________

Let P(c | B) denote the probability that a background pixel has color c

P(c | B) = _____________________________________________________________

Part B

What probability function would you need in order to perform the background
classification on a new image? Specify this probability function in the form of P(X | Y),
and specify its relation to the probabilities in Part A. You may use Bayes rule if need be.

[Solution: Read Pattern Recognition II lecture slides]

7
NAME: _____________________________________________________

Part C

Suppose the colors of the background pixels all occur roughly on a line in the 3D color
space of RGB. Describe how to compute that line by forming a matrix A and computing
eigenvalues and eigenvectors of that matrix. (hint: think about how you compute
eigenfaces—it’s the same idea except in color space)

Let c1, …, cm be the colors of the set of B pixels in T. Each color is a column vector with
three components (RGB). Define the matrix A. Also define any other terms that you use
in your definition of A:

A=

Suppose that v1, v2, …, vn are the eigenvectors of A, with corresponding eigenvalues λ1,
λ2, …, λn, sorted from largest to smallest.

What is the relationship of v1 to the line you’re trying to compute?

How would you use v1 and the mean background color to compute whether the color c of
a new pixel is background (give the formula)?

[Solution: Read Object Recognition lecture slides]

You might also like