Você está na página 1de 15

Digital Image Processing

Midterm Exam
November 9, (Tue.), 2010

Name: _______________________________________

Student ID: ___________________________________

Email Address: ________________________________

Notes:
1. Exam duration: 150 minutes (from 2:20pm 4:50pm.)
2. Open-book exam (books, lecture notes, graded homework,
etc.)
3. One-line calculator.
4. Show all answers on sheets.

Problem Weight Score


1 7
2 15
3 17
4 13
5 20
6 14
7 14
Total 100

1
Problem1 (7 points)
(True or false) You will get -1 points for each wrong answer as penalty

(a) We can reconstruct the original image from its skeletonizing image since the
skeleton is preserved.

(b) The kernel [-1 2 -1] is meant to approximate first order derivative.

(c) Rotate P(x,y) by an angle clockwise with respect to the reference point R(u,v).
The resulting position is:
P( cos(x-u)-sin(y-v)+u, sin(x-u)+cos(y-v)+v ).

(e) There are 4 connected components in the figure below. (4-connected rule for
object and 8-connected rule for background)

(f) Mean-square-error is a good criterion for measuring the quality of halftoned image.

(g) K-means algorithm is a supervised classification method.

(h) More features will lead to a better classification result.

2
Problem2 (15 points)
Suppose that the gray scale is of range [0, 9] instead of [0, 255].

(a) (2 point) Please plot the histogram of the following 8x8 image.

0 5 7 7 5 8 7 8
7 2 6 2 6 5 6 8
6 9 7 7 0 7 2 7
6 6 1 7 6 7 7 5
9 6 0 7 8 2 6 7
2 8 8 2 7 6 7 8
7 3 2 6 1 7 5 8
9 9 5 6 7 7 7 7

(b) (5 points) Please perform histogram equalization of the above image according to
the formula:
x: pixel value
cdfx  cdf *
Tx  round   L  1, N: image size
N  N  cdf L: max gray scale value
Please output the resultant image and its corresponding histogram.

(c) (2 points) What will happen if we apply histogram equalization to the result of (b)
again?

(d) (2 points) Can histogram equalization always provide a better result? State your
reasons.

(e) (4 points) Histogram matching is a useful contrast manipulation technique


which transforms an images histogram to match the one of another image.
Please describe clearly how you achieve it.

3
(Answer)

4
Problem3 (17 points)

Fig. 3-1 Fig3-2

(a) (12 points) Please write down how you wrap Fig. 3-1 to Fig. 3-2 explicitly.
The flower shape can be described by the formula
r  1x 2 , y 2 *
r  16 , 240 cos4 , 0
 tan45 y/x

(b) (3 point) While finding the corresponding coordinates, we may choose forward
treatment or backward treatment. Is forward treatment better than backward
one? Explain your reasons.

(c) (2 point) Can we perfectly wrap Fig. 3-2 back to Fig. 3-1 since the exact wrapping
function is given? Why or why not?

5
(Answer)

6
Problem4 (13 points)
(a) (2 points) Plot the gradient curve of the following 1-D signal.

(b) (2 points) Explain the meanings of gradient obtained from a 2D image in terms of
magnitude and orientation.

(c) (2 points) Convolve the following 4x4 array with the Sobel kernel that detects
horizontal edges. (Use even boundary extension)

33 62 55 73
21 77 65 150
10 29 212 198
17 34 83 142

(d) (3 points) Compare the first order and second order edge detection methods.

(e) (2 points) For median filter, whats the difference between large kernel size and
small one? Which one outperforms the other?

(f) (2 points) Given an image with impulse noise, Alice applies MINMAX after
MAXMIN while Bob adopts MAXMIN after MINMAX. Would they get the same
results? Why or why not?

7
(Answer)
(a)

1-D signal

Your
answer

8
Problem 5 (20 points)
(a) (10 points) Please
lease apply three morphological operations,
operation , shrinking, thinning, and
skeletonizing,, to the following images (Fig. 5-1)) until reaching the convergent
state and plot the results in the provided answer sheet.

Fig. 5-1

(b) (5 points) Apply mask A to the following image to implement dilation filter and
show the result after one iteration.

(a) Input binary image (b) Mask A


Fig. 5-2

(c) (5 points) Suppose B is a binary image and J, K are two different


nt kernels specified
as follows. Please explain the purpose of this operation: B 7 J;B9 < K
where 7 is the erosion operator and B9 is the complement of B.

J K
9
(Answer)
(a)
Shrinking

Thinning

Skeletonizing

10
(Answer)
(b)

(c)

11
Problem 6 (14 points)
(a) (4 points) Given the following data points, please perform k-means algorithm to
classify these data points to two clusters with two initial centroids, (-0.5,-0.5) and
(0,2). To simplify the computation, please use 1-norm (>x>5  A5|x |) instead
of usually use 2-norm to compute distance between points.

A B C D E F G H I J
(0,0) (0,1) (1,0) (-1,0) (0,-1) (2,1) (2,2) (3,1) (3,2) (5,5)

(b) (4 points) Will the classification result be different if we randomly choose these
two initial centroids?

(c) (3 points) Design and explain a method to choose initial centroids in order to get
more reasonable result efficiently.

(d) (3 points) What will happen if k becomes 3 in this case?

12
(Answer)

13
Problem 7 (14 points)
(a) (2 points) The Discrete Cosine Transform (DCT) is a widely used transform. The
definition of DCT is
2C (u )C (v) M 1 N 1 (2i + 1)u (2 j + 1)v
F (u, v) =
MN i =0 j =0
cos
2M
cos
2N
f (i, j )

where i, u = 0, 1, ,, M-1
M and j, v = 0, 1, , N-1, 1, and the constants C(u) and C(v)
are determined by
2

C ( ) = 2 , = 0 .
1, otherwise

What
hat is the value of F(0, 0) if the image f(i,
f( j) is given as:

10 20 30 40 50 60 70 80
90 100 110 120 130 140 150 160
160 150 140 130 120 110 100 90
80 70 60 50 40 30 20 10
10 20 30 40 50 60 70 80
90 100 110 120 130 140 150 160
160 150 140 130 120 110 100 90
80 70 60 50 40 30 20 10

(b) (4 points) F(0,0) is also known as


a a DC coefficient. By the computation experience
from Part (a), please explain what the meaning of DC coefficient is and why it is
called a DC value.
(c) (8 points) Fig. 7-1 shows 8x8 2-D DCT basis functions.. By definition of DCT
transform, please show in a mathematical way that F(0,2) is actually related to
the pattern in the position (0,2) below.

Fig. 7-1: 2-D DCT basis functions

14
(Answer)

15