Docsity

Exercises on Image Processing, Exercises of Digital Image Processing

Toggle sidebar
bg1
1
EE 569 Introduction to Digital Image Processing
Fall 2007
Midterm Exam
Name (Last, First): _____________________
Student ID: ___________________________
Exam Location:
USC Campus
Remote (Check this if you are a DEN student)
Notes:
1. Total Time: 180 minutes
2. Open-book (textbooks, lecture notes, graded homework, etc.)
3. Only one-line calculator is allowed
4. Grading is based on the answers written on sheets ONLY
5. Please write down your name and student ID on each page
Problem Weight Score
1 40
2 30
3 20
4 10
Total 100
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Exercises on Image Processing and more Exercises Digital Image Processing in PDF only on Docsity!

EE 569 Introduction to Digital Image Processing

Fall 2007

Midterm Exam

Name (Last, First): _____________________

Student ID: ___________________________

Exam Location:

‰ USC Campus ‰ Remote (Check this if you are a DEN student) Notes:

  1. Total Time: 180 minutes
  2. Open-book (textbooks, lecture notes, graded homework, etc.)
  3. Only one-line calculator is allowed
  4. Grading is based on the answers written on sheets ONLY
  5. Please write down your name and student ID on each page

Problem Weight Score

Total 100

Problem 1 Image Enhancement and Edge Detection (40 points)

Consider an image of size 5x5 as given in Fig 1.

Fig 1.

a. (4 points)

historgram

0

1

2

3

4

5

6

0 1 2 3 4 5 6 7 8 9 Grey Level

b. 4 bits display -> 2 4 = 16 grey levels -> 0~15 [1 point] 0 = a0+b 15 = a9+b [2 point] => b = 0, a = 15/9 = 5/3 = 1. Transfer function: Lnew = Lold * 1.67 [1 points]

historgram

0

1

2

3

4

5

6

(^0 2 3 5) Grey Level 7 8 10 12 13 15 (4 points)

c. Similarly, it will be mapped to 0~15, but now with a uniform histogram

0

1

2

3

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Grey Level (4 Points)

Transfer function: (4 points)

0 -> 0 1 -> 1 (1 pixel), 2 (1 pixel) 2 -> 2 3 -> 3 (1 pixel), 4 (2 pixels), 5 (1 pixel), 6 (1 pixel) 4 -> 6 (1 pixel), 7 (2 pixel), 8 (1 pixel), 9 (1 pixel) 5 -> 9 6 -> 10 (1 pixel), 11 (2 pixel) 7 -> 12 (1 pixel), 13 (1 pixel) 8 -> 13 (1 pixel), 14 (1 pixel), 15 (1 pixel) 9 -> 15

Solution

a. Horizontal:

3.5 3.75 -2.25 -2.25 0.

0 -0.25 0.75 1.75 0.

-1.25 -2.5 1.75 4 1

-0.25 -1 2.25 4.75 1.

-1 -1 3.5 6.75 3.

Vertical

3.5 0.75 1.25 4.75 6.

3 -1.75 -3.25 0.25 2.

-2.25 -1 -0.75 -1 -

-2.75 -1.5 0.25 1.75 3.

-1 -3 -3.5 -1.75 0.

Note: Instead of doing 9 multiplications, 5 summation, and 1 division per pixel, the calculation load can be reduced based on the understanding of the Sobel mask. Here shows the calculation of horizontal gradient for example:

First, pad the matrix by duplicating the pixel to form a 7x7 matrix

Second, extract every other column to form a 7 x 5 matrix due to Sobel method is subtract every other line to evaluate the relations. And we know the first two rows will be identical because of the padding, and so are the last two rows. So there are totally 25 subtractions

Third, sum up every three columns to form a 5x5 matrix and add the middle 25 pixels from above (for the 121 pattern) and divided by 4 to get final answer. You will also find that there are a lot similar patterns to help you reduce the load of calculation

S135: (1 point)

4.5 3.5 0 2 5.

2 -1.25 -1.75 0.75 2.

-2 -2 1 2 0

-2.75 -2.5 1.75 5.5 3.

-1.5 -2.5 0 3.5 2.

d. The two edge maps are pretty much the same because most of the edges are detectable from all four directions in the given image.

Grading criteria: the key point to this question is to indicate image dependency. If without mentioning image dependency, a general argument from the difference in the masks will get 2 points out of 4.

e. Yes, the result will be different. The first order considers the immediate neighbors and itself while the sobel method consider the relationship of 8 neighbors. In the given image, many pixels behave differently from that perspective.

Grading criteria: both the difference in the nature of the methods and image dependency should be mentioned to get full credit.

Problem 2 Morphological Processing (30 points)

(1) (12 points) Show the final converged results of the thinning, shrinking and skeletonizing morphological filters applied to Fig 2, respectively.

Fig 2

Thinning Grading Criteria:

  1. The left bottom image is a non-symmetric star shape, so the five branches (0.5 points) should not all rooted from a single point (0.5 points). However, whether the center is broken into two strokes doesn’t matter.
  2. Each mistake in the right bottom image costs 0.5 points, and in total up to 1 point. The guideline of thinning operation is that the curvature remains.

(2) (18 points) We treat a binary image as a set that consists of pixels of values 0 and 1. Then, we can apply bit-wise operations for image manipulation. Examples include union ( ∪ ), intersection ( ∩ ), complement (~), exclusive-OR (XOR), and translation ( Tm n (^) , ), where Tm n ,

is defined by Tm n , { X ( , j k )} = X ( j + m k , + n ).

Use 0 for white, and 1 for black, show the result of applying the following series of bit-wise operations to the binary image A given in Fig.3.

Fig 3 Grading Criteria:

  1. Correct shape: 2/3 of the points
  2. Correct position: 1/3 of the points

a) Plot the following image: B ( , j k ) = T (^) −1, 1 − { A j k ( , )} ∪ T 0,0 (^) { A j k ( , )} ∪ T 1,1 { A j k ( , )}

B(j,k)

(9 points)

b) Plot the following three images:

C ( , j k ) = T (^) −1, 1 − { A j k ( , )} XORT 0,0 { A j k ( , )}

D j k ( , ) = T 0,0 (^) { A j k ( , )} XORT 1,1 { A j k ( , )},

E ( j , k ) = C ( j , k ) ∪ D ( j , k ) C(j,k)

(3 points)

D(j,k)

(3 points)

E(j,k)

(3 points)

(1) Observation:

  1. This image in Fig 4(b) contains two parts: A circle whose radius is 128 and the part outside the circle. (1 point)
  2. The part inside the circle involves two operations: enlarging and rotating. The part outside the circle remains the same as in Fig 4(a). (3 points)

Grading criteria: As long as 3 operations are mentioned, 3 credit will be given

  1. The enlarging part’s algorithm can be described as: (7 points in total) Considering a vector d1 in the original image inside the circle, which originates from the center of the image in Fig 4(a). (1 point) The enlarging maps the vector d1 in Fig 4(a) maps to a vector d2 in Fig 4(b) as illustrated in Fig 6. The vector d1 and d have the same orientation (2 points) but their magnitudes are different by a scaling coefficient (2 points). The coefficient is a nonlinear function of the spatial coordinate of the pixel (2 points).

Fig 6 Grading criteria: (1) If the other non-linear transform method is proposed, up to 4 points will be given. (2) If a linear transform method is proposed, up to 2 points will be given

  1. Rotation (4 points in total) The circle from 3. is then rotated 45 degrees counter-clockwise. (2 points) The corresponding rotation matrix is: cos sin sin cos

⎝ ⎠ (^) Where θ = 45. (2 points)

(2) No, the perfect recovery is not possible. The reconstructed result won’t be exactly the same as the original image due to the interpolations are involved in both enlarging and rotating, and the operation of interpolation is a multiple to one mapping, which is not revertible.

Problem 4 Texture Segmentation (10 points)

Fig 5

Consider the 8 images given in Fig 5. If we apply the Laws filters to create a 9-d feature vector for each image, which component(s) of the 8 vectors will have the largest difference? Why? Which component(s) of the 8 vectors will have the smallest difference? Why? (Hint: Consider the physical meaning of each mask.)

Grading Criteria:

  1. Correct description of the meaning of the 9 laws filters (2 points) It is fine to skip the description of the meaning of unrelated filters to this problem
  2. The main difference among those eight images is the direction of the lines. So the filters related to direction detection, such as the vertical and horizontal filters, will lead to the largest difference. (4 points)
  3. The commonness of the eight images includes the average grey level, edge intensity and the spot distribution, so the related filters will lead to the smallest difference.