Practice Final 09
Practice Final 09
Practice Final 09
Directions
Start only when you are the given the “green signal”.
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: _____________________________________________________
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
2. Principal components
4. Epipolar lines
5. Image pyramid
2
NAME: _____________________________________________________
Problem 2: Filters
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
Result
3
NAME: _____________________________________________________
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).
4
NAME: _____________________________________________________
Part B
(iv) What are the probabilities for the pixel color given the 5x5 neighborhoods?
Part C
How does increasing the size of the neighborhood affect the texture synthesis results?
5
NAME: _____________________________________________________
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
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
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.
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.
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)?