You are on page 1of 6

ME5405

NATIONAL UNIVERSITY OF SINGAPORE





ME5405 MACHINE VISION


(Semester I: AY2009-2010)



Time Allowed: 2.5 hours










INSTRUCTIONS TO CANDIDATES:


1. This examination paper contains FOUR (4) questions and comprises SIX (6) printed
pages.

2. Answer ALL questions.

3. All questions carry equal marks.

4 This is an OPEN BOOK Examination.


Pg 2 ME5405

Question 1

As mandated by the national medical device regulatory body, manufacturer of hypodermic
needles needs an automation system that performs 100% inspection of defects on the needle
tip. An example of such a system is shown in Figure 1. A CCD camera is mounted above the
tips of the needles. As the needles index past, a photoelectric switch detects when a needle is
in the correct position and triggers an inspection. The needles stop momentarily when they
are inspected.













Figure 1. A machine vision system for needle tip inspection.

(a) To accurately determine the geometry of the object (tips of needles) from the image,
camera calibration is important. Assuming that the camera moves horizontally, derive
the calibration matrix of the camera.
(5 marks)

(b) The pixel intensities of an image of tips of needles as seen by the camera have gray
levels between 0 (black) and 15 (white). Design a linear point processing
transformation to stretch the gray levels to cover the gray scale range from 0 to 255.
(5 marks)

Is the contrast of the transformed image better than that of the original image? Briefly
explain your answer.
(2 marks)

(c) Given that the camera comprises of a rectangular 8.8 x 8.8 mm CCD sensor array
with 512 x 512 pixels and a lens with focal length of 300 mm. If the magnification is
100, what is the size of one pixel on the object plane?
(4 marks)
Determine the depth of field if the f-stop =16.
(2 marks)

(d) In the gray scale image seen by the camera, the background is bright and the three
needles are dark. A defect (protrusion or debris) on a needle tip changes the amount
of black pixels of the image.

Write an algorithm to reject a needle if the number of black pixels exceeds 10% of the
acceptable level. State your assumption. (7 marks)
Needle
Production
Machine
CCD
Camera
Defect
Magnified view of tips of
needles as seen by the
camera
Pg 3 ME5405

Question 2

(a) A historically-preserved building with a height of 1.80 m is photographed using a
CCD camera. The camera is placed 9 m in front of the building. The camera has a thin
convex glass lens of refractive index 1.5. The lens has radii of curvature of 10 mm
and 20 mm. What is the height of the buildings image on the CCD sensor?
(4 marks)

Determine the ray transfer matrix of this optical system.
(3 marks)

(b) You are given two digitalized images of a preserved building made of rocks taken 10
years apart. Using image subtraction, you detect a piece of brown rock located at
pixel position (
1
x ,
1
y ) in the first image and at pixel position ( '
1
x , '
1
y ) in the second
image. There is also a piece of black rock at pixel position (
2
x ,
2
y ) in the first image
and pixel position ( '
2
x , '
2
y ) in the second image.

Assuming that there is no other image distortion apart from translation and scaling.
Write a geometrical transformation algorithm that will register the second image with
the first image.
(8 marks)

(c) Convolution is typically implemented using the shift-multiply-add concept. Apply the
shift-multiply-add algorithm for the signal f and kernel h given by

(
(
(

=
1 0 0
2 2 0
0 0 1
f and
(


=
1 1
1 1
h .
(5 marks)

(d) Write an algorithm to enhance the high frequencies in the Fourier transform domain
for edge enhancement. State the transfer function of the filter.
(5 marks)



Pg 4 ME5405

Question 3

(a) ( )
r
p r is the probability density function of a given image. It is of poor dynamic range.
We wish to transform the grey levels of this image so that they will have a probability
density function ( )
z
p z given below. In addition, in the new image, the gray levels are
limited to lie between the range
max min
and z z . Find the necessary transformation (i.e.
find z in terms of
max min
( ), and
z
p z z z ).

2
3
1 1
3 3
max min
1
( )
3
z
z
p z
z z

(10 marks)

(b) Figure 3(a) is the original image of a polished cross section of an enamel coating on
steel. The two distinct layers are different colour enamel containing different size
distribution of pores. The purpose of an image processing operation is to isolate only
the pores within the darker layer as shown in Figure 3(e). Figures 3(b) to 3(d) show
the results of the intermediate steps. Describe the steps employed in this operation.
[Hint: You may need to use Logical operation in this operation]

Figures 3(a) 3(e) (15 marks)

Pg 5 ME5405

Question 4

(a) The bright rectangle in the binary image shown in Figure 4(a) is of size 9 by 7.

(i) Calculate the magnitude of the gradient of this image at every fixed based on the
approximation given as ( , )
x y
f x y g g V = + , where
x
g and
y
g are obtained
using the Sobel operators.

(ii) Determine the Laplacian of this image using the operator:
( ) ( ) ( ) ( ) ( )
2
( , ) 1, 1, , 1 , 1 4 , f x y f x y f x y f x y f x y f x y V = + + + + + , or in
the form of a 3 by 3 mask shown in Figure 4(b)

(iii) Compare the results of using the gradient and the Laplacian as an edge detector.

Note: In this question, you need to process also the one-pixel thick boundary around
the bright rectangle. Due to the symmetric nature of the image, you need only to
consider one quarter of the image in your calculation.

1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0
0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0
0
0

Figure 4(a)


Figure 4(b)
(13 marks)

Pg 6 ME5405

(b) (i) Without using mathematical proof, explain which of the following morphological
expressions is correct.

( ) ( )
( ) ( )
(1)
(2)
A C A B C
A C A B C
=
=




(ii) Figure 4(c) shows a binary image A, while Figures 4(d) and 4(e) show two
structural elements B and C. Xindicates the origins of the image and structure
elements.



Figure 4(c) Image A



Figure 4(d) B Figure 4(e) C

Note that C B _ . Show the resulting images after the following morphological
operations.
(1)
(2)
A B
A C



What meaningful conclusion can you derive from the resulting images?

(12 marks)



- END OF PAPER -

You might also like