www.elsevier.com/locate/patcog
Received 16 June 2005; received in revised form 20 February 2006; accepted 8 March 2006
Abstract
This paper presents a novel approach to the fast computation of Zernike moments from a digital image. Most existing fast methods for
computing Zernike moments have focused on the reduction of the computational complexity of the Zernike 1-D radial polynomials by
introducing their recurrence relations. Instead, in our proposed method, we focus on the reduction of the complexity of the computation
of the 2-D Zernike basis functions. As Zernike basis functions have specic symmetry or anti-symmetry about the x-axis, the y-axis,
the origin, and the straight line y = x, we can generate the Zernike basis functions by only computing one of their octants. As a result,
the proposed method makes the computation time eight times faster than existing methods. The proposed method is applicable to the
computation of an individual Zernike moment as well as a set of Zernike moments. In addition, when computing a series of Zernike
moments, the proposed method can be used with one of the existing fast methods for computing Zernike radial polynomials. This paper
also presents an accurate form of Zernike moments for a discrete image function. In the experiments, results show the accuracy of the
form for computing discrete Zernike moments and conrm that the proposed method for the fast computation of Zernike moments is
much more efcient than existing fast methods in most cases.
2006 Pattern Recognition Society. Published by Elsevier Ltd. All rights reserved.
Complex Zernike moments of order n with repetition m computed by the mapping transform do not describe the
are nally dened as properties of the outside of the unit circle in the image.
The discrete form of the Zernike moments of an image size
n + 1 2 1 N N is expressed as follows:
Znm = f (, )Vnm (, ) d d, (5)
0 0
N1 N1
n+1
where f (x, y) is the image function and denotes the com- Znm =
f (x, y)Vnm (x, y)
plex conjugate. As can be seen from the denition, the pro- N
x=0 y=0
cedure for computing Zernike moments can be seen as an N1
n+1 N1
inner product between the image function and the Zernike = f (x, y)Rnm (xy ) exp(j mxy ), (6)
basis function. N
x=0 y=0
To compute Zernike moments from a digital image,
the integrals in (5) are replaced by summations and the where 0 xy 1 and N is a normalization factor. In some
coordinates of the image must be normalized into [0, 1] by previous research, N has been neglected or reported in-
a mapping transform. Fig. 2 illustrates a general case of the correctly [1,12]. In the discrete implementation of Zernike
mapping transform. In this case, the pixels located on the moments, the normalization factor N must be the number
outside of the circle are not involved in the computation of pixels located in the unit circle by the mapping trans-
of the Zernike moments. Accordingly, Zernike moments form, which corresponds to the area of a unit circle in the
2068 S.K. Hwang, W.Y. Kim / Pattern Recognition 39 (2006) 2065 2076
continuous domain. We show the validity of the presented faster methods that reduce the factorial terms by utilizing
form of the normalization factor N by the experiments in the recurrence relations on the radial polynomials.
Section 5. The transformed distance xy and the phase xy Prata [9] proposed a recurrence relation among Rnm (),
at the pixel of (x, y) are given by R(n1)(m1) () and R(n2)m () as follows:
2n nm
(2x N + 1)2 + (N 1 2y)2 Rnm ()= R(n1)(m1) ()+ R(n2)m (). (8)
xy = , n+m n+m
N
Kintner [10] proposed another relation as shown below:
N 1 2y
xy = tan1 . (7)
2x N + 1 (K2 2 + K3 )R(n2)m () + K4 R(n4)m ()
Rnm () = , (9)
K1
Fig. 3 shows the pseudocode for computing Zernike mo-
ments of order n with repetition m by Eq. (6). In Fig. 3, where the coefcients K1 , K2 , K3 and K4 are dened as
the real and imaginary parts of the Zernike moment are de- (n + m)(n m)(n 2)
noted by zr and zi , respectively. We assume the image size K1 = ,
2
is N N .
K2 = 2n(n 1)(n 2),
radial polynomials. Therefore, Kintners method is useful 4. Novel approach to fast computation of Zernike
when Zernike moments with selected repetitions are needed moments
as pattern features. When using Kintners method, Zernike
moments with n = m or n m = 2 are computed directly by In this section, we describe a novel approach to the fast
the denitions. computation of Zernike moments by using the symmetric or
Recently, Chong presented the q-recursive method, which anti-symmetric properties of the basis functions. In fact, the
uses a relation of the radial polynomials of xed order n symmetric or anti-symmetric properties are rst introduced
and varying repetition m [12]. Because Chong denoted the in the computation of angular radial transform [14]. The
repetition term as q instead of m, it is called the q-recursive properties described in this section are very similar but with
method. The relation of the radial polynomial is dened as further extension of [14]. As a result, the proposed method
signicantly reduces the number of pixels involved in the
H3 computation of Zernike moments. This method can also be
Rnm ()=H1 Rn(m+4) ()+ H2 + 2 Rn(m+2) (), (10)
used with existing fast methods for computing Zernike radial
polynomials such as Kintners or Chongs method, as will
where be demonstrated in the experiment.
VIn,4k+2 (Q1 ) = VIn,4k+2 (P), [f (x, y) cos(m)jf (x, y) sin(m)] dx dy. (16)
2072 S.K. Hwang, W.Y. Kim / Pattern Recognition 39 (2006) 2065 2076
Fig. 6. Brief diagram of the symmetric or anti-symmetric properties of Zernike basis functions.
Both VRnm (x, y) and VInm (x, y) have their specic symme- where hi (i = 1, 2, . . . , 8) is the value of the image function
try or anti-symmetry as the repetition changes. Therefore, by at point Pi in Fig. 7 and the coordinates of the point P1
using these properties as denoted in Fig. 6, we can rewrite the in the rst octant are (x, y). As can be seen in Eqs. (17)
above equation with a new notation gm r (x, y) and g i (x, y): and (18), the total number of multiplications necessary is
m
reduced to about one-fth while the number of additions
n+1 remains the same, which contributes to a slight improvement
Znm = x 2 +y 2 1
Rnm ()
in computation time.
0 x 1,0 y x
Because the proposed method focuses only on the com-
r
[gm (x, y) jg im (x, y)] dx dy. (17) putation of Zernike basis functions and Zernike moments,
existing fast methods such as Kintners or Chongs method
In Eq. (17), gmr (x, y) and g i (x, y) are computed by using
m can be used in the computation of radial polynomials. If a set
the values of the image function and the sinusoidal functions of Zernike moments with a xed order is required, Chongs
at eight points in Fig. 7, and are related to the real and method is desirable. If a set of Zernike moments with a xed
imaginary parts of the Zernike moments, respectively. Note repetition is required, Kintners method is better. We pro-
that the integral range is only an octant of a unit circle vide a quantitative analysis of the computation time in the
as denoted in gray in Fig. 7. We can group gm r (x, y) and
next section.
i
gm (x, y) into four cases:
r
g4k (x, y) = [h1 + h2 + h3 + h4 + h5 + h6 + h7 + h8 ] cos(m),
i
g4k (x, y) = [h1 h2 + h3 h4 + h5 h6 + h7 h8 ] sin(m),
r
g4k+1 (x, y) = [h1 h4 h5 + h8 ] cos(m) + [h2 h3 h6 + h7 ] sin(m),
i
g4k+1 (x, y) = [h1 + h4 h5 h8 ] sin(m) + [h2 + h3 h6 h7 ] cos(m),
r
g4k+2 (x, y) = [h1 h2 h3 + h4 + h5 h6 h7 + h8 ] cos(m),
i
g4k+2 (x, y) = [h1 + h2 h3 h4 + h5 + h6 h7 h8 ] sin(m),
r
g4k+3 (x, y) = [h1 h4 h5 + h8 ] cos(m) + [h2 + h3 + h6 h7 ] sin(m),
i
g4k+3 (x, y) = [h1 + h4 h5 h8 ] sin(m) + [h2 h3 + h6 + h7 ] cos(m), (18)
S.K. Hwang, W.Y. Kim / Pattern Recognition 39 (2006) 2065 2076 2073
Table 2
Comparison of Zernike moments computed in continuous and discrete
domains
Zernike Radial By Eq. (5) By Eq. (6)
moments polynomials
5. Experimental results
Table 3
CPU elapsed time for computing Zernike moments
Table 4
CPU elapsed time for computing Zernike moments with a specic order
Table 5
CPU elapsed time for computing Zernike moments with a specic repetition
5.2. Fast computation of Zernike moments methods in computing the full set of Zernike moments. We
conrmed that all the values of the Zernike moments gen-
To examine the computation time more explicitly, a num- erated by each method are the same.
ber of experiments were completed. In the rst experiment, In the second experiment, the time for computing Zernike
we computed the full set of Zernike moments with different moments is measured for the selected order of 12, 24, 36,
maximum orders using methods which included the direct and 48. For example, if the selected order was 12 then we
method, the q-recursive method, Kintners method, the pro- computed the Zernike moments of Z12,0 , Z12,2 , . . . , Z12,12 .
posed method, and nally mixed methods that combine the The experimental results are shown in Table 4. The mixed
proposed method with q-recursive and Kintners method, method with q-recursive and the proposed method show the
respectively. The direct method denotes the computation of best performance in this case.
Zernike moments using the denitions, that is, Eq. (6). The The computation was also done for the individual rep-
modied Kintners method is used together in the implemen- etition of Zernike moments. The selected repetitions were
tation of the q-recursive and Kintners method. The maxi- 0, 2, 4, 6, and 9. We set the maximum order to 48, so that if
mum order was set to 12, 24, 36, and 48. If the maximum the selected repetition is 9, Z48,9 , Z48,18 , Z48,27 , Z48,36 , and
order was 12 then 49 Zernike moments from Z0,0 to Z12,12 Z48,45 are computed. The CPU elapsed times for computing
are computed by each method. As a test image, a 256 256 Zernike moments with selected repetitions are reported in
grayscale image shown in Fig. 9 is used. The experiment was Table 5. The mixed method with Kintners method and the
performed with a 1.7 GHz Pentium IV PC with 512Mbyte proposed method shows the best performance in this case.
RAM and was implemented with MicrosoftTM visual C + + In the last experiment, we measured the computation
6.0. The CPU elapsed times for each method are tabulated time for computing a single Zernike moment. We selected
in Table 3. From the results, the combined methods listed in Z6,2 , Z12,0 , Z25,13 , and Z44,20 randomly and computed these
the last two columns take less time in general than the other moments by each method. The computation time by each
S.K. Hwang, W.Y. Kim / Pattern Recognition 39 (2006) 2065 2076 2075
Table 6
CPU elapsed time for computing a single Zernike moment
Table 7
Recommended methods for computing Zernike moments
About the AuthorS.K. HWANG received the B.S. and M.S. degreee in electronic engineering from Hanyang University, Seoul, Korea in 1997 and
1999, respectively. Currently, he is pursuing the Ph.D. degree in electronic engineering at Hanyang University. His research interests include shape
representation, motion segmentation, and pattern recognition.
About the AuthorW.Y. KIM received the B.S. degree in electronic engineering from Hanyang University, Seoul, Korea in 1980. He received the M.S.
degree from Pennsylvania State University, University Park, in 1983 and the Ph.D. degree from Purdue University, Sest Lafayatte in 1989, both in electrical
engineering. From 1989 to 1994, he was with Erik Jonsson School of Engineering & Computer Science, University of Texas at Dallas. Since 1994, he
has been on the faculty of Electrical & Computer Engineering at Hanyang University. His research interests inculde visual surveillance, face tracking
and identicatin, motion analysis, face recognition, and MPEG-7 applications where he contributed to the development of MPEG-7 visual descriptors.