Abstract
Free full text
Fast computation of Tchebichef moments for binary and grayscale images
Abstract
Discrete orthogonal moments have been recently introduced in the field of image analysis. It was shown that they have better image representation capability than the continuous orthogonal moments. One problem concerning the use of moments as feature descriptors is the high computational cost, which may limit their application to the problems where the on-line computation is required. In this paper, we present a new approach for fast computation of the two-dimensional Tchebichef moments. By deriving some properties of Tchebichef polynomials, and using the image block representation for binary images and intensity slice representation for gray-scale images, a fast algorithm is proposed for computing the moments of binary and gray-scale images. The theoretical analysis shows that the computational complexity of the proposed method depends on the number of blocks of the image, thus, it can speed up the computational efficiency as far as the number of blocks is smaller than the image size.
I. INTRODUCTION
Moments and moment functions have been extensively used for feature extraction in pattern recognition and object classification [1]–[5]. One important property of the moments is their invariance under affine transformation. The pioneering work on this subject was by Hu [6]. Since then, many applications have been developed, which made use of geometric, complex, rotational and orthogonal moments [7]–[12].
Considerable attention has been paid on the theoretic study and application of the orthogonal moments since they can be easily used to reconstruct the image, and have the minimum information redundancy to represent the image [13]–[17].
Recently, discrete orthogonal moments such as Tchebichef, Krawtchouk, dual Hahn, Racah and Hahn moments have been introduced in image analysis community [18]–[23]. It was shown that they have better image representation capability than the continuous orthogonal moments.
One main difficulty concerning the use of moments as feature descriptors is their high computational complexity. To solve this problem, a number of fast algorithms have been reported in the literature [24]–[39]. Most of them concentrated on the fast computation of geometric moments and continuous orthogonal moments. Less attention has been paid on the fast computation of discrete orthogonal moments [35]–[39]. Wang and Wang [35] proposed a recursive algorithm based on Clenshaw’s recurrence formula to compute the Tchebichef moments. Kotoulas and Andreadis [36] presented a hardware technique based on FPGA for implementing the calculation of Tchebichef moment values. They further proposed a more flexible architecture [37] dealing with various types of moments. Papakostas et al. [38] derived a unified methodology based on the image representation method for efficiently computing the discrete orthogonal moments. Bayraktar et al. [39] proposed an approach that consists of calculating the polynomial coefficients with arbitrary precision.
In this paper, we propose an efficient computation of Tchebichef moments for both binary and gray-scale images. For binary images, by using the image block representation proposed by Spiliotis and Merzios [25], the image moments can be obtained from the moments of all blocks. We further derive some properties of Tchebichef polynomials which can be used to efficiently calculate the moments of each block. The proposed method is then extended to gray-scale images by using the so-called ‘intensity slice representation’ introduced by Papakostas et al. [28].
The rest of the paper is organized as follows. In Section II, we review the definition of Tchebichef moments. Section III gives a brief introduction of the image block representation and the intensity slice representation. In Section IV, we first derive some properties of Tchebichef polynomials, and then propose a fast algorithm for computing the Tchebichef moments for both binary and gray-scale images. The computational complexity is analyzed in Section V and some experimental results are also provided. Section VI concludes the work.
II. Tchebichef moments
The two-dimensional (2-D) Tchebichef moment of order (n+m) of an image intensity function f(x, y) with size N × N is defined as [18], [19]
where tn(x) is the nth order orthonormal Tchebichef polynomial defined by
Here (a)k is the Pochhammer symbol
and the squared-norm ρ(n, N) is given by
Equation (2) can be rewritten as
where
The orthogonality property leads to the following inverse moment transform
If only the moments of order up to (M−1, M−1) are computed, equation (7) is approximated by
III. Representation of binary and gray-scale images
A. Image block representation for binary images
Image block representation (IBR) was introduced by Spiliotis and Mertzios [25] and has been used to achieve a fast computation of geometric moments for binary images.
A binary image, f(x, y), can be represented as a set of blocks, each block corresponding to an object or a part of object. This block is defined as a rectangular area, which gathers a set of connected pixels whose value is included in the same value interval. This area building is briefly reviewed through the following algorithm [25], [28].
Algorithm IBR
- Step 1 Consider each line y of the image f(x, y) and find object level intervals in line y.
- Step 2 Compare intervals and blocks that have pixels in line y−1.
- Step 3 If an interval does not match with any block, this is the beginning of a new block.
- Step 4 If a block matches with an interval, the end of the block is in the line y.
After applying the algorithm, the binary image is represented as a set of blocks of level one. This block-represented image is described by the relation
where bi is the ith block and K is the total number of blocks. Each block is described by the coordinates of the upper left and down right corner in vertical and horizontal axes.
B. Partial intensity slice representation for gray-scale images
Papakostas et al. [28] recently introduced a new image representation scheme, known as the intensity slice representation (ISR), which decomposes a gray-scale image f(x, y) into a series of two-level images fi(x, y), that is
where L is the number of slices (equal to the number of different intensity values) and fi(x, y) is the intensity function of the ith slice. In the case of a binary image, we have L = 1, so that, f(x, y) = f1(x, y).
Once a gray-scale image is decomposed into several slices according to the ISR scheme, each slice can be considered as a two-level image where the IBR algorithm can be applied. Instead of applying the IBR algorithm to each slice, Papakostas et al. [28] proposed to use the partial IBR (PIBR) algorithm. The PIBR algorithm consists of one pass of the image and a bookkeeping process, which can be described as follows.
Algorithm PIBR
- Step 1 Consider each line y of the image f(x, y) and find object level intervals for each intensity value that exists in line y.
- Step 2 Compare intervals and blocks that have the same intensity line y−1.
- Step 3 If an interval does not match with any block of the same intensity, this is the beginning of a new block.
- Step 4 If a block matches with an interval of the same intensity, the end of the block is in the line y.
After applying the algorithm, the gray-scale image f(x, y) can be redefined in terms of blocks of different intensities as
where bij is the jth block of slice i and Ki is the number of image blocks having intensity fi. Each block is described by the coordinates of the upper left and down right corner in vertical and horizontal axes.
IV. Fast computation of Tchebichef moments
In this section, we first derive some properties of orthonormal Tchebichef polynomials, and then develop an efficient algorithm for computing the Tchebichef moments.
A. Some properties of orthonormal Tchebichef polynomials
Theorem 1
Let
then the coefficients gl(n, k) are given by
where DN =(dn, k), with 0 ≤ k ≤ n ≤ N−1, is the inverse of the lower triangular matrix CN =(cn, k) of size N × N, i.e.,
The proof of Theorem 1 is deferred to Appendix. In order to apply Theorem 1, an essential step consists of finding the inverse matrix DN when the original matrix CN is known. In this paper, we are interested in the use of Tchebichef polynomials. For the orthonormal Tchebichef polynomials tn(x) defined by (5) and (6), we have the following Proposition.
Proposition 1
For the lower triangular matrix CN whose elements cn, k are defined by (6), the elements dn, k of the inverse matrix DN are given by
The proof of Proposition 1 is deferred to Appendix. Based on Theorem 1 and Proposition 1, we can easily derive the following result.
Corollary 1
For the orthonormal Tchebichef polynomials, letting
then we have
For the purpose of this paper, we are particularly interested in the case where a=1 in (15). By the definition of (a)k given by (3), we have (−1)0 = 1, (−1)1 = −1, and (−1)l = 0 for l ≥ 2. Using these properties, equation (15) becomes
where gl(n, k), l = 0, 1, defined by (16), are given as
where
For the computation of g0(n, k), we have the following result.
Theorem 2
For g0(n, k) given by (18), we have
The proof of Theorem 2 is deferred to Appendix.
Using (21), equation (17) becomes
We are now ready to propose a new approach for efficiently computing the Tchebichef moments defined by (1). This is the subject of the following subsections.
B. Fast computation of Tchebichef moments for binary images
For a binary image f(x, y) represented by K blocks, as described in (10), equation (1) can be rewritten as
where (x1,bi, y1,bi) and (x2,bi, y2,bi) are respectively the left-up and right-bottom coordinates of the block bi, and
with
Equation (23) shows that to obtain the image moments, we need to calculate the moments of each block, so we turn to it in the following. Since Sn(x1,bi, x2,bi) and Sm (y1,bi, y2,bi) given in (25) can be calculated in a similar way, we consider only the computation of Sn (x1,bi, x2,bi).
Assuming that the block bi contains δbi = x2,bi − x1,bi + 1 pixels in width, we have
Using (22), we have
Summing the two sides of (27) from j = 0 to δbi − 1, we obtain
Using (26) and making the notation
Equation (28) becomes
Let Vm(x1,bi, x2,bi) = (S0(x1,bi, x2,bi), S1(x1,bi, x2,bi), … SM−1(x1,bi, x2,bi))T and UM(δbi) = (R0(δbi), R1(δbi),… RM−1(δbi))T where the subscript T denotes the transpose and M is the maximal order of Tchebichef moments we want to calculate, we have
where AM is an M × M lower triangular matrix given by
The elements g1(n, k) of the matrix AM can be computed via (19). In particular, we have
Since all the diagonal elements are not zero, the matrix AM is non-singular. Thus, we have
The above equation shows that to obtain the values of VM(x1,bi, x2,bi), we need only to compute Um(δbi), which can be done via (29). The Tchebichef polynomial values can be calculated by the following recurrence formula [19]
where
and
Note that in (35), the following symmetric property is used
As indicated by Mukundan [19], the use of (35) and (38) allows avoiding the numerical instability in the calculation of polynomial values.
Because the computation of g1(n, k) for 0 ≤ k ≤ n−2, when using (19), requires the evaluation of factorial functions, this could be time consuming. To avoid this, we use the following recurrence relations for computing the coefficients Bn, k, s.
It is worth noting that the elements g1(n, k) are independent of the image f(x, y), they can thus be pre-computed and stored in a look-up table for further use.
C. Fast computation of Tchebichef moments for gray-scale images
By using the ISR algorithm, the Tchebichef moments of a gray-scale image f(x, y), which is described by (11), can be computed as
where Tnm(i) is the (n+m)th order Tchebichef moments of the ith binary slice.
Equation (43) shows that the (n+m)th order Tchebichef moment of a gray-scale image f(x, y) is equal to the intensity-weighted sum of the same order Tchebichef moments of a number of binary slices. The latter moments can be computed using the algorithm presented in the previous subsection.
To summarize, the proposed method for computing the moment values is described as follows.
Algorithm for computing the Tchebichef moments
- Step 1 Image block extraction using IBR algorithm for binary image and PIBR algorithm for gray-scale image.
- Step 2 Computation of Tchebichef polynomial values at corners of each block using (35), and then the vector Rn(δbi) with (29).
- Step 3 Calculation of 1-D Tchebichef moments of each block using (34).
- Step 4 Computation of image moment values using (23) for binary image and (43) and (23) for gray-scale image.
V. Computational complexity and experimental results
In this section, we give a detailed analysis of computational complexity of the proposed algorithm, and provide some experimental results to validate the theoretic analysis.
A. Computational complexity
The complexity of the proposed algorithm is due to the extraction of the extraction of image blocks with the PIBR algorithm and to the computation of Tchebichef moments based on (23) for binary images or on (43) for gray-scale images. As pointed out by Papakostas et al. [28], the procedure of block extraction is performed by simple mathematical and logical operations, and it adds very short time overhead in the overall computation. For this reason, we do not take this part into account.
Since the computation of Tchebichef moments for a gray-scale image based on (43) depends on the algorithm being used to compute the moments of each slice, we first consider the arithmetic complexity of (23) using the proposed algorithm.
Let us consider the case where a binary image contains one rectangular block with level one. For simplicity and without loss of generality, assume a square block with J × J pixels, and the moments up to order (M−1, M−1) need to be calculated. For the direct method based on (1), the computation of Tchebichef polynomial values tn(x) using the recursive formula (35) for each given x requires 1 addition and 2 multiplications. The same number of arithmetic operations is needed for tm(y). Thus, the computation of Tchebichef moments Tnm of order up to (M−1, M−1) based on (1), using the direct method, for a block size J × J pixels needs M2(3J2−1) additions and 5M2J2 multiplications.
We then analyze the complexity of the proposed algorithm based on eqs (23) and (34). The computation of the vectors UM(δbi) and VM(x1,bi, x2,bi) requires respectively 3M additions and 4M multiplications, and M(M−1)/2 additions and M(M+1)/2 multiplications. Thus, the total arithmetic operations required in the computation of VM(x1,bi, x2,bi) are M2/2+5M/2 additions and M2/2+9M/2 multiplications. The same number of operations is required for VM(y1,bi, y2,bi). Therefore, the computation of M2 Tchebichef moments using (23) and (34) requires M2+5M additions and 2M2+9M multiplications. Table I summarizes these results. For comparison purpose, we also list in Table I the arithmetic complexity of the algorithms reported in Refs. [35], [37] and [38]. Note that the algorithm presented in [37] leads to the same number of arithmetic operations as in [36], and the method for computing the block moments reported in [38] is just based on (24), which requires (4J−2)M2 additions and (4J+1)M2 multiplications. It can be seen from this table that among these methods, both the proposed algorithm and the algorithm reported in [37] are independent of the block size, and our method has the lowest computational complexity.
TABLE I
For a gray-scale image f(x, y) with size N × N, suppose that the total number of blocks for all the slices is NB, that is,
B. Experimental results
Some experimental results are provided in this subsection to validate the theoretical analysis. Since the algorithm presented in [37] was realized by hardware architecture, we compare here the proposed algorithm with the direct method, the recursive algorithm presented in [35] and the fast algorithm reported in [38] in terms of the computational efficiency. We do not provide a full comparison of our method with that reported in [39] for the following reasons: the main advantage of the technique presented by Bayraktar et al. [39] is its high precision. As noted by the authors, the computation of polynomial values using arbitrary precision calculator is much slower than the recurrence formula. So, their method is fast only if all the polynomial coefficients are pre-computed and stored in a look-up table. On the contrary, Bayraktar’s algorithm is less efficient than the previously reported fast algorithms.
In the first example, four binary images with size 256 × 256 pixels (Fig. 1) selected from the well-known MPEG-7 CE-shape-1 Part B database [40] were used as test images. The number of blocks of these images is NB = 171 for Apple, NB = 44 for Hammer, NB = 388 for Octopus and NB = 136 for Tree. Fig. 2 shows the average computation time of moments up to order (120, 120) for these four images using the direct method, the recursive algorithm based on Clenshaw’s recurrence formula, the algorithm reported in [38] and the proposed algorithm. Note that the algorithm was implemented in C++ on a PC Dual Core 2.33 GHz, 2GB RAM. Fig. 2 shows that the proposed algorithm is the fastest among all the methods, and the algorithm presented in [38] is more efficient than the other two methods. This is because these binary images have a small number of blocks. Note that the computation time for extracting the blocks of each image is about 1 ms, this time is much less than the computation time required in the calculation of moments.
In the second example, four gray-scale images with size 256 × 256 pixels shown in Fig. 3 have been used. The number of blocks of these images is NB = 56211 for Lena, NB = 53048 for Pepper, NB = 47664 for Women and NB = 38561 for House. The computation time for extracting the blocks of each image is about 2 ms. Fig. 4 shows the average computation time up to order (120, 120) for these four images using various methods. The result again indicates that our method has better performance than the other algorithms. But the algorithm presented in [38] is only faster than the direct method due to the large number of blocks in these images, and the computation of 1-D moments based on (24) is time intensive. Fig. 5 shows the reconstructed results using the inverse transform (8).
From the two previous experiments, it can be observed that our algorithm depends on the number of image blocks, which is related to the image content, rather than on the image size. To illustrate this, the images shown in Figs. 1 and and33 were scaled to different sizes (from 320 × 320 to 1024 × 1024) where the nearest interpolation was used. Using such an interpolation, the number of blocks does not change. Fig. 6 shows the average computation time required in the calculation of moments of order up to (40, 40) for different image sizes. It can be seen from this figure that both the proposed algorithm and Papakostas’s algorithm are much more efficient than the two other algorithms. To make a full comparison in terms of the efficiency of different methods, we also apply the bilinear interpolation to images shown in Figs. 1 and and3.3. In such a case, the number of blocks increases with the image size. The average computation time required in the calculation of moments of order up to (40, 40) for different image sizes is shown in Fig. 7. It can be observed from this figure that the computation time required in our method and Papakostas’s method increases compared to that of Fig. 6. However, the proposed method remains the most efficient one.
VI. Conclusions
In this paper, by deriving some properties of Tchebichef polynomials, and using the image block representation and intensity slice representation, we have presented a fast algorithm for computing the Tchebichef moments for both binary and gray-scale images. The computation of the moments using the proposed method only depends on the number of blocks, thus, it can significantly decrease the computation time when the number of image blocks is much smaller than the image size.
Acknowledgments
The authors would like to thank the reviewers and Associate Editor Dr. Wu for their insightful suggestions which helped improve the quality of the manuscript.
This work was supported by the National Natural Science Foundation of China under Grants 60873048 and 60911130370, the National Basic Research Program of China under Grant 2010CB732503 and the Natural Science Foundation of Jiangsu Province of China under Grants SBK200910055 and BK2008279.
Appendix A
Proof of Theorem 1
By definition of dn, k, we have
Using the following relationship [41]
where
The proof of Theorem 1 is completed.
Proof of Proposition 1
To prove the proposition, we need to demonstrate the following relation
where δnm is the Kronecker symbol.
For n = m, it can be easily deduced from (A5) that
To prove (A4) for m < n, letting
It can be verified that
Substitution of (A8) into (A5), we obtain
The proof is now complete.
Note that the proof of Proposition was inspired by a technique proposed by Petkovsek et al. [42].
References
Full text links
Read article at publisher's site: https://doi.org/10.1109/tip.2010.2052276
Read article for free, from open access legal sources, via Unpaywall: https://europepmc.org/articles/pmc3235093
HAL Open Archive
http://www.hal.inserm.fr/inserm-00503235
Citations & impact
Impact metrics
Citations of article over time
Smart citations by scite.ai
Explore citation contexts and check if this article has been
supported or disputed.
https://scite.ai/reports/10.1109/tip.2010.2052276
Article citations
Performance enhancement of high order Hahn polynomials using multithreading.
PLoS One, 18(10):e0286878, 25 Oct 2023
Cited by: 0 articles | PMID: 37878605 | PMCID: PMC10599504
Subspace-based discrete transform encoded local binary patterns representations for robust periocular matching on NIST's face recognition grand challenge.
IEEE Trans Image Process, 23(8):3490-3505, 06 Jun 2014
Cited by: 2 articles | PMID: 24951691
A Unified Methodology for Computing Accurate Quaternion Color Moments and Moment Invariants.
IEEE Trans Image Process, 23(2):596-611, 07 Nov 2013
Cited by: 2 articles | PMID: 24216719
Improving the performance of image classification by Hahn moment invariants.
J Opt Soc Am A Opt Image Sci Vis, 30(11):2381-2394, 01 Nov 2013
Cited by: 3 articles | PMID: 24322939
Similar Articles
To arrive at the top five similar articles we use a word-weighted algorithm to compare words from the Title and Abstract of each citation.
Image analysis by Tchebichef moments.
IEEE Trans Image Process, 10(9):1357-1364, 01 Jan 2001
Cited by: 50 articles | PMID: 18255550
Efficient 3D geometric and Zernike moments computation from unstructured surface meshes.
IEEE Trans Pattern Anal Mach Intell, 33(3):471-484, 01 Mar 2011
Cited by: 9 articles | PMID: 20714011
Accurate calculation of image moments.
IEEE Trans Image Process, 16(8):2028-2037, 01 Aug 2007
Cited by: 4 articles | PMID: 17688208
Real-time computation of two-dimensional moments on binary images using image block representation.
IEEE Trans Image Process, 7(11):1609-1615, 01 Jan 1998
Cited by: 6 articles | PMID: 18276226
An efficient method for the computation of Legendre moments.
IEEE Trans Pattern Anal Mach Intell, 27(12):1996-2002, 01 Dec 2005
Cited by: 5 articles | PMID: 16355666