European Journal of Scientific Research ISSN 1450-216X Vol.24 No.1 (2008), pp.104-111 © EuroJournals Publishing, Inc. 2008 http://www.eurojournals.com/ejsr.htm
A Comparative Survey on the Fast Computation of Geometric Moments
Abdel Latif Ibrahim Abu Dalhoum Computer Science Department, Kimg Abdullah School for Information Technology University Of Jordan E-mail: a.latif@ju.edu.jo Abstract This paper demonstrates different geometric moments algorithms used in pattern recognition and object detection. Those algorithms are fast in comparison to the direct computation. Due to the nature of image data and/or object data and the moment order that is required, most of those algorithms have limitations in coping with different kinds of image and/or object data and cannot be generalized. In this notepaper, we intend to analyze and compare those algorithms and propose the right algorithm that can be generalized to higher dimensions and higher moment orders.
Keywords: N-Dimensional moments, fast algorithms, moment invariants, Hatamian's filter, high-order moments, high dimensional images.
On Moments and their Computation
With the rapid development of imaging systems, sensors, storage devices, and computers, high dimensional digital images are becoming available. Multispectral satellite images (Wang, 1998), multispectral magnetic resonance images (Gadian, 1982; Taxt, 1994), dynamic phase space representations of electroencephalogram (EEG) signals (Principe, 1990), and images collected from robot sensors (Markandey, 1992), are examples of this kind of high dimensional digital images. Highdimensional moments are of the most remarkable features used with high-dimensional images that can be used to obtain important recognition features about the image. This theory will play an important role toward the essential development of robot vision and toward creating machine intelligence (Mamistvalov, 1998). Computing moments suffers form huge arithmetic operations, and huge memory storage is required for high-dimensional moments too. Fast computation of moments is getting more attention due to the increase need to use high orders and high dimensional (high-D) moments (Markandey, 1992; Mamistvalov, 1998; Lo, 1989). Historically, moments (or as it is called now geometric moments or regular moments) were first introduced by Hu (Hu, 1962) for 2-D gray-level images to generate the socalled moment invariants. These invariants were used in many image processing and pattern recognition problems (Prokop, 1992), they are sets of moments features that remain unchanged under image translation, rotation, and scaling. Other kinds of moments also exist; the most important is Zernike moments introduced by Teague (Teague, 1980), see also (C-H, 1988) for different kinds of moments (e.g. Legendre moments, pseudo Zernike moments, radial moments, complex moments, etc.) and their relations.
A Comparative Survey on the Fast Computation of Geometric Moments
105
For the case of generality, the n-dimensional moments up to the order k for a function f ( x1 , x 2 ,K, x n ) are defined in terms of Rieman integral as:
∞
m p1 p2 L pn =
−∞ −∞
∫
∞
p p p ∫ L ∫ x1 1 x2 2 K xn n f ( x1 , x2 ,K, xn ) dx1 dx2 Kdxn −∞
∞
(1)
where k = p1 + p 2 + L + p n , 0 ≤ k ≤ ∞ . Also it is assumed that f ( x1 , x 2 ,K, x n ) is a piecewise continuous and has none-zero values only in the finite part of R n , then moments of all order exist. When computing moments of a digital image the integration may be replaced by summation. For binary images the characteristic function f takes the form: ⎧1 for points of the image f ( x1 , x 2 , K , x n ) = ⎨ (2) n ⎩0 for rest points of R and in this case the zeroth order moment represents the volume of the image. Taking a look at equation (1) one can notice the huge number of arithmetic operations required for the moments set computation. Many of moment’s literatures were concerned in developing algorithms for the fast computation of moments. The conditions of these algorithms, i.e. limitations and capabilities are not so clear and sometimes confusable. In this note we report those of the most importance hoping they can work in the generalized and optimum computation (if exist).
Fast Computation of Moments
The computation of image moments may be governed (in general) by the type of image, binary or gray level, the dimensional space in which the image is represented 2-D, 3-D, or higher-Ds, and the order of moments to be computed. In 1986, Hatamian (Hatamian, 1986) suggested a 2-D filter method to compute 2-D gray-level image moments up to the third order. Hatamian’s method is very reliable and performs optimum computation scheme ever suggested, but it is not general to multi-Ds and high order moments (the method was considered the state of the art in the theory of image moments computation). Starting our discussion first with 2-D binary images, B.-C. Li and J. Shen (Li, 1991) used Green’s theorem (for double integral) to transform 2-D binary image moment computation to a single integral along the boundary. M. Dai et al. (Dai et al, 1992) used the delta method (Zakaria et al, 1987) in a modified integral method to compute 2-D binary image moments. The later method is faster than the delta method but with less accuracy due to the integral value approximation. L. Yang et al. (Yang, 1996) used the idea of B.-C. Li and J. Shen, but now, via the discrete Green’s theorem to evaluate a double sum over a 2-D discrete boundary of the object. This method relies on Hatamian's filter algorithm to perform fast computation and it is dedicated for binary image moments. One of the most important features of the algorithm that uses the discrete Green’s theorem (Yang, 1996) is that it gives exact results compared to Li's and Shen's (Li, 1991). Note that Hatamian (Hatamian, 1986), Zakaria et al. (Zakaria et al, 1987), and M. Dai et al. (Dai et al, 1992) they all performed fast and exact computation. The term exact, as was used in (Yang, 1996) and here does not refer to perfect computation compared to the continuous version of the image, but exact in comparison to the straightforward computation in the discrete case. The most efficient binary 2-D image moments generator was proposed by M. Iraklis et al. (Spiliotis, 1998). Their approach is based on dividing the image region into many block regions representations in which the order of computational complexity is reduced less than the single integral along the boundary. Looking again at the general case of Hatamian's filter, B.-C. Li (Li, 1995) used the filter method to compute 2-D moments, but now, he derived the linear transformation between the outputs of the filter and the corresponding geometric moments. His transform can be applied to moment's computation up to any order. Also arithmetic operations were slightly reduced (compared to Hatamian's work). A similar approach was presented by J. Marinez and M. Thomas (Martinez, 1996). Based on the impulse response of Hatamian filter, the general transform that relates outputs of a digital filter to geometric moments was derived also in (Abdul-Hameed, 1997). Expansions to higher
106
Abdel latif Ibrahim Abu Dalhoum
dimensions were discussed too, still the work needs more investigations. Recently, Wong and Siu (Wong, 1999) suggested another dialect of Hatamian's filter. In there work, they slightly changed the design of the filter in which they moved the delay element from the feedforward path of the filter to the feedback path. In doing this, several improvements were accomplished, the filter is more efficient (operations were reduced slightly), the structure of the filter is easier to be adopted for hardware implementations (than the original Hatamian filter), and outputs are sampled at the same time interval. Another work by F. Zhou and P. Kornerup (Zhou F, 2000) suggested a method similar to that of the digital filter, their method is based on computing moments by prefix sums. They provided four different transformation schemes to convert outputs of a digital filter to geometric moments up to high orders. Their transformations are much simpler and more efficient than those suggested by B.-C. Li (Li, 1995) and filter realization is similar to the improved filter (Wong, 1999). Expanding these new filters to higher dimensions is necessary to put the generalized theory of fast computation of image moments into real world and is required in the near future. Discussing the case for 3-D image moments, Cyganski et al (Cyganski, 1988) adopted Hatamian's filter to compute 3-D moments. Their implementation did not make use of the full computational power of Hatamian's filter; therefore, many unnecessary operations were used. Another better solution to this problem was discussed in (Abdul-Hameed, 1997). Another work by B.-C. Li et al. (Li, 1992) proposes a Pascal-Triangle-Transform (PTT) approach for computing monomials of 3-D binary image moments. The proposed algorithm performs computation of 3-D moments of binary images free of multiplications. PTT is used to generate monomials of moments. Another work by B.-C. Li and S. D. Ma (Li, 1994) in which they defined the linear transform moments and then derived its relation with conventional moments, the goal was to perform efficient computation of 3-D moments. One of the schemes used in their method was to convert the computation of 3-D binary image moments into a 2-D gray image moments. L. Yang et al. (Yang, 1997) used the divergence theorem to compute moments of 3-D binary images. Using the divergence theorem, the computation of 3-D binary image is equivalent to that of computing 2-D gray-level image moments. The method relies on Hatamian's algorithm (Hatamian, 1986) that was designed to compute 2-D moments up to the third order. The linear transformation relating outputs of the digital filter and regular moments must be derived to enable computation of high order moments. Moreover, extending the 3-D moments computation via divergence theorem to treat 3-D gray-level regions will add much more complexity in computing Gauss-transitions of the image, then to use Hatamian filter to generate moments in 3-Ds. A better choice is to use Hatamian moment generating algorithm (if it is available for 3-Ds) directly since it works optimally compared to other kinds of fast algorithms. The extension of Hatamian's filter to the computation 3-D gray image moments was addressed in (Abdul-Hameed, 1997).
The Increased Need for High Order n-Dimensional Moments
Though high order moments are sensitive to the presence of noise, several researchers adopted the use of high order moments (noise tolerance where addressed in several other works e.g. (Hupkens, 1995; C-H, 1988; Liao, 1996). In (Wang, 1998), Zernike moments up to the order 12 were used to calculate illumination-geometry invariants in multispectral texture (on a total of more than 700 image generated by means of spatial correlation). Note that fast computation of Zernike moments can be performed through their relation to geometric moments (computing Zernike moments up to the 12th order requires the generation of geometric moments up to the 12th order too). In (Bailey, 1996; Perantonis, 1992) Zernike moments up to the orders 12 were tested too in discussing character recognition problem on a huge database set. 3-D moment invariants can be used as feature vectors for automatic identification of 3-D objects and CAT images in statistical pattern recognition techniques (Lo, 1989). Indeed, fast computation of n-dimensional moments is just another challenge to the computational issues of moments, and especial challenge to Hatamian's filter in which the linear transformation that relates outputs of a digital filter to geometric moments it is hard to find in 2-, 3-Ds (Hatamian, 1986; Cyganski, 1988; Li, 1995).
A Comparative Survey on the Fast Computation of Geometric Moments
107
Concluding Remarks
Table 1 contains some of the features of the algorithms demonstrated in this note, N is the image (or data) size. These are the best moment generators noted up to date. It seems that the best choice to compute 3-D binary image moments using L. Yang et al (Yang, 1997) where computations are of the order O( N 2 ) (in addition to a surface tracking algorithm to determine the object voxels). Developing n-dimensional, k th order moment Hatamian’s filter (due to its simplicity and straightforward ability) will fill a gap in fast moments algorithms. Using the discrete divergence theorem with the generalized Hatamian filter one may compute moments of n-dimensional binary data with a great efficiency. Also, the improved filter (Wong, 1999) may replace Hatamian filter for its better performance. And it is recommended that this filter must be generalized to high-orders and high dimensions.
108
Table 1:
Abdel latif Ibrahim Abu Dalhoum
Demonstrating fast moment algorithms, limitations and possible improvements. (k) Represents the moment order.
Adds* Mults
3
Method
Ds, image, order 3-D, any gray,
Notes Monomials may be stored in a look-up table so multiplications will be totally avoided. This memory will be a serious problem especially if high orders are needed. An extension of Hatamian's filter by Cyganski et al. Many overhead operations should be eliminated. Huge memory storage is also needed here to store monomials, added to the computation of monomial coefficients. This is another extension of Hatamian's filter. The linear transformation was solved. The method is expandable to higher dimensions too. It can be used with 2-D as well. Higher dimensions can only be achieved using discrete divergence theorem with the use of multi-D Hatamian filter. In addition, this method requires a fast surface tracking algorithm. Multiplications can be avoided too by storing monomials in a lookup table. The concept used here is to convert the computation of 3-D binary image moments into that of 2D gray level image moments. Again, Hatamian filter can be used to further reduce operations. This is the most efficient moment generating algorithm. High order Multi-D Hatamian filter will fill a gap in high order multi-Ds computation. Arithmetic operations are slightly less than the original Hatamian filter. In fact it is the same filter with a change in the solution of linear transformation relating filter output and moments. Arithmetic operations are slightly less than the original Hatamian filter (more than filter-3). This method also relies on Hatamian filter. The method is appropriate for large size image moments. It can be used in the sequential computation scheme too. Computational redundancy is based on dividing the image into blocks that enables a reduction in the heavy floating point arithmetic. Moments at each block are computed using Hatamian filter. This method also relies on 1-D Hatamian filter. Multiplications can be avoided too. Applying this method for gray-level images may results in more overhead operations, thus it is not as efficient as direct use of Hatamian filter. This algorithm works only on binary image. It was reported in (Spiliotis, 1998) that when the computation up to the 3rd order the speed up factor was 200 for a 512×512 sized image. The algorithm is expandable to high orders.
Straightforward filter-1 (Cyganski, 1988) Pascal triangle (Li, 1992) filter-2 (AbdulHameed, 1997)
2(k + 1 )(N − 1 )
3
(k 3 + k 2 + k + 1)N 3 / 6
(k + 1) N 3 + (k 2 + 7 k + 8) N 2 / 2
0
(k − k ) N / 2
2 2
3-D, binary, 3rd 3-D, binary, any
[(k + 1)k 3 / 2 + 1] × ( N − 1) 3
(k + 1) N 3 + (k + 1) 2 N 2
0
3-D gray, any
discrete Gauss theorem (Yang, 1997)
[k 2 / 2 + 7k / 2 + 3]N 2
2kN 2
3-D, binary, 3rd
Linear Transform Method (Li, 1994) filter (Hatamian filter) (Hatamian, 1986) filter-3 (Li, 1995) filter-4 (improved filter) (Wong, 1999)
N 3 + (2k + k 2 ) N 2 + k 3N
k 2N 2
3-D, binary, any
4 N 2 + 10 N
0
2-D, gray, 3rd
(k + 1) N 2 + (k + 1)(k + 2) N / 2
0
2-D, any
gray,
4 N 2 + 10 N
0
2-D, gray, 3rd
Block moment algorithm (M. S. A, 1998)
less than
N2
0
2-D, gray, 3rd
Discrete Green's theorem (Yang, 1996)
18N
6N
2-D, binary, 3rd
Image Block Representation (Spiliotis, 1998)
Less than
N
0
2-D, binary, 3rd
*
Adds is the number of additions, mults is the number of multiplications, Ds represents data dimensions, image represents the image type (gray-level or brainy image), and order represents the moment order.
A Comparative Survey on the Fast Computation of Geometric Moments
109
Computing other kinds of moments (i.e Legendre moments, Zernike moments, etc.) can be performed through their relation to geometric moments, see(C-H, 1988; Abdul-Hameed, 1997; Bailey, 1996) or directly (Belkasim, 1997; Mukandan, 1995; Shu, 2000). Through the first kind of computation scheme, not only fast computation can be achieved, but the accuracy is high (Hupkens, 1995) too. Moreover, fast computation can be applied to the corresponding geometric moments before using the proper transformation to convert geometric moments to Zernike moments or any other kind of moments (Abdul-Hameed, 1997). In (Belkasim, 1997), the fast computation of Zernike moments was presented through some basic properties of Zernike polynomial (Belkasim, 1997). In that work, the authors compared their suggested algorithm to the one that uses geometric moments but without making use of Hatamian filter for generating geometric moments. Taking this into consideration, their algorithm is not as efficient as the one that makes use of Hatamian filter (see for example (AbdulHameed, 1997)). This emphasizes the importance of the fast computation of geometric moments in relation to other kinds of moments. It is worth mentioning that several hardware/parallel approaches were suggested to compute two-dimensional geometric moments (Reevs, 1982; Hung, 1999) in which few effort was made to make use of the inert redundancy in moment computation. In (Hung, 1999), however, the authors attempted to make use of the advanced VLSI architecture to be blended in the computation of moments. Therefore, these approaches do work in real-time but the drawback is low efficiency and relatively expensive.
References
[1] Abdul-Hameed. M. S "High order multi-dimensional moment generating algorithm and the efficient computation of Zernike moments," Proceedings of 1997 International conference on acoustics, speech, and signal processing, ICASSP97, vol.4, pp. 3061-3064, Munich, Germany, 1997. Bailey. R. R, and Srinath. M, "Orthogonal moment features for use with parametric and nonparametric classifiers," IEEE Trans. Pattern Analysis and Machine Intelligence, vol. 18, no. 4, pp. 389-399, April 1996. Belkasim S. O, Ahmadi. M, and Shridhar. M, "Efficient algorithm for fast computation of Zernike moments," in Proc. IEE on 1997. C-H. The, and Chin. R. T, “On image analysis by moment invariants,” IEEE Trans. Pattern Analysis Machine Intelligence, vol. 10, no. 4, pp. 496-513, July 1988. Cyganski. D, Kreda. S. J, and Orr. J. A, "Solving for the general linear transformation relating 3-D objects from the minimum moments," SPIE Intelligence Robots and Computer Vision V. II, Proceedings of SPIE, vol. 1002, pp. 204-211, SPIE, Bellingham, WA, 1988. Dai et al. M, “An efficient algorithm for the computation of shape moments from run-length codes or chain codes, “Pattern Recognition, vol. 25, no. 10, pp. 119-1128, 1992. Gadian. D. G, "NMR and its Application to living systems," Oxford Univ. Press, Oxford, 1982. Hatamian. M, “A real-time two-dimensional moment generating algorithm and its single chip implementation,” IEEE Trans. Acoustics, Speech, and Signal Processing, ASSP-34, pp. 546533, June 1986. Hu. M. K, “Visual pattern recognition by moment invariants,” IRE Trans. Information Theory, vol. 8, pp. 179-187, February 1962. Hung. D. L, Cheng. H.-D, and Sengkhamyong. S, "Design of a hardware accelerator for realtime moment computation: A wavefront array approach," IEEE Trans. Industrial Electronics, vol. 46, no. 1, pp. 207-218, 1999. Hupkens. T. M and Clipperlier. J. de, "Noise and intensity invariant moments," Pattern Recognition Letters, vol. 16, pp.371-376, 1995. Li. B.-C and Shen. J, “Fast computation of moment invariants,” Pattern Recognition, vol. 24, no. 8, pp. 807-813, 1991.
[2]
[3] [4] [5]
[6] [7] [8]
[9] [10]
[11] [12]
110 [13] [14] [15] [16] [17]
Abdel latif Ibrahim Abu Dalhoum Li. B. –C, and Shen. J, “Pascal triangle transform approach to the calculation of 3-D moments,” Graphical Models and Image Processing,” vol. 54, no. 4, pp. 301-307, July 1992. Li. B. C and Ma. S. D, "Efficient computation of 3D moments," in Proceedings, 12th International Conference on Pattern Recognition, vol. I, pp. 22-26, 1994. Li. B.-C, "High order moment computation of gray-level images," IEEE Trans. Image Processing, vol. 4, no. 4, ,pp. 502-505, April, 1995. Liao. S. X., and Pawlak. M, "On image analysis by moments," IEEE Trans. on Pattern Recognition and Machine Intelligence, vol. 18, no. 3, pp. 254-266, 1996. Liu J. G., Chan F. H. Y., Li H. F., and Lam F. K., "Systolic array for fast computation of moment invariants," proceedings of SPIE-the International Society of Optical Engineering, vol. 3545, pp. 21-23, Oct. 1998. Liu J.G., Chan F. H. Y., Lan F.K., Li H. F., "New approach to fast calculation of moments of 3D gray level images," Parallel Computing, vol. 26, no. 6, pp. 805-815, may 2000. Lo. C.-H, and Don. H.-S, "3-D moment forms: Their construction and application to object identification and positioning," IEEE Trans. Pattern Analysis and Machine Intelligence, vol. 11, no. 10, pp. 1053-1064, October 1989. Mamistvalov. G, “n-Dimensional moment invariants and conceptual mathematical theory of recognition n-dimensional solids,” IEEE Trans. PAMI-20, no. 8, pp. 819-831, August 1998. Markandey. V and deFigueiredo. R. J. P, “Robot sensing techniques based on high-dimensional moment invariants and tensors,” IEEE Trans. on Robotics and Automation, vol. 8, no. 2, pp. 186-194, April 1992. Martinez. Judit and Thomas. Federico, "A reformulation of gray-level image geometric computation for real-time applicatins," Proceedings of IEEE, International Conference on Robotics and Automation Minneapolis, Minnesota, pp. 2315-2320, April 1996. M. S. A. "Parallel algorithms for the efficient computation of large size image moments," Engineering Journal, University of Baghdad, pp.134-140, January 1998. Mukandan. R, and Ramakrishnan. K.R, "Fast computation of Legendre and Zernike moments," Pattern Recognition, vol. 28, no. 9, pp. 1433-1442, 1995. Perantonis. S. J, and Lisboa. P. J. G, "Translation, rotation, and scale invariant pattern recognition by high-order neural networks and moment classifiers," IEEE Trans. on Neural Networks, vol. 3, no. 2, pp.241-251, March 1992. Principe. J. C, Yu. F. S, and. Reid. S. A, "Display of EEG chaotic dynamics," 1st International conference on visualization in biomedical computing, pp. 346-351, 1990. Prokop. R. J, and Reeves. A. P, “A survey of moment-based techniques for unoccluded object representation and recognition,” Graphical Models and Image Processing, vol. 54, no. 5, pp. 438-460, Sept., 1992. Reevs A. P., "A parallel mesh moment computer," in proceedings of the 6th International Conference on Pattern Recognition, pp. 465-467, October 1982. Shu. H. Z, Luo. L. M, Yu. W. X, Fu. Y, "A new fast method for computing Legendre moments," Pattern Recognition, vol. 33, pp. 341-348, 2000. Spiliotis. Iraklis M and Mertzios. Basil G., "Real-time computation of two-dimensional moments on binary image using image block representation," IEEE Trans. Image Processing, vol. 7, no. 11, pp. 1609-1615, 1998. Taxt. T and Lundervold. A, "Multispectral analysis of brain using magnetic resonance imaging," IEEE Transactions on Medical Imaging, vol. 13, pp. 470-481, 1994. Teague. M. R, “Image analysis via the general theory of moments,” J. Opt. Soc. Amer., vol. 70, pp. 920-930, August 1980. Wang. L, and Healey. G, "Using Zernike moments for the illumination and geometry invariant classification of multispectral texture," IEEE Trans. Image Processing, vol. 7, no. 2, pp. 196203, February 1998.
[18] [19]
[20] [21]
[22]
[23] [24] [25]
[26] [27]
[28] [29] [30]
[31] [32] [33]
A Comparative Survey on the Fast Computation of Geometric Moments [34]
111
[35]
[36] [37]
[38] [39]
Wong. W.-H, and Siu. W.-C, "Improved digital filter structure for the fast moments computation," Proceedings of IEE on Vision, Image and Signal Processing, vol. 146, no. 2, pp. 73-79, April 1999. Wu Y. and Zhu. Z., "Computation of moment invariants and Hadamard transform using neural net," IEEE proceedings of the National Aerospace and Electronics conference, vol. 1, p.23-27, May, 1994. Yang. L, and Albregsten. F, “Fast and exact computation of Cartesian geometric moments using discrete Green’s theorem,” Pattern Recognition, vol. 29, no. 7, pp. 1061-1073, 1996. Yang. L, Albregsten. F, and Taxt. T, “Fast computation of three-dimensional moments using a discrete divergence theorem and a generalization to higher dimensions,” Graphical Models and image Processing, vol. 59, no. 2, pp. 97-108, March, 1997. Zakaria et al. M. F, “Fast algorithm for the computation of moment invariants,” Pattern Recognition, vol. 20, pp. 639-643, 1987. Zhou F. and Kornerup P., "Computing moments by prefix sums," Journal of Signal, Image, and Video Technology, vol. 25, no. 1, pp. 5-7, 2000.