You are on page 1of 6

Proceedings of the 2008 IEEE

International Conference on Robotics and Biomimetics


Bangkok, Thailand, February 21 - 26, 2009

A New Edge Detection Technique for an Automatic


Visual Inspection System using Genetic Algorithms
A. Saenthon, S. Kaitwanidvilai, A. Kunakorn and S. Kanprachar
I. Ngamroo
Department of Electrical Engineering Department of Electrical and Computer Engineering
King Mongkut's Institute of Technology Ladkrabang Naresuan University
Bangkok 10520, Thailand Phitsanulok 65000, Thailand
kksomyot@kmitl.ac.th surachetka@nu.ac.th

Abstract - This paper proposes a new technique of edge achieve the better results of image classification. Foshci,
detection for inspecting edge and perfection of soldering joint in Patricia G. et al., [3] applied the Canny edge detection filter to
the pre-amplifier circuit, which is an important part in hard disk determine the surface and edge of image for the geography
drive. Summation of error between the actual value and the information system (GIS). Yaodong WANG, and Noboru
measured value from the designed system of several data sets is
FUNAKUBO [4] applied the GA to search the point of edge
formulated as the objective function. Genetic Algorithm (GA) is
adopted to find the optimal filter mask which enhances the based on the Laplacian filter. Their results showed the better
accuracy of the inspection system. As results indicated, accuracy performance gained from GA. Anakapon and Somyot [5] used
of the system with the proposed edge detection technique is the neural network to classify the perfection of flip-chip. As
superior to that of the system with conventional filters. In results indicated, neural network can efficiently apply to
addition, inspection time of the developed system is much faster automatic visual inspection system. Somyot et. al.[6], applied
than that of human inspection. the fuzzy image filtering to remove noise from the x-ray image
of HDD component. The results showed that the efficiency of
Index Terms - Automatic visual inspection, Image processing, noise reduction from their proposed technique is better than
Genetic Algorithms.
that of the conventional noise reduction filter (median filter
and Gaussian filter).
I. INTRODUCTION
In this paper, an automatic visual inspection system for
Nowadays, hard-disk drive (HDD) industry is one of the pre-amplifier inspection is developed for measuring size of
most competitive and valuable industry. High performance soldering joint in HDD components so that they are
system, new technology and skilled operators are required for guaranteed to be good quality parts. In addition, this paper
improving the productivity of the HDD production. Many proposes a modified Sobel filter by GA to make an edge image
immense developments in manufacturing of this industry have used in developed system. To verify the accuracy of the
been done and used extensively in the HDD production designed system, measured values from the proposed system
process. However, there are still some problems in the are compared with the true value from the destructive
manufacturing and inspection process. For example, human inspection. The results show that the accuracy of the system
inspection is always adopted to inspect some HDD with the proposed technique is better than that of the
components and defects; this type of inspection causes slow conventional edge detection filter.
inspection time and unreliable results. One of the most The remainders of this paper are shown in followings.
important inspections, in which human operators are always Section II illustrates the developed visual inspection system
needed, is the visual inspection; however, there are many and the image processing techniques used in the system.
research works attempted to develop the autonomous visual Section III describes the proposed technique, modified edge
inspection operated by computer. This makes the system good detection mask using GA. Finally, the experimental results and
in terms of accuracy, repeatable results and fast inspection summary are given in Sections IV and V, respectively.
time.
II. AUTOMATIC VISUAL INSPECTION SYSTEM
Several approaches for enhancing the ability of visual
inspection and image processing were proposed in [1-6]. In Automatic visual inspection system developed in this
[1], the image processing is enhanced by radiographs utilizing paper is shown in the diagram in Fig. 1. First, the pre-amplifier
filtering, gray scale transformation and Sobel gradient image is captured by x-ray camera and then be used in the
operator. They applied the Gaussian filter for removing noise image processing part. X-ray camera is needed for the system
and then applied the Sobel gradient operator for determining because the inspecting object is inside the chip and can not be
edge image. The proposed technique was implemented on the viewed by ordinary CCD camera. With this approach, the non-
x-ray film. Heath, M. et al., [2] used the Gaussian Filter to destructive inspection can be achieved. Based on the x-ray
reduce noise and applied the double threshold method to image, the color intensity value of the pixel in the image

978-1-4244-2679-9/08/$25.00 ©2008 IEEE 1882

Authorized licensed use limited to: Tamil Nadu College of Engineering. Downloaded on December 18, 2009 at 09:36 from IEEE Xplore. Restrictions apply.
depends on the thickness of the detected object. For example, Where
the soldering joint is darker than the copper line and GR (x, y) is the red intensity value at position (x, y),
background because of its higher thickness. Fig. 2 shows the GG (x, y) is the green intensity value at position (x, y),
examples of the pre-amplifier image and soldering joint in this GB (x, y) is the blue intensity value at position (x, y),
inspection. In human inspection, the perfection of soldering Ggray (x, y) is the gray intensity value at position (x, y).
joint is evaluated by considering the x-ray image. In contrary,
2. Adjust the intensity by the normalized intensity method.
by the proposed system, all necessary properties are evaluated
This process will change the intensity of image to the standard
by image processing and then the decision of the perfection is
boundary using (2).
decided by comparing such values with the specifications.
G ( x, y ) − min ( G ( x, y ) ) 
Gnor ( x, y ) = Re ×  (2)
 max(G ( x, y )) − min(G ( x, y )) 
where
G (x, y) is the intensity value at the position (x, y),
Gnor (x, y) is the adjusted intensity value at the position
(x, y),
Re is standard intensity range.
In this paper, Re is selected as 255 to make the highest and
lowest of intensity values in image are 255 and 0, respectively.
The images before and after applying the normalized intensity
technique are shown in Fig. 3.

Fig. 1 Diagram of the developed system.

(a) (b)
Fig. 3 The intensity adjustment (a) before adjustment (b) after adjustment.

(a)

(a) (b)
Fig. 4 Histograms of image intensity (a) before adjustment (b) after
adjustment.

Fig. 4 shows the histogram of image before and after


adjustment. As shown in these figures, the range of intensity in
(b) the image is changed from 45-210 to 0-255, resulting in a
Fig. 2 Example of x-ray image: (a) pre-amplifier from x-ray camera (b) the
soldering joint, the interesting area. clearer image.
3. Apply edge detection filter.This technique is adopted to
Detail of the proposed image processing is described by evaluate the edge of interesting object that is soldering joint.
following steps. Three edge detection techniques; that is, the proposed
technique, Sobel filtering, and Laplacian, are implemented.
1. Capture the picture from x-ray camera and then convert The details of all techniques are presented in the Section III.
the mode of picture from RGB to gray. One formula that can Fig. 5 shows the interesting area determined by edge detection.
be used for this purpose is.
4. Convert the gray image to binary image by thresholding
 G ( x , y ) + GG ( x , y ) + G B ( x , y ) 
G gray ( x, y ) =  R  method.
 3  (1)

1883

Authorized licensed use limited to: Tamil Nadu College of Engineering. Downloaded on December 18, 2009 at 09:36 from IEEE Xplore. Restrictions apply.
5. Extract the interesting features. There are four features Where ∇f is a gradient vector, Gx is the gradient in
used for identifying the perfection of soldering joint; that is, horizontal direction, Gy is the gradient in vertical direction, I is
area, width, eccentricity, and air bubble area. Feature the input image. Magnitude of gradient (∇f) is the changing
extraction techniques are very simple and useful method to rate of the gray color intensity in the image. Because the
extract those features, for example, air bubble area is gradient (∇f) direction is perpendicular to object’s edge, the
determined by counting the pixels in the area which have the edge can be identified. Approximation of magnitude of
similar color to the air. gradient is shown in (5).

mag (∇f ) = Gx2 + G y2 ≈ Gx + G y (5)

There is a simple method to apply the edge detection filter


by convolving the filter mask with the input image. This
method is well known and widely used in many applications.
Fig. 5 The interesting area determined by the edge detection. The mask’s size can be 33, 55, 77 and so on. In this
paper the 33 mask is implemented in the designed system.
To find the shape of interesting object, the eccentricity
value is utilized. This value is the ratio of the difference and
summation of the lengths of major and minor axis. As shown
in Fig. 6, the eccentricity value is defined as

Fig. 7 33 Filter mask.

By the convolution technique, the resulting gradient can be


determined by convolving the mask Mx and My shown in Fig. 8
with the input image. More details about Sobel filter can be
found in [7].

Fig. 6 Major and minor axis lengths.

Wmajor − Wminor
Eccentricity Value = (3)
Mx My
Wmajor + Wminor Fig. 8 Masks of Sobel method.
B. Canny method
where Wmajor is major axis length, Wminor is minor axis length.
Canny filter is also adopted in this paper for comparison
to other techniques. The processes in edge detection using
As seen in (3), the value of eccentricity will be between 0 and
Canny method are shown in Fig. 9.
1. If the value is approaching 0, the object is almost a circle.
In contrary, if the value is closed to 1, the object becomes a
straight line.
III. CONVENTIONAL EDGE DETECTION FILTERS AND
P ROPOSED T ECHNIQUE
A. Sobel filter
Sobel filter is one of the most popular edge detection
filter. This technique uses the first differential to formulate the
edge of an object. In this concept, the direction of edge is
composed of 2 directions those are vertical and horizontal
directions. Differential of each direction as shown in the below
equation is used to specify the edge.
 ∂I  Fig. 9 Canny method.
G x   ∂x  (4)
∇f =   =  ∂I  First, a smoothing filter (Gaussian Filter) as described by
G
 y   (6) is applied to the input image to remove noise and make a
 ∂y  blur image.

1884

Authorized licensed use limited to: Tamil Nadu College of Engineering. Downloaded on December 18, 2009 at 09:36 from IEEE Xplore. Restrictions apply.
(
− i2 + j 2 ) Where
1
G ( i, j ) = e 2σ cross_sectionn is soldering joint’s length gained from
2
(6)
2πσ 2 destructive inspection of the picture No. n,
major length is soldering joint’s length by proposed
Si , j = I ( i , j ) ∗ G ( i , j; σ ) (7) method of the picture No. n,
where S (i , j ) is the intensity value of pixel (i, j) of the image k is number of pictures used for evaluating the fitness.

after smoothing, I ( i , j ) is the raw image intensity, G ( i, j ) is In (12), the value 0.001 (or a small number) is added to
the denominator for avoiding the problem of “divide by zero”.
Gaussian filter, σ is standard deviation, and ∗ is convolution
operation. Genetic algorithm is an efficient method to solve an
optimization problem. This approach is based on the concept
Next, the partial derivatives in x and y directions (denoted of chromosome and genetic operations which are crossover,
as Pij and Qij, respectively) are determined by (8) and (9). mutation, reproduction. Fitness function in GA is used to
Pij = {Si , j +1Si , j + Si +1, j +1Si +1, j } 2
measure how much good of chromosome. The diagram below
(8) indicates the steps of GA. More details of GA can be seen in
Qij = {Si , j Si +1, j + Si , j +1Si +1, j +1} 2
[8, 9].
(9)

Where Pij is differential in horizontal axis,


Qij is differential in vertical axis.

Then, the partial differential of the above equation is


converted to the polar form by (11).

M ij = Pij2 + Qij2 (10)

 Qij 
θ = arctan   (11)
 Pij 
Finally, by considering the intensity value of the resulting
picture, the edge is defined as the highest value point which
has the same direction as the gradient. The thickness of edge
line by this approach is only 1 pixel.

C. Edge detection by proposed method


In the proposed technique, GA is adopted to find the
proper parameters in the filter mask. However, to maintain the
concept of gradient and edge detection, the proposed filter
mask is based on the structure of Sobel filter. In the design, the Fig. 10 Genetic Algorithm (GA) process.
parameters (z1 to z9) as shown in Fig. 7 are the variables to be
Genetic procedure can be described as
determined the optimal values so that the error between the
1. Specify the genetic parameters such as probability of
measured value and actual value is minimized. However,
each genetic operator, population size, maximum generation
based on the structure of Sobel, only parameters z1 and z4 of
and etc.
My and z1 and z2 of Mx are the parameters attempted to be
2. Generate the first generation randomly.
evaluated by GA. The followings describe the structure of
3. Calculate the fitness value of each chromosome by (12).
Sobel applied in the proposed masks.
4. Is the stopping condition is met or not. If yes, stop GA.
If no, generate the next generation by genetics operators. The
For My, z2, z5 and z8 are equal to zero. z1 = z7 and z3 = z9 =
chromosome with best fitness is the solution of current
-z 1. z 4 = -z6. And, z1 and z4 must be positive numbers.
generation.
For Mx, z4, z5 and z6 are equal to zero. z1 = z3 and z7 = z9 =
-z1. z2 = -z8. And, z1 and z2 must be positive numbers. IV. EXPERIMENTAL RESULTS
Before applying GA, GA parameters must be first
Thus, the optimization problem is to find the optimal
specified. In this paper, we select the following values for the
parameter z1 and z4 of My and z1 and z2 of Mx such that the
GA parameters: population size = 30, maximum generation =
objective function in (12) is maximized.
k
20, cross over probability = 0.6, mutation probability = 0.1
1
fitness = ∑ abs(cross _ sec tion
n =1
(12)
− majorlengthn ) + 0.001
and reproduction probability = 0.3, k = 3. By running GA for
n

1885

Authorized licensed use limited to: Tamil Nadu College of Engineering. Downloaded on December 18, 2009 at 09:36 from IEEE Xplore. Restrictions apply.
17 generations, the optimal fitness value is found to be 1.9590. destructive inspection; however, there are many drawbacks of
Convergence of solution is shown in Fig. 11. the inspection such as time consuming, high operation cost,
and so on. Thus, this technique is used only for verifying the
accuracy but not for the practical work. Fig. 13 shows an
example of the results from destructive testing.

Fig. 11 Convergence of solution by GA. Fig. 13 Image captured by electro-microscope (cross-section method).
TABLE II
The optimal masks evolved by GA, as shown in Fig. 12. PERCENTAGES OF CORRECTNESS FROM THREE DIFFERENT APPROACHES
% correctness
0.6215 0 -0.6215 Cross Section
(um) Proposed
Canny Sobel
method
0.9474 0 -0.9474
A 205.23 89.10 78.83 78.09
0.6215 0 -0.6215 B 212.59 78.73 62.48 62.36
Mx* C 204.47 85.46 76.14 75.90
0.6215 0.9474 0.6215 D 193.29 99.60 94.08 89.88
E 220.72 89.18 86.42 84.34
0 0 0
F 204.72 82.01 74.06 69.60
-0.6215 -0.9474 -0.6215
G 176.42 91.45 81.00 78.44
My*
Fig. 12 New masks of proposed method. H 181.57 93.4 83.22 77.52

By applying the optimal masks to the original images of Test measured value
%correctness= × 100%
soldering joints, the edge images are obtained as shown in True measured value
Table I.
TABLE I Moreover, an experiment for counting the operation time
E DGE IMAGES DETERMINED BY PROPOSED FILTER of human inspection and designed system is done. The result
No. Original image Edge image of such experiment is shown in Table III. Clearly, it is seen
(GA)
that the operation time of the proposed technique is much
faster than that of human inspection.
A
TABLE III
OPERATION TIME OF HUMAN INSPECTION AND DEVELOPED SYSTEM
Operation time of the developed Operation time of the human
D system (sec.) inspection (sec.)
0.12 3.5

C V. CONCLUSIONS
In this paper, it is clearly shown that GA can be adopted to
enhance the accuracy of the automatic visual inspection system
For comparison, Sobel and Canny filters are adopted to
by modifying the edge detection filter. The accuracy of the
the designed system. The results of soldering joint’s length of
proposed technique is better than that of the Sobel and Canny
8 different pictures (A to H) are shown in Table II. As shown
filters. In addition, with this proposed system, the inspection
in this table, the proposed technique significantly gains more
time is considerably reduced as compared to the time required
accuracy than other filters.
by human inspection. This technique can be applied to any
To verify the accuracy of the proposed technique, the
filters and the next research work is to develop the higher
destructive inspection is adopted for determining the true value
dimension of edge detection mask.
of each soldering joint’s length. In this inspection, the pre-
amplifier under test will be covered with resin and then be cut
at the interesting position. The electro-microscope is used to
find the length. High accuracy results can be achieved by the

1886

Authorized licensed use limited to: Tamil Nadu College of Engineering. Downloaded on December 18, 2009 at 09:36 from IEEE Xplore. Restrictions apply.
ACKNOWLEDGMENT
This research work is financially supported by
Industrial/University Cooperative Research Center in Data
Storage Technology and Applications, King Mongkut's
Institute of Technology Ladkrabang and National Electronics
and Computer Technology Center, National Science and
Technology Development Agency (Project No. HDDB51-
004).

REFERENCES
[1] Ronald, A.,and Frank, Y. “Image Enhancement of Radiographs Utilizing
Filtering, Gray Scale Transformation and Sobel Gradient Operator,” IEEE
Engineering in Medicine & Biology Society 11TH Annual International
Conference, 1989.
[2] Heath, M. et al., “Edge Detector Comparison,” [Online]. Accessed
December 20, 2004, Available from
http://marathon.csee.usf.edu/edge/edge_detection.html
[3] Foshci, Patricia G. et al.,. “Feature Extraction for Image Mining,”
[Online]. January, 2005, Available from
http://www.eas.asu.edu/~egeria/papers/foschi_kolippakkam_liu_mandvik
ar.pdf
[4] Yaodong WANG, and Noboru FUNAKUBO, “Detection of Geometric
Shapes by the Combination of Genetic Algorithm and Subpixel
Accuracy,” Proceedings of ICPR IEEE, pp.535-539, .1996.
[5] S. Kaitwanidvilai, A. Saenthon, “Automatic Visual Inspection of Bump
in Hard Disk Drive Component using Neural Network and Image
Processing,” International Conference on Computer Graphic and
Imaging, Austria, February 2008.
[6] S. Karnprachar, A. Saenthon, S. Kaitwanidvilai, “A Nondestructive
Bump Inspection in Flip Chip Component using Fuzzy Image Filtering”,
ECTI Transactions on Electrical Engineering, Electronics, and
Communications (ECTI-EEC), Vol.5, No.2, August 2007: 103 – 108.
[7] Rafael, C. Gonzalez and Richard E. Wood.(2002). Digital Image
Processing, 2nd Edition, pp.572-607.
[8] Lo Bosco, G.( 2001). “A genetic algorithm for image segmentation,
Image Analysis and Processing,” Proceedings 11th International
Conference on Imaging, Sept 26-28, 2001, pp.262 – 266.
[9] Mitsuo Gen, Runwei Cheng. Genetic Algorithms and Engineering
Optimization. New York: John Wiley & Sons Inc.; 2000.

1887

Authorized licensed use limited to: Tamil Nadu College of Engineering. Downloaded on December 18, 2009 at 09:36 from IEEE Xplore. Restrictions apply.

You might also like