Docsity

Image Filtering Problem Set 3 for CMSC 426 - Prof. David Jacobs, Assignments of Computer Science

Toggle sidebar
bg1
Problem Set 3
CMSC 426
Assigned: Feb. 12, 2004 Due: Feb. 19, 2004
1. Consider the following 1D image:
63 58 61 60 62 62 60 57 42 40 41 42 43 41 38
Show the 1D image that results from filtering this with the three element averaging filter:
1/3 1/3 1/3
You must deal with boundary pixels in some way. The simplest thing is to only apply the
filter in places in which it completely overlaps the original image. It is also ok to pad the
original image with zeros, or adopt some other strategy, as long as you specify what you
have done.
2. We can approximate taking a first derivative by applying the following filter:
-1 0 1
Show the 1D image that results from applying this filter to the result of 1. Which pixel
in the filtered image is the peak with the highest absolute value? What is its value?
That is, starting with the image in 1., first apply the averaging filter to produce a new
image, J. Then apply the derivative filter to J.
Note that flipping this filter is equivalent to multiplying it by –1. In class, we discussed a
filter that is like this, but scaled by ½. All these filters, flipped or unflipped, scaled by ½
or not, compute essentially the same thing, up to a scale factor. Which of these filters
produce exactly the first derivative depends on whether we consider the image to go from
left to right or right to left, and on whether we consider one pixel in the image to equal
one unit of length. However, we are only really concerned with the relative values of the
derivatives, so any of these filters is acceptable, as long as we are consistent. You may
compute your convolution using any of these filters; just explain what you have done.
3. Give a filter that approximates taking the second derivative of a 1D image.
4. A median filter of length three for a 1D image computes a new image in which,
for example, the first pixel is the median of the first, second and third pixels of the
original image.
a. Show the result of filtering the 1D image in problem 1 with such a median
filter.
b. Show the result of applying the first derivative filter in problem 2 to the
result computed in 4a.
c. Which pixel in the filtered image is the peak with the highest value? What
is its value? How does this compare to the result in problem 2?
5. Suppose we filter a 2D image, I, with a filter, f, and produce as a result R.
pf3

Partial preview of the text

Download Image Filtering Problem Set 3 for CMSC 426 - Prof. David Jacobs and more Assignments Computer Science in PDF only on Docsity!

Problem Set 3

CMSC 426

Assigned: Feb. 12, 2004 Due: Feb. 19, 2004

  1. Consider the following 1D image: 63 58 61 60 62 62 60 57 42 40 41 42 43 41 38 Show the 1D image that results from filtering this with the three element averaging filter: 1/3 1/3 1/ You must deal with boundary pixels in some way. The simplest thing is to only apply the filter in places in which it completely overlaps the original image. It is also ok to pad the original image with zeros, or adopt some other strategy, as long as you specify what you have done.
  2. We can approximate taking a first derivative by applying the following filter: -1 0 1 Show the 1D image that results from applying this filter to the result of 1. Which pixel in the filtered image is the peak with the highest absolute value? What is its value? That is, starting with the image in 1., first apply the averaging filter to produce a new image, J. Then apply the derivative filter to J. Note that flipping this filter is equivalent to multiplying it by –1. In class, we discussed a filter that is like this, but scaled by ½. All these filters, flipped or unflipped, scaled by ½ or not, compute essentially the same thing, up to a scale factor. Which of these filters produce exactly the first derivative depends on whether we consider the image to go from left to right or right to left, and on whether we consider one pixel in the image to equal one unit of length. However, we are only really concerned with the relative values of the derivatives, so any of these filters is acceptable, as long as we are consistent. You may compute your convolution using any of these filters; just explain what you have done.
  3. Give a filter that approximates taking the second derivative of a 1D image.
  4. A median filter of length three for a 1D image computes a new image in which, for example, the first pixel is the median of the first, second and third pixels of the original image. a. Show the result of filtering the 1D image in problem 1 with such a median filter. b. Show the result of applying the first derivative filter in problem 2 to the result computed in 4a. c. Which pixel in the filtered image is the peak with the highest value? What is its value? How does this compare to the result in problem 2?
  5. Suppose we filter a 2D image, I, with a filter, f, and produce as a result R.

I =

R =

f = A B A B C B A B A What are A, B, and C? Note that it doesn’t matter whether or not you flip filter f before applying it, since it is symmetric. Also, note that the result, R, is smaller than the original image, I. This is because the result does not contain boundary pixels, for which the filter would not completely overlap the image.

  1. Consider an image that contains a diagonal line at a 45 degree angle, with light on the bottom right, and dark in the upper left. The image might look like: The intensities in the image might, for example, be like: