You are on page 1of 6

Edge Detection and Automatic Threshold Based on Wavelet Transform

in the VPPAW Keyhole Image Processing

Zhonghua Iiu Qilong wang


Welding Department,Harbin Institute of Technology,Xi Da Zhi Street 92,
NanGang District,Harbin 150001,People's Republic of China

Abstract-In order to realize the feedback control for points of sharp variations are often among the most
variable polarity plasma arc welding(VPPAW) formation in important features for analyzing the properties of images.
the weld process, the geometrical sizes of the keyhole image They are generally located at the boundaries of important
must be extracted. With the properties of multiscale edge image structures. In order to detect the contours of small
through the wavelet theory, the edge points were detected by structures as well as the boundaries of large objects,
getting the maximum modulus of the gradient vector in the several researchers in computer vision have introduced
direction towards which the gradient vector points in the the concept of multiscale edge detection[3,4]. The
image plane. At coarse scales, the local maxima of modules wavelet transform is closely related to multiscale edge
have different positions and only detected the sharp edge. detection and can provide a deeper understanding of these
At fine scale, there are many maxima created by the image algorithms.
noise. We must integrate this multiscale information to
look for the best scale where the edges are well discriminated 11. MULTISCALE
EDGE DETECTION FOR KEYHOLE IMAGE
from noises. At last, A new method of peak analysis for
threshold selection is provided. It is based on the wavelet Most multiscale edge detection smooth the signal at
transform which provides a multiscale analysis of the various scales and sharp variation points from their first-
information of the histogram. Many experiments show or second -order derivation. The extrema of the first
these ways are effective for the keyhole image to get the derivative correspond to the zero croessing of the second
geometry parameters of the keyhole in the real-time image derivative and to the inflection points of the smoothed
processing. signal. Smoothing funtion is any funtion e(x)whose
intergal is equal to 1 and that converges to 0 at infinity.
I. INTRODUCTION For examples, one can chooose O ( x ) equal to a Gaussian.
Suppose that qX) is twice differentiable define,
The variable polarity plasma arc welding (VPPAW) of respectively, I,&"x)and w * ( x ) as the first-and second -
aluminum alloys has been used widely in production[ 1,25. order derivative of e(x)
However, how to improve the reliability of weld
formation is still the fundamental issue. One of the
effective approaches is to detect the signals of the keyhole
By define, the funtion y"(x)and can be
considered to be wavelets because their intergral is equal
by the image sensor with the CCD camera. But the
to 0. The wavelet transform of {(x)at the scale s and
strong interference of the arc light in the image sensing
makes the keyhole image with noises. It is the key task position x,computed with respect to the wavelet ~ ' ' ( x ,is
)
how to detect exactly the edge of the keyhole. In images,
defined by

0-7803-6401-5/00/$10.00 Q 2000 IEEE

1048
the angle of the gradient vector with the horizontal
direction is given by
& m , Y > = argumenl(vlr,f(x,y)+i(w:,f(x,y)) (7)
the sharp variation points of j - * ~ , , ( ~ are
, ~ )the
points (x, y ) , where the modules M 2, ,-
(x, y ) has a local
maxima in the position of each of these modules maxima
(5) as well the values of the modules M , , f ( x , y )and the
angle A,, f(x,y) at the corrponding locations[5,6].
The wavelet transform ~ , " f ( x ) a n d w , " ~ ( x )are the first
111. THESELECTION AND ANALYSIS OF WAVELET FUNCTION
and second derivative of the signals smoothed at the scale

s respectively. The local extrame of w,"f(x)thus The detection of the specific components such as edges
in an image, it is more important to select a wavelet that is
correspond to the zero crossing of w,"f(x) and to the similar to the components of interest. An image
component that matches a wavelet will appear compactly
inflection points of f *e, ( x ) . in the transform if it happens to align with one of the
dyadic positions of the wavelet, but not otherwise. For
Detecting zero crossing or local extrema are similar
this reason, non-orthonormal wavelet transform often
procedures, but the local extrema approach has some
perform better in detection tasks.
impormant advantages. An inflection point of
f *e,(x) can either be a maxiuma oe a minimum of the The basic wavelet function must go to zero as

absolute value of its first derivative. The maxima of the 14 +ea at least as fast as in order to meet the
X
absloute vaue of the first derivative are sharp variation
points of f *e,( x ) , whereas the minmum correrpond to adimissibility criterion, many wavelets still have infinite,
rather than compact support. In the image processing, the
slow variations. With a second derivative operator, it is
Gauss function is usually used as the smooth function.
difficult to distingush these two types of zero crossing. On
The Mexico hat function is the second order derivative of
the contrary, with a first -order derivative, we easily
the Gauss function, which is named as Marr wavelet.
select the sharp varivation points by detecting only the
For the fixed scale s, the local extrama of
local maxima of Iw:f(x)l. In additon, zero crossing
q f ( x ) correspond to the zero -crossings of wff(x) and
give the position information but do not differentiate
to the inflection points of the function smoothed. The
samll amplitude fluctations from important discontinuties.
Images are measured at a finite resolution, therefore, we local maximum of the absolute value of w,"f(x)
cannot compute the wavelet transform at scales below the
corresponding to the first derivative is the sharp variation
limit set by this resolution. To allow fast numerical
points, whereas the minima correspond to slow variation.
implementation, It's imposed that the scale varies only
These two types of inflection points can be distinguished
along the dyadic sequence ( 2 ) j s .At each 2' .the
J
by looking whereas an extremum is a maximum or a
minimum, but they cannot be differentiated from the zero-
module of the gradient vector is porportional to
crossing. For the edge or singularity detection, we are
(6) only interested in the local maxima. Fig.l.(a) shows the

1049
graph of the dyadic wavelet function used in the
numerical experiments for the auto-threshold. This
wavelet has one small ripple on each side that can
produce a few spurious zero-crossing. Fig. 1.(b) shows
the graph of the dyadic wavelet function which is a
quadratic spline of compact support that is continuously Fig.2. The front image of the keyhole
differentiable and it is the derivative of the cubic spline
function with one vanishing moment.

0.8

0.4

0
‘3 Wkhmax

Fig.3. The scheme of the keyhole


-0.4

-0.8
-4 -1 0 1 4 -a -1 0 1 2

(a> (b)
Fig.l.(a) The dyadic Marr wavelet function y ( x ) used in the
numerical experiments for the auto-threshold. @)The dyadic wavelet
function which is a quadratic spline of compact support , it is the

derivative of the cubic spline function.

Iv. THEEDGE DETECTION OF THE KEYHOLE IMAGE

The image of keyhole puddle is shown in Fig.2., the


scheme of which is drawn in Fig.2.. These images are
projected composite pictures of the spatial pattern of the
keyhole puddle on the target plane of the video camera. (e) (0
The front periphery of the keyhole puddle is clear, but that Fig.4. The module images at the mask 3 and the different scale (a)
part of it at the location with the largest weld bead width scale 0 05, mask 3 (b) scale 0.1, mask 3(c) scale 0.5, mask 3 (d) scale 1,
can not be well distinguished from the solid area of the mask 3 (e) scale 1.5, mask 3(f) scale 2, mask 3
base metal. This is the difficulty of getting the front
edge of the keyhole by the edge detection. Moreover, the
weld wire covers some part of the down edge of the
keyhole. We must solve this questions when doing the
image real time processing. The aims of the image
processing are to get the up and down edge of the keyhole.
Fig.4-6. show the image processed at the different scale
and different size of the mask. The background of the
image is set to 255 in order to view the keyhole more
clearly.

1050
(e) (f)
Fig.5. The module images at the mask 3 and the different scale(a)scale Fig.7. The maximum module points of the keyhole image
0 05, mask 5 (b)scale O.l,mask 5(c)scale 0.5, mask 5(d)scale 1, mask 5
(e)scale 1 5, mask 5(f)scale 2, mask 5 v. AUTOMATIC THRESHOLD SELECTION BASED ON THE
WAVELET TRANSFORM

Among the wide variety of image segmentation


techniques, thresholding is one of the most popular.
Several algorithms exist in the literatures [7,8]. An
image containing an object on a contrasting background
has a bimodal gray-level histogram. The gray level
corresponding to the minimum between the two peaks is
optimal for defining boundary. For the image sequences,
we cannot choose a constant as a threshold for all the
images, because the keyhole images are acquired
continuously in order to control the welding process in
real-time. The background gray level is not constant,
and the contrast of objects varies within the image. So
(e) (f) the way of automatic threshold is needed to develop in the
Fig.6. The module images at the mask 7 and the different scale (a) real time processing.
scale 0.05, mask 7(b)scale 0.1, mask 7(c)scale 0.5, mask 7(d)scale 1, As the histogram H has a finite number N of samples,
mask 7(e)scale 1.5, mask 7(f)scale 2, mask 7 in order to avoid border problems when computing the
discrete transform signals, we use the following
From the above of the images, we can see that as the symmetrization technique:
increase of the scale the contrast of the object decrease, H ( - i ) i/ - N < i < 0

when the scale is larger than 1 the decrease is more ~ ( i ) = { H ( z N - i ) 0 < i < 2 N

obvious. Conversely, as the increase of the mask the In the case of a negative-valued sample follwed by a
contrast of the image increase, but this adds the operations. positive-valued sample (positive crossover), the zero-
In this paper, we adopt the mask is 5 and the scale is 0.5. crossing is defined as a position of the positive-valued
We detect the edge points according to the maximum sample. In the case of a position-valued sample
module of the wavelet transform in the direction towards followed by a negative-valued sample (negative cross
which the gradient vector points in the image plane. For over), the zero-crossing is defined as the position of the
every pixel, a window of k x l is used along with the negative valued sample. By analyzing all the
direction of the gradient vector, if the module of the pixel signals, we are provided with sets of triplets
is the maxima in the window, then the point is the edge
w2 J ,s,.a

point, otherwise, the point is not edge point. Fig.7. , Each of these
shows the maximum module point of the image. I i ., j j , ,,.,,, i = o.... IT ’

105 I
sets of triplets characterizes the peaks of the histogram at 500

a given scale by giving the position of their start, 0


maximum, and end. Starting search a peak at the lowest
a
resolution, the refinement procedure consist of tracking
-loo0
and linking all the threshold which are in correspondence
at higher resolutions and of backward updating their -1500 L
location. This approach is used to detect two peaks of
the histogram in order to get a adaptive threshold for the
image sequences. Fig.8. (a) Shows the histogram of the
image, Fig.8. (b-f) Show the wavelet transform of the

histogram in order. The Y axis stand for the


,&*f

wi,f f wi,fat the corresponding scale respectively.

'*',,. >* *-".,*"\..,,, ~ U-


-lm
-1500
tI pixel grade
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (f)
Fig.8.(a) The histogram of the maximum module of the keyhole
image (b)The wavelet transform 4, f of histogram at scale 2 ' (c) The

1 0 wavelet transform ,/.f of histogram at scale2 * (d) The wavelet

500 transform wi, f of histogram at scale 2 ' (e) The wavelet transform
0
1 1 1 1 101 1 1 1 1 1 1 1 1 01 1 1
wi4
f of histogram at scale 2 (r) The wavelet transform
500
of histogram at scale 2'
-10

-1503 From the above of graphs, we can see that at high


scale, the approach only detects the main peak, at the low
scale, it detects the details. So we can get the main peak
at the high scale and get the threshold at the low scale.
This accords with the mechanism of human vision.

VI. CURVE FITTING OF THE KEYHOLE IMAGE

Since the edge points are generally sparse in some


place, it might be desirable to fit a piecewise linear or
higher order spline curve through them to establish a
boundary suitable for extracting objects. Moreover, the

1052
intersections of the up and down edge of the keyhole is used to get the intersection of the up and down edge of
image are not very clean, so we must apply the curve the keyhole and the height of the keyhole as well with the
fitting to get the intersection of two edges. The area of the keyhole. These ways have been successfully
intersections stand for the maximum width of the keyhole. applied to the real-time image processing in the automatic
The area enclosed by the two edge-curves stand for the welding process.
area of the keyhole. The distance of the vertex of up edge
and the nadir of the down edge stand for the height of the ACKNOWLEDGMENT
keyhole. Fig.9. shows the curve fitting of the keyhole
image. Fig.10. is the result of the curve fitting of the The work is supported by the National Minister
keyhole image. Aerospace of China and Advanced Welding Production
Technology of National Key Laboratory.

REFERENCES

A.C. Nunes, E. 0. Bayless, C. S. Jones. VPPAW on the Space


Shuttle Extemal Tank. Welding Joumal, 1984, (9),pp.27-35

t 1 1 1 1 , / / , 1 1 / I I / I , , , 1 1 , , I
I
I
L H.Woodward,U.S.A, Contractor for the International

1 15 29 43 57 71 85 99 113 Space Station, Weld. J. 3 (1996),pp. 35-40


X c o o r d i n a t e of t h e e d g e p o i n t D.Marr and E. Hildrech, “theory of edge detection” proc. Royal
Fig.9. The curve fitting of the keyhole image Soc. Landon, vol. 207,198O,pp.I87-217.
A. Rosenfeld and M. Thurston , “edge and curve detection for
visual scene analysis,”IEEE Trans. Comput.,vol. C-20 , I 97 I ,
~~562-568.
S. Mallat, and Sifen Zhong, characterization of signals from
Multiscale edges, IEEE trans. PAMI. Vo1.14, No.7,1992,7, pp.710-
732.
Fig. 10. The result of curve fitting of the keyhole image S. Mallat ,Zero-crossing of a wavelet transform, IEEE trans.lT,
~01.32,N0.4,1991,7, pp.1019-1033
VII. CONCLUSION Y. Nakagawa and A. Rosenfeld ,some experiments on variable
thresholding, pattem recognition 1 I , 1979,pp.191-294.
We showed that multiscale edges can be detected and J. Kitter and J. Illingworth, minimum error thresholding, pattem

characterized from the local maxima of a wavelet recognition 19, 1986, pp.41-47.
transform. The course of searching the edge points is
getting the maximum module of wavelet transform in the
direction towards which the gradient vector points in the
image plane. This way is effective to detect the edge of
the keyhole. Automatic selection threshold is based on the
detection of the zero-crossing or the local extrama of the
wavelet transform of the histogram of the images. The
detection of the zero-crossing or the local extrama depend
on the choice of the wavelet basic function. Curve fitting

1053

You might also like