Midterm Exam with Answer for Image Processing | CMSC 426, Exams of Computer Science

Material Type: Exam; Professor: Jacobs; Class: Image Processing; Subject: Computer Science; University: University of Maryland; Term: Fall 2005;

Typology: Exams

Pre 2010

Uploaded on 02/13/2009

koofers-user-7pd-1
koofers-user-7pd-1 🇺🇸

5

(2)

9 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Midterm
CMSC 426
October 18, 2005
1. 20 points: Background Subtraction: Suppose you have a video camera set up in
front of a concrete wall, taking 30 images per second, and you want to detect
when people walk by. The wall is always a uniform grey with an intensity of 128.
However, there is a light snow. Each snow flake appears in a single pixel and
turns it to an intensity of 255. About one pixel in 100 has a snow flake in it.
There is no noise affecting any of these measurements.
a. Suppose two people walk by. Person A has a uniform intensity of 250.
Person B has a uniform intensity of 123. Each person is about 100 pixels
big. Which of these outcomes are possible, depending on the parameters
used: 1) A and B are both identified as foreground; 2) A is identified as
foreground but B is not; 3) B is identified as foreground, but A is not.
250 and 123 are equally distant from the most similar training examples of 255 and 128.
However, there are 99 times as many examples with the value of 128. This means that
123 will always be regarded as more likely to be background than 250. This is true
regardless of the choice of sigma. Consequently, we can set the threshold to make 250
and 123 both appear to be background, both appear to be foreground, or we can make 123
appear to be background while 250 appears to be foreground. But the reverse is not
possible.
b. Explain how you might improve performance by using a new background
subtraction algorithm that uses a Markov model of pixel intensity. Be as
explicit as possible, for full credit.
If we use a 3x3 window for classification, we will see that background is generally either
all 128, or 8 values of 128 with one flake of snow (255). Any other event is very rare in
the background. This will make it much easier to tell the difference between a flake of
snow and a region that is all 253 (or even all 255) because it comes from a person.
2. 15 points: Provide a 2D filter that will compute the second derivative of the
image in the x direction.
Convolution is associative, so we can form this filter by convolving together two first
derivative filters. This would be:
-.5 0 .5 * -.5 0 .5 = -.25 0 .5 0 -.25
It is important to remember that when convolving filters together, we must have zeros at
the boundary. This is because convolution with 0 -.5 0 .5 0 has the same effect as
convolving with -.5 0 .5, whereas convolving with -.5 -.5 0 .5 .5 has a very different
effect.
pf3
pf4

Partial preview of the text

Download Midterm Exam with Answer for Image Processing | CMSC 426 and more Exams Computer Science in PDF only on Docsity!

Midterm

CMSC 426

October 18, 2005

  1. 20 points: Background Subtraction: Suppose you have a video camera set up in front of a concrete wall, taking 30 images per second, and you want to detect when people walk by. The wall is always a uniform grey with an intensity of 128. However, there is a light snow. Each snow flake appears in a single pixel and turns it to an intensity of 255. About one pixel in 100 has a snow flake in it. There is no noise affecting any of these measurements. a. Suppose two people walk by. Person A has a uniform intensity of 250. Person B has a uniform intensity of 123. Each person is about 100 pixels big. Which of these outcomes are possible, depending on the parameters used: 1) A and B are both identified as foreground; 2) A is identified as foreground but B is not; 3) B is identified as foreground, but A is not.

250 and 123 are equally distant from the most similar training examples of 255 and 128. However, there are 99 times as many examples with the value of 128. This means that 123 will always be regarded as more likely to be background than 250. This is true regardless of the choice of sigma. Consequently, we can set the threshold to make 250 and 123 both appear to be background, both appear to be foreground, or we can make 123 appear to be background while 250 appears to be foreground. But the reverse is not possible.

b. Explain how you might improve performance by using a new background subtraction algorithm that uses a Markov model of pixel intensity. Be as explicit as possible, for full credit.

If we use a 3x3 window for classification, we will see that background is generally either all 128, or 8 values of 128 with one flake of snow (255). Any other event is very rare in the background. This will make it much easier to tell the difference between a flake of snow and a region that is all 253 (or even all 255) because it comes from a person.

  1. 15 points: Provide a 2D filter that will compute the second derivative of the image in the x direction.

Convolution is associative, so we can form this filter by convolving together two first derivative filters. This would be:

-.5 0 .5 * -.5 0 .5 = -.25 0 .5 0 -.

It is important to remember that when convolving filters together, we must have zeros at the boundary. This is because convolution with 0 -.5 0 .5 0 has the same effect as convolving with -.5 0 .5, whereas convolving with -.5 -.5 0 .5 .5 has a very different effect.

  1. 15 points: Consider the following, small image: 1 2 3 4 5 3 4 5 6 7 (^5 6) 7 8 9 7 8 9 10 11 9 10 11 12 13 Compute the magnitude and the direction of the gradient for the central point ( 7 ). Suppose x values increase as you go to the right, and y values increase as you go down.

The gradient is (1, 2). So the magnitude is sqrt(5), and the direction is (1,2)/sqrt(5).

  1. 15 points: Give the result of convolving the filter

-1 3 - with the 1D image: 0 1 2 3 3 3 3 6 6 6 3 3 2 1

Don’t worry about the boundary pixels. You may ignore them, or treat them any way you want.

Let’s pad the image with zeros, just to make some choice. Note that convolution and correlation do the same thing, since the filter is symmetric. So we get:

-1 1 2 4 3 3 0 9 6 9 0 4 2 1

  1. 20 points: Consider the 5x6 image below. Suppose this is an image that has already been smoothed to reduce noise, and now we will run the subsequent steps of the Canny edge detector to find edges. The results will depend on some thresholds, but suppose these are set so that any pixel with a gradient magnitude that is a local maxima and that is greater than 1 is an edge. Note that I have used letters to indicate specific pixels. 5(a), for example, means a pixel has a value of 5, and I want to talk about it as 5(a). a. Will the pixel marked 5(a) be an edge? Answer “yes”, “no” or “It depends on the value of the pixel marked ‘?’. Explain.

The gradient at 5a is (5/2, 0). So the magnitude is 5/2, and the direction is (1,0). This means the magnitude of the gradient is bigger than 1. We also need that the magnitude of the gradient should be bigger than the two neighbors in the (1,0) direction and the (-1,0) direction. The gradient at those two pixels don’t depend on ?, and they are (2,0) and (1,0), so they have smaller magnitudes. So the answer is “yes”.

b. Will the pixel marked 9(b) be an edge? Answer “yes”, “no” or “It depends on the value of the pixel marked ‘?’. Explain.

So we’ll copy the center pixel where the SSD was 1, which is 0.

b. Which value would you fill in for the ?.

  1. Challenge Problem: Suppose there is a black triangle on a white background. Explain how the Canny edge detector will perform near the corners of the triangle. Specifically, explain how the edge detector’s success or failure might depend on the angle of a corner. What angles will be best or worst?

When we smooth an image with a triangle, near a corner the smoothing filter averages more background then foreground. So near the corner, the smoothed triangle will be lighter. There will be a more gradual transition from the background to foreground, meaning the gradient will be smaller, and so we might miss the edge. The sharper the corner is, the bigger this effect will be, and the more likely we’ll be to miss the corner.