G
2
x
(x, y) + G
2
y
(x, y)
2k
2
_
(3)
To calculate new prey f
t
(x, y)
f
t
(x, y) =
+1
i=1
+1
j=1
f
t
(x + i, y + j)w
t
(x + i, y + i)
+1
i=1
+1
j=1
w
t
(x + i, y + i)
(4)
where k is used to decide how much change of gray level of
an image can be considered as an edge point, parameter t is
iterative times. In this paper, when selecting k =2 and t =1, the
image qualityis improvedwell. Fig. 2(a andb) shows the original
images of a spray formed tubular product and the image after
eliminating noise, respectively.
3. SobelZernike moments operator
Any image processing singly using pixel-level or subpixel-
level operator can not realize the operation of both quickly and
accurately detecting object edge simultaneously, but the new
edge detection operator we proposed here, i.e., SobleZernike
moments operator, can make it. This approach consists of two
steps: at rst the pixel-level Sobel operator is used to approxi-
mately detect all probable edge points; secondly among all the
Fig. 2. Images of a tubular deposit by spray forming. (a) Original deposit image and (b) image of deposit after eliminating noise.
Q. Ying-dong et al. / Journal of Materials Processing Technology 172 (2006) 195201 197
found edge points, the subpixel-level Zernike moments operator
is used to relocate the edge with subpixel precision.
3.1. Using Sobel operator to quickly detect all probable
edge points
The details of Sobel operator are given as:
Calculating partial derivative in x and y directions
S
x
= {f(x + 1, y 1) + 2f(x + 1, y)
+f(x + 1, y + 1)} {f(x 1, y 1)
+2f(x 1, y) + f(x 1, y + 1)} (5)
S
y
= {f(x 1, y + 1) + 2f(x, y + 1)
+f(x + 1, y + 1)} {f(x 1, y 1)
+2f(x, y 1) + f(x + 1, y 1)} (6)
Calculating the gradient according to Eq. (7), and determining
the edge point
g(x, y) =
_
(S
2
x
+ S
2
y
), g(x, y) > t (7)
Selecting a threshold t, if g(x, y) >t, then point (x, y) is considered
as an edge point and herein t =60.
All edge points must be marked, thereafter these points will be
used for edge recognition by Zernike moments operator. Sobel
operator also can be expressed as the form of two masks as
shown in Fig. 3. These two masks are used to calculate S
x
and
S
y
, respectively. The edge image by Sobel operator is shown in
Fig. 4, where the white line is the deposit edge. It can be seen in
Fig. 4 that the edge line is very thick and some false edge points
are present in this image.
3.2. Zernike moments operator [12]
The main idea of Zernike moments operator is to calculate
four parameters for each edge point, as shown in Fig. 5: k is
the step height, h the background gray level, l the perpendicular
distance fromthe center of the circular kernel andthe edge makes
Fig. 3. Masks of Sobel operator.
Fig. 4. Edge image by Sobel operator.
an angle of with respect to the x-axis. The edge point can be
determined from parameters l and k. The edge position can be
calculated by parameters l and .
First of all the masks for calculating Zernike moments should
be deduced. Two masks are enough to get edge parameters l and
. Since edge location accuracy can be improved by enlarging
mask size, two 7 7 masks are deduced before the edge point
is determined. In this study a new parameter, the amplitude of
complex moment instead of parameter k, is used to locate edge
point together with parameter l.
3.2.1. Deducing masks and calculating Zernike moments
Zernike moments of an image f(x, y) is dened as:
A
nm
=
n + 1
_ _
x
2
+y
2
1
f(x, y)V
nm
(, ) dx dy (8)
where (n +1)/ is a normalization factor. In discrete form, A
nm
can be expressed as
A
nm
=
y
f(x, y)V
nm
(, ), x
2
+ y
2
1 (9)
indicating that in a discrete image the neighborhood of a point
should be mapped onto the interior of a unit circle for evaluating
Fig. 5. Two-dimensional subpixel step edge model.
198 Q. Ying-dong et al. / Journal of Materials Processing Technology 172 (2006) 195201
Fig. 6. Circular kernel dened for a 7 pixel 7 pixel area.
Fig. 7. Mask of Zernike moments A
20
.
Zernike moments of this point. The complex polynomials V
nm
(,
) can be expressed in polar coordinates as:
V
nm
(, ) = R
nm
()e
jm
(10)
where R
nm
() is a radial polynomial dened as
R
nm
() =
(1)
s
(n s)!
n2s
s!
_
n+|m|
2
s
_
!
_
n|m|
2
s
_
!
(11)
If an image is rotated by an angle , the following relationship
between Zernike moments of the original image A
nm
and the
rotated image A
nm
will be given
A
nm
= A
nm
e
jv
(12)
It is clear that Zernike moments merely acquire a phase
shift on rotation and their magnitudes remain constant. This
property is useful for rotation invariant pattern recognition and
matching. In order to calculate parameters and l, the masks
of A
11
, A
20
should be deduced. According to Eq. (10), the
orthogonal complex polynomials can be written as: V
11
=x +jy,
V
20
=2x
2
+2y
2
1. Fig. 6 shows the unit circle divided to 7 7
homogeneous grids. The masks canbe calculatedas makinginte-
gral for V
11
, V
20
on dashed area of every grid (see Figs. 7 and 8).
Fig. 8(a and b) shows the real component and imaginary com-
ponent of the complex mask of, respectively, each numerical
value in two masks are weight index that are acted on corre-
sponding 7 7 neighborhood pixel points. Here, assuming f(x,
y) to be constant over each pixel, convolving these masks with
the image points can get Zernike moments A
11
, A
20
for whole
image.
3.2.2. Calculating edge point parameters l and
According to Eq. (12), the following relationship can be given
A
11
= A
11
e
j
(13)
A
20
= A
20
(14)
where A
11
, A
20
are Zernike moments of the original image, and
are Zernike moments of the rotated image with angle .
Fig. 8. Mask of Zernike moments A
11
. (a) Imaginary component and (b) real component.
Q. Ying-dong et al. / Journal of Materials Processing Technology 172 (2006) 195201 199
Based on the theory of Zernike moments, A
11
, A
20
can be
calculated as
A
11
=
_ _
x
2
+y
2
1
f
20
=
_ _
x
2
+y
2
1
f
(x, y)(2x
2
+ 2y
2
1) dy dx
=
2kl(1 l
2
)
3/2
3
(16)
When an edge is rotated for an angle , it will be aligned parallel
to y-axis, therefore
_ _
x
2
+y
2
1
f
11
.
Using Eqs. (13) and (17), we can have
Im[A
11
] = sin()Re[A
11
] cos()Im(A
11
) = 0
therefore
= tan
1
_
Im[A
11
]
Re[A
11
]
_
A
11
can be calculated when A
11
and are known:
A
11
= Re(A
11
) = Re(A
11
) cos + Im(A
11
) sin() (18)
Solving Eqs. (15) and (16), the step edge parameter l is given:
l =
A
20
A
11
(19)
3.2.3. New criterion for edge point
In Ref. [12], the edge parameters l and k are considered as
criterion for edge point determination. In this paper a new crite-
rion, i.e., magnitude of complex moments A
11
, is introduced to
judge edge point with l together. The new criterion amp is given
by
amp =
_
Re(A
11
) Re(A
11
) + Im(A
11
) Im(A
11
) (20)
The reason for using amp to substitute k derives from the
characteristic of mask A
11
: the absolute value of a real compo-
nent is symmetrical relative to y-axis, and the absolute value of
the imaginary component is symmetrical relative to x-axis. This
characteristic is similar to that of masks of Sobel operator. The
criterion of Sobel operator is the magnitude of two masks, so the
magnitude of complex moments A
11
are taken as criterion too.
When amp >30 and l
of the original
point O is determined.
The above ve parameters are determined as kx =4.89,
ky =0.20, O