You are on page 1of 7

ME5405

NATIONAL UNIVERSITY OF SINGAPORE





ME5405 MACHINE VISION


(Semester 1: AY2010-2011)


NOV/DEC 2010 - Time Allowed: 2.5 hours






INSTRUCTIONS TO CANDIDATES:


1. This examination paper contains FOUR (4) questions and comprises SEVEN (7)
printed pages.


2. Answer All FOUR (4) questions.


3. All questions carry equal marks.


4 This is an OPEN BOOK examination.


Pg 2 ME5405


Question 1

The normal position and orientation of a CCD camera held by a robotic manipulator is shown
in Figure 1(a). Figure 1(b) is the final position of the camera for inspecting the label on a
wine bottle. The center of the camera is located at (0.5 m, 0, 1 m). The focal length of the
camera is 0.05 m.

(a)

(b)


(c)



(d)

Figure 1. A machine vision system for inspecting label on wine bottle.

(a) Write an algorithm to determine the Cartesian coordinates of an image point that
correspond to an arbitrary space point (0.5 m, 0.5 m, 0.5 m). The pan and tilt angles
are 125 degrees respectively. What is the Cartesian coordinates of the image point?
(10 marks)

(b) Suppose the camera uses a rectangular 8 x 8 mm CCD sensor array with 512 x 512
pixels. Assuming that the magnification is 10, and the f-stop is 16. At what distance
will the object appear sharp on the image plane? (5 marks)

(d) Geometric transform is required to correct the acquired image in Figure 1(c) to that of
Figure 1(d). Given that the coordinates x1, x1, x2, x2 y1 and y2 are known. Write an
algorithm to perform the geometric transform. (10 marks)
(0.5, 0, 1)
X
Y
Z
(0, 0, 0)
X
Y
Z
z
x
y
(x1, y2) (x1, y2) (x2, y2) (x2, y2)
(x1, y1) (x2, y1)
Pg 3 ME5405

Question 2

(a) Given a two-lens combination of focal lengths
1
f =10 and
2
f =10 respectively. The
two lenses are separated by a distance d =20. Suppose that
1
T and
2
T are the
translation matrices for the ray in air before and after the two-lens system.
d
T is the
translation matrix for a ray travelling between the two lenses.
1
S and
2
S are the lens
matrices respectively.

Given that the input ray coordinates,
o
r =(0, 1), starting from an object located at a
distance
o
d =20 in front of the two-lens system. Calculate the output ray coordinates
) , (
i i i
v x r = , at a distance z =10 behind the two-lens system.
(8 marks)

(b) The image in Figure 2(b) is created from the original image in Figure 2(a) using a
mask of the following operator:
(
(
(
(
(
(





=
0 0 1 0 0
0 1 1 1 0
1 1 16 1 1
0 1 1 1 0
0 0 1 0 0
1
h .
Is this (1) low pass filter, (2) high pass filter, or (3) band pass filter? Briefly explain
your answer. (3 marks)

Assuming that the center of mask is the element (0, 0), deduce the Fourier transform
of this mask in the frequency domain, and then write an algorithm to implement this
filter in frequency domain using Fourier transform. (7 marks)

The image in Figure 2(c) is an image of Figure 2(a) with salt and pepper noise. Write
an algorithm that apply the salt and pepper noise onto an image. (7 marks)


(a)

(b)


(c)
Figure 2. Image of a girl: (a) original image; (b) the result of filtering; and (c) with
salt and pepper noise
Pg 4 ME5405

.
Question 3

(a) An 8-gray level image is shown in Figure 3(a) below; perform histogram equalization
of the image.

2 2 2 3 1
2 4 7 4 2
3 6 7 6 3
3 5 7 5 4
4 4 4 4 4
(
(
(
(
(
(
(



Figure 3(a)

In your result, show the mapping of gray levels between the original ones with respect to that
of the equalized image. (10 marks)

Why discrete histogram equalization does not produce a perfectly flat histogram?
(5 marks)

(b) (i) An image with the associated histograms are shown in Figure 3(b)(i) and
Figure 3(b)(ii), respectively. Comment on the quality of the image shown.

Note that the top and bottom plots in Figures 3(b)(ii) are the Cumulative Gray Level
distribution and the histogram, respectively.


Figure 3 (b)(i) Figure 3(b)(ii)

Pg 5 ME5405

(ii) Suggest an image processing that enhances the image of Figure 3(b)(i) to
produce the one shown in Figure 3(b)(iii), and sketch its histogram..



Figure 3(b) (iii)

(10 marks)

Pg 6 ME5405


Question 4

(a) Figure 4(a) shows a 128 gray level image. It contains two noise spots of gray levels
127 (Row 2 Column 2) and 22 (Row 2, Column 5). Perform separately, noise cleaning
using a 3 by 3 (i) Median Filter and (ii) Averaging Filter on the pixels at Row 2,
Columns 2 to 5 only. Comment on your results. Note that the left side of the image is
a dark 3 by 3 region, while that on the right side is a bright region.

18 24 33 100 85 90
34 127 24 105 22 91
20 19 32 117 97 87
(
(
(
(



Figure 4(a)

(12 marks)

(b) (i) Show the result after the binary image X shown in Figure 4(b)(i) has been
eroded by the structure element Y given in Figure 4(b)(ii). Note that the pixel
marked with an is the origin.

Discuss the end results if the origin of the structure elements Y is located at the top-
left corner, without performing the erosion.



Figure 4(b)(i) X Figure 4(b)(ii) Y

Pg 7 ME5405

(ii) A shown in Figure 4(b)(iii) is a binary image. Perform the following operation
with the structure element B.

( ) ( )
A B B B -

Show the results of the intermediate steps.

Is the final opening operation necessary and why?



Figure 4(b)(iii) A Figure 4(b)(iv) B
(13 marks)





- END OF PAPER -