Escolar Documentos
Profissional Documentos
Cultura Documentos
Jun Shen* and Danfei Shen** **Department of Mathematics Bordeaux-1 University 33400 Talence, FRANCE *Image Laboratory Institute of Geodynamics Avenue des PacultCs 33405, Talence, FRANCE
ABSTRACT
Moments, which are projections of the input signal onto the polynomial function space, have found wide applications in image processing and computer vision. By use of orthogonal Legendre polynomial bases, the calculation could be reduced, the error is easier to estimate, and the reconstruction could be more simple also. How to characterize images by Legendre moments and with less computation is therefore important. In $he present papel; we propose the fast calculation to characterise images by Legendre moments. We first present the recursive property of Legendre moments and analyse their recursive calculation. The implementation of the recursive calculation of Legendre moments in discrete case is presented as well. The fast algorithm is then generalized to 2 - 0 cases. We show that with our algorithm, the computational complexity to calculate the Legendre moments is much reduced, and it is independent of the window size. Moreovel; we show that the higher order Lengendre moments are just linear combinations of Legendre moments of order 0 and I of the integrated signals, so we can only use these low order Legendre moments to characterise the input signal, and the computational complexity is thus further reduced.
Obviously, when one projects a signal onto the axis of a space, in general, one had better use orthogonal bases. The advantage of the use of orthogonal bases is that by use of the orthogonality between the bases, the calculation could be reduced, the error is easier to estimate when a !imited number of projections are used, and the reconstruction could be more simple also [20-22]. So orthogonal moments are proposed and their performance is analysed [16, 171. Taking the polynomial space as the space in which we analyse the signal, the orthogonal bases are known as Legendre polynomials L21]. Because the Legendre polynomials have more complicated expressions than the monomials, how to calculate the Legendre moments of the input signal with less computation is a very important problem for the application of Legendre moments. In the present paper, we propose the fast calculation to characterise I-D signals and 2-D images by Legendre moments, which can be used in pattern recognition and image processing. This paper is organized as follows. In section 2, we present the projections of 1-D signals onto Legendre polynomials and deduce the recursive algorithm for their calculation. In section 3, we introduce the scaled Legendre polynomials, the Legendre moments with arbitrary window size of I-D signals and their fast calulation by recursive algorithm. In section 4, we present the implementation of our algorithm in discrete cases and compare its computational complexity with the classical mask-based method. To apply our method to 2-D image processing and recognition, in section 5, we generalize the recursive algorithm for the calculation of Legendre moments to 2-D cases. In section 6, we show that the higher order Legendre moments are just linear combinations of Legendre moments of order zero and order one of integrated signals, so we propose to use only the low order Legendre moments of integrated signals to characterise an input signal, which is equivalent to the use of the Legendre moments upto order N, but the
1. INTRODUCTION
Moments have found wide applications in pattern recognition, image processing and computer vision [ 1-1 11. Because of great computational complexity of moment calculation, fast algorithms for geometric moment computation and their application have been proposed [ 1215, 18, 191. The advantage of geometric moments is that they have an explicite geometric and statistical signification. If we consider geometric moments from the viewpoint of functional analysis, they are projections of the input signal S(x) onto the polynomial space, taking monomial functions 1 , x, x2, ... , xN, .., as bases.
0-7803-3280-6/96/$5.00 '1996
IEEE
- 1144 -
computational complexity is further reduced. The paper is terminated by some conclusions. We show that with the approach presented, the computational complexity is greatly reduced and the implementation is simple. Because the maments are widely used in image filtering, image segmentation, texture analysis and pattern recognition, we think that the use of the algorithm proposed could greatly reduce the computational complexity of such tasks.
2. PROJECTION OF 1-D SIGNAL ONTO LEGENDRE POLYNOMIAL SPACE
00
= (112)
C
i= N+ 1
(2i+ 1)G2(i)
2.1. Legendre orthogonal polynomials a n d Legendre transform Qgendre polynomials are defined by (dn/dxn) (x2- I)" / (2". n!) for XE [-1, 11 Pn I (2.1) 0, otherwise, yhere n= 0, 1, 2, ..., is the order of the Legendre polynomial and n!= n. (n- 1). (n- 2). .... 1. As is well known, Legendre polynomials are orthogonal polynomials, i.e., 1 2J(2n+ 1) for m= n jPjl(x). P,(x) dx= ( (2.2) -1 0 for m# n. By use of the Legendre polynomials defined above, given a function u(x) defined on the interval [-I, I], we can define the Legendre transform G(n) of u(x) as follows: 1 G(n)= ju(x) Pn(x) dx for n= 0, 1,2, (2.3)
= J S(x+ t) Bn(t) dt
-1
(2.8)
where S(t) is the input signal, Bn(t), the base function of order n, Mn(x), the moment of order n and <*,'> denotes the inner product. In Eq.(2.8), if we take xn, n= 0, 1, 2, ..., as the base functions, Mn(x), n= 0 , 1, 2, ..., gives the geometric moment of order n of the signal S(x) in the window [x- 1, x+ I]. To calculate the orthogonal Legendre moments of S(x), we use the Legendre polynomials defined in Eq(2.1) as the base functions Bn(x). In the following, we use always the Legendre polynomials as the base functions. Let F(t)= S(X+t) i.e., F(t) is S(t) after a translation x, Eq(2.8) gives 1 Mn(x)= IF(t) Pn(t) dt (2.9)
...
-1
(2.10)
ju2(x) dx c +m.
-1
(2.4)
-1 So the essential problem to calculate the Legendre moments of an input signal S(x) in the window [x- 1, x+ 11 is the
u(x)= (11 2) C (2 n+ 1) G(n) Pn(x> (2.5) n=O The advantage of the use of Legendre transform is that it decomposes a given function defined on [-1, 13 to a linear combination of orthogonal Legendre polynomials, and it is easy to estimate the approxi ation error from Legendre T transform. So u(x) can be approximated by a linear combination of Legendre polynomials upto order N, denoted ii(x): u(x)= il(x)+ r d x )
calculation of the integration on fhe right side of Eq.(2.10). W shall at first analyse the Legendre moments in three cases.
(1) Case n 2 2. Legendre polynomials have the following recursive property: n> 2 Pn(t)= [(2n- I)/ n] t Pn-l(t) [(n- I)/ n] Pn_2(t) (2.11) which gives from Eq42.10)
(2.12) (2.13)
N
with (2 n+ 1) G(n) Pn(x) (2.6) n=O where rN(x) is the approximation error. From the orthogonality of Legendre polynomials, we have the global approximation error can be measured by Ci(x)= (1/ 2)
-1
1
12= IPn- 2(t) F(t) dt -1 Fo(t)= F(t), (2.14)
Let
1145
and
(2.15)
I3
(2.17)
Combinig Eqs.(2.9), (2.10), (2.24), (2.25) and (2.26), we obtain the following theorem for recursive calculation of Legendre moments in the window [x- 1, x+ 11:
with
Theorem 1: The nth order Legendre moment in the window (x- 1, x+ 1) of the input signal S(x), Mn(x)=
<P,(t), S(x+ t)>, can be calculated from the (n- I)th and (n2)th order Legendre moments as the following: <PO(t), S(x+ t)> = SI (x+ 1) - SI (x- 1) <Pl(t), S(x+ t)> =[SI (x+ I)+ SI (x- I)] -
(2.18)
While t [(ddt) Pn- 1(t)l= (n- 1) Pn- l(t>+(adt) Pn- 2(t) Eq.(2.18) gives
(2.19)
1 -1
Because 1
<Po(t), s1(x+ t)> e & ) , S(x+ t)> = <Pn-2(t), S(x+ t)> (2.20) (2n- 1 ) <Pn-l(t), SI(x+ t)> for n2 2. where <Po(t), s i (x+ t)>= Si+l(X+ 1) - Si+1(X- 1) <PI (t), s i (x+ t)> = [Si+l (x+ I)+ Si+l (x- I)] @o(t), Si+ 1 (x+ t)> <Pn(t), s, (x+ t)> = <Pn_2(t), si (x+ t)> (2n- 1) <Pn-l(t), Si+l(x+ t)> for n2 2 with Si (x) defined by So(x)= S(X)
X
-1
1
2F1 (-I)]-
(2.21) combining Eqs.(2.17), (2.20) and (2.21), we have 1 1 (2.22) I]= IPn- 2(t) FO(t) d t - n IF1 (t) Pn- 1(t) dt -1 -1 We have from Eqs.(2.10), (2.12), (2.14), (2.15) and (2.22), 1 1 1 jPn(t) Fo(t) d = JPn_2(t)Fo&dt - (2n-1) jPn-1(t)F1 (t) dt -1 -1 -1 =<Pnm2(t)7FO(t)>- (2n- 1) <Pn-l(t), F1 (t)> for n 2 2. (2.23) Because Eq.(2.23) holds for any input signal, replacing Fo(t) in Eq.(2.23) by Fi(t), we obtain the recursive calculation for Legendre moments as follows: 1 1 1 IPn (OF, (t) dt= b n - z(t) Fi (t) dt- (2n- 1 ) SPn 1 ( t ) ~ i1 (t) dt + -1 -1 -1
and
) Si(x)= ISi- ~ ( y dy
-c9
fori= 1, 2,...
(2.33)
3. SCALED LEGENDRE POLYNOMIALS AND LEGENDRE MOMENTS FOR ARBITRARY WINDOW SIZE
In pattern recognition and image Processi% we use in general the moments calculated from windows of different sizes, such as in edge detection, image compression, texture analysis, wavelet analysis, etc. In this section, we introduce the scaled Legendre polynomials and analyse the calculation of Legendre moments with an arbitrary window size.
(2) Case n= 0. %king into account that Po(t)= 1 for It15 1 and Po(t)= 0 for It1 > 1, we have
1
J&= -)(
(2.25)
[(dn/ dx") (x2- k2)n]/ [(2 k)". n!] for XE [-k, k] (3.1) 0, otherwise, where n is the order of the scaled Legendre polynomial, n= 0, 1 , 2, ..., and k> 0, the scale factor. The functions Ln(x),
1146
d n ( t ) , S(x+ t)> = <Ln-2(t), S(x+ t)> [(2n- 1)/ k] <Ln-l(t), Sl(x+ t)> for n2 2 where dO(t), S ~ ( Xt)> = Si+l(x+ k) - Si+l(x- k) + d l ( t ) , S ~ ( Xt+ > = [ S i + l ( ~ + k ) + S i + l ( ~ - k ) ] )
(3.8)
(3.9)
Legendre polynomials have the following recursive property: L,(x)= [ W - 111(n k)l x h - l ( x ) - [(n- 111nl L n - 2 ( ~ ) (3.3)
(3.10) <Lg(t), Si+ 1 (x+ t)> 1k d n ( t ) , Si(x+ t)> = <Ln-2(t), Si(x+ t)> - [(2n- 1)/ k]*
for n 2 2
(3.1 1)
S(x+ t) Bn(t) dt
k
= IS(x+ t) Bn(t) dt
-k where Bn(t) is the base function of order n, defined in the interval [-k, k]. If one takes the monomials tn , n= 0, 1, 2, ..., as the base functions, we obtain the geometric moment k tn S(x+ t) dt Mn(x)= <S(x+ t), t n r -k 'lb calculate the orthogonal moments, by use of the scaled Legendre polynomial Ln(x), we can define the nth order Legendre moments as follows: k dt Mn(x) = <S(x+ t), Ln(t)> = jS(x+ t) b(t) -k Let So(t)= S(t) t and Si(t) = JSi-I(y) dy
-00
(3.4)
(3.5)
By use of a change of variable, we obtain from theorem 1 the recursive calculation of the nth order orthogonal Legendre moments in the window [x- k, x+ k] of the input signal S(x): Theorem 2: The nth order orthogonal Legendre moments of S(x), i.e., <S(x+ t), Ln(t)>, calculated from the window [x- k, x+ k], can be computed from the (norder Legendre moments as follows: <Lg(t), S(X+ t)> = S1 (x+ k) - S1 (x- k) d 1 (t), S(X+t)> = [SI (x+ k) + S1 (x- k)] +(t), Si (x+ t)> 1 k and (n- 2)th (3.6) (3.7)
..., N-
1.
In discrete case, for the symmetry of the window, we take in general a window size (2k+ 1) where k is an integer and k 2 1. centered at x. which is eauivalent to take a scale factor (2k+ I)/ 2 in analog case. From Theorem 2, we have in discrete case: Mo(x, Si)= Si+l(X+ k)- Si+l(X- k- 1) (4.2) where Mo(x, Si) denotes the Legendre moment of order 0 of
1147
the signal Si(t) defined in the window of (2k+ 1) pixels size and centered at the integer position x. Obviously, the computational complexity to calculate Mo(x, Si) from Si+l(t) is just one subtraction per pixel.
As to the first order moments, if we just simply approximate the integrations by summations, we would obtain M ~ ( x Si)= [Si+l(x+ k)+ Si+l(X- k- l)] - [Si+2(~+ , k)Si+2(~- I)] / (k+ 1/2) k(4.3)
with the window size (2 ki+ 1)(2 kj+ 1) pixels. Eq.(5.2) shows that the calculation of 2-D Legendre moments can be decomposed to the cascade of I-D Legendre moments calculation. Table 1. Comparison of Computational complexity
Of course, taking into account the difference between the analogue integration and the sum in discrete case, we had better calculate the first order moment by MI(X, Si)= [Si+l(X+ k)+ Si+l(X- k- 111- [Mo(L Si+l)+ Mo(x, Si+])- Mo(x9 si)1/(2k+ 1) (4.4)
Higher order moments can be calculated recursively by use of Theorem 2. Because of limite of space, we cannot give more details.
Now we analyse the computational complexity of the 2-D algorithm. With the recursive algorithm for 2-D Legendre moments, the total computational complexity to calculate all the Legendre moments of order (p, q) with p+ q< N, is (N3 + N)/ 6 multiplications and (N3+ 21N2+ 45.5N+ 18)/ 6 additions per pixel. As to the classical method, even the 2D Legendre masks are a priori calculated, this complexity will be jN3+ 3N2 + 2N) (2ki+ 1) (2kj+ I)! 6 multiplications and almost the same number of additions per pixel. If the separability to transform the calculation of 2-D Legendre moments into the cascade of I-D moments calculation is used, this complexity for the classical method will be [N (N+ 1) (2ki-1- 1)/ 2+ N (2k,+ I)] multiplications and [N (N+ 3) ki+ (N+ 1) (2kj)l additions per pixel. We see that the complexity is much reduced by our method, in particular, when the window size is large. In Table 2 is shown the comparison for different window sizes and different maximum orders of moments to be calculated.
In discrete case, the 2-D Legendre moment of order (p, q) of an input image S(i, j) is defined by ki kj MP, 4(i, j)= I { C S(i+ t, j+ v) Lq(v) ) Lp(t) : t= -k. V= -k.
1 J
(5.2)
1148 -
just linear combinations of Legendre moments of order 0 and of order 1 of the signals S ( i ) , S,(i), ,,,, Si(i), ..., S d ) . Therefore we can characterise the input signal S(i) by only using the low order Legendre moments, which will be equivalent to the use of higher order Legendre moments, but demands less computation. So we propose to characterise the signals by Legendre moments of order 0 and of order 1 only. The generalization of the low order Legendre moments characterisation method to 2-D cases is trivial. Because of limit of space, we cannot give more details here. Table 2. Comparison of computational complexity per oixel for 2-D Legendre moments calculation
Y
i
9x 9
158 284
68
5
22
124 299
6.5 570
7. CONCLUSION
In the present paper, we proposed the fast calculation to characterise signals and 2-D images by Legendre moments. The proposed algorithm reduces much the computational complexity. Moreover, we showed that the higher order Legendre moments are just linear combinations of Legendre moments of orders zero and one of integrated signals, so we proposed to use only the low order Legendre moments of integrated signals to characterise an input signal, which is equivalent to the use of the Legendre moments upto order N, but the computational complexity is further reduced.
REFERENCES [ I ] M.K. Hu, "Visual pattern recognition", IRE Trans. Inform. Theory, IT-8, pp179-187,1962. [2] EA. Sadjadi, "3-D moment invariants", IEEE Trans.
PAMI-2, No. 2, pp127-136, 1960.
[3] Y.S. Abu-Mostafa and D.Psatlis, "Recognitive aspect of moments", IEEE Trans. PAMI-6, pp698-706, 1984.
[4] C.H. Teh and R.T. Chin, On image analysis by the methods of moments, IEEE Trans. P.A.M.I., Vol.PAM1-IO, pp496-5 12, July 1988. [5] C.H. Lo and H.S. Don, 3-D moment forms: their construction and application to object identification and positioning, IEEE Trans PAMI-I 1, No. 10, pp1053-1064, 1989. [6] E.P. Lyvers, Subpixel measurement using a momentbased edge operator, IEEE Trans.PAMI,Vol. 1 1,No1 2, 1989. [7] S.T. Lio and W.H. Tsai, Moment preservation corner detection, Pattern Recognition, Vol. 23, No. 5, pp441446, 1990. [8] L.H. Chen and W.H.Tsai, Moment preservation curve detection", IEEE Trans. SMC-18, pp148-158, 1988. [9] R.M. Haralick et al, The facet approach to optic flow, Proc. of Image Understanding Workshop, pp84-93, Arlington, 1983. [IO] H.H. Nagel, On the estimation of optical flow: relations between different appreaches and some new results, Artifieial Intelligence, Vo1.33, pp299-324, 1984. [I 11 N. Yokaya et al, Range image segmentation based on differential geometry: a hybrid approach, IEEE Trans PAMI11, NO. 6, ~ ~ 6 4 3 - 6 4 9 , 1989. [ 121 M.F. Zakaria et al, Fast algorithm for the computation of moment invariants, Pattern Recognition, V01.20, No. 6, ~ ~ 6 3 4 - 6 4 31987. , [ 131 M. Hatamian, A real-time two-dimensional moment generating algorithm and its single chip implementation, IEEE Trans. ASSP-34, No. 3, pp546-553, 1986. [I41 B.C. Li and J. Shen, Fast computation of moment invariants, Pattern Recognition, Vo1.24, No. 8, pp807813, 1991. [I51 B.C. Li and J. Shen, Pascal triangle transform approach to the calculation of 3-D moments, CVGIP: Graphical Models And Image Processing, Vo1.54, No.4, ~ ~ 3 0 1 - 3 0 7 , 1992. July [I61 M. Pawlak and X. Liao, On image analysis by orthogonal moments, pp549-552, Proc. 1 1 th ICPR, The Hague, August 30-September 3, 1992. [I71 M. Pawlak, On the reconstruction aspects of moment descriptors, IEEE Trans. Information Theory, 1992. [IS] B.C. Li and J. Shen, Range-image-based calculation of three-dimensional convex object moments, IEEE Trans. on Robotics and Automation, Vo1.8, No.4, pp484-490, August 1993. [I91 B.C. Li and J. Shen, no-dimensional local moment, surface fitting and their fast computation, Pattern Recognition, Vo1.27, No.6, pp785-790, 1994. [20] C. Froberg, Introduction to numerical analysis, 1965. [21] G. Szego, Orthogonal polynomials, New York, 1959. [22] P. Davis, Methods of numerical integration, 1975. [23] M.J. McDonnell, Box-filtering techniques, CGIP, Vol. 17, NO.], pp. 65-70, 1981. [24] S . Castan and J. Shen, Box filtering for Gaussian-type filters by use of the B-Spline functions, Proc. of the 4th Scandinavian Conference on Image Analysis, pp235-243, Norway, 1985.
1149