CE 490 Introduction to Digital Image Processing MIDTERM EXAM

advertisement
30 Nov 2013
CE 490 Introduction to Digital Image Processing
MIDTERM EXAM SOLUTIONS
Q1. (25 points) For the following 5 x 5 image f(x,y) with 3 bits per pixel, i.e.
pixel values in {0,1,..,7}:
f(x,y) =
0 0 1 1 2
0 1 1 2 4
1 1 2 4 5
1 3
4 5 6
3 3
5 6 7
(a) compute the histogram of the original image f(x,y),
(b) find a transformation function g(x,y) = T(f(x,y)) that will approximately
equalize the histogram of f(x,y). Find the transformed (equalized) image, g(x,y).
(c) Compare the histogram of output image to the original image histogram in
part a).
Compared to the original histogram, the equalized histogram is less uniform due
to only eight distinct intensity levels.
Q2. (30 points) A 4 x 4 gray-scale original image f(x,y) is given below:
f(x,y) = 12 10 8 6
10 8 6 4
8 6 4
2
6 4
2
0
Compute the filtered output images after passing through
a) the spatial linear filter as specified by the mask w1 (by using zero-padding of
the original image).
0 1 0

1
w1   1 2 1
2

0 1 0
>> y=conv2(f,w, 'same');
>> y
y=
12 4 3 4
16 8 6 5
13 6 4 2
8 3 2 0
b) a 3x3 median filter (by using zero-padding of the original image).
>> y=medfilt2(f)
y=
0 8 6
8 8 6
6 6 4
0 4 2
0
4
2
0
Q3. (20 points) An image has the gray level probability density function
er 1
pr (r) 
,0  r 1. It is desired to transform the gray levels of this image so
e2
that they will have the specified probability density function pz (z)  2z,0  z  1.
Assuming continuous quantities find the transformation that will accomplish
this.
Q4. (25 points) a) Explain the effect of reducing the sampling rate to one-fourth
in the original Barbara image shown below. What causes these differences?
Aliasing effect occur due to sampling rate below Nyquist rate.
b) Explain the effect of reducing the quantization levels of the original Lena
image from 256 (8-bit) to 8 (3-bit) as shown below. What causes these
differences?
Contouring effect due to inadequate quantization.
c) Considering the processed (resulting) image on the right, what would be the
most likely (3x3) spatial filter applied to the input image on the left, specify its
mask.
Input image
Output image
Laplacian filter is used which enhances fine details (including noise) more than
the 1st order gradient (sobel) filter.
0 1 0


wLaplacian 1  4 1
0 1 0


d) Edges play an important role in our perception of images as well as in the
analysis of images.
Input image
Output image
Describe one method which can detect lines/edges along x- and y- directions in
an image (see output image)? Write down its mathematical operations on an
input image f(x,y).
Edge detection along x- and y-directions can be done using
 1  2 1
 1 0 1




Hx   0 0 0 
Hy    2 0 2
Sobel operators:
and
.
1 2 1
 1 0 1




e) Suggest two spatial filtering methods to enhance given noisy image shown
below:
Compare the performance of the two filters in terms of noise reduction and
preserving edges in the original image.
Both mean filter and median filter can smooth out noisy parts (hence enhance
noisy image) as well as edges. Median filtering is more effective against impulse
noise or salt and pepper type noise (as shown in above image).
Download