Open access

Digital Filter Implementation of Orthogonal Moments

Written By

Barmak Honarvar Shakibaei Asli and Raveendran Paramesran

Submitted: 24 March 2012 Published: 16 January 2013

DOI: 10.5772/52191

From the Edited Volume

Digital Filters and Signal Processing

Edited by Fausto Pedro García Márquez and Noor Zaman

Chapter metrics overview

2,550 Chapter Downloads

View Full Metrics

1. Introduction

Accuracy in detection, robustness in performance and the ability to perform accurately and robustly are all integral considerations in image related research. However, since applications of such research often have a real-time constraint, speed of computation and its corollary -time-saving- have also become increasingly important in the research agenda.

The importance of geometric moment (GM) invariants first received research attention when Hu [1] introduced them in his study. As they capture global features have been widely used in applications such as object classification, image and shape analysis and edge detection [2-8]. However, since GMs are non-orthogonal, a set of continuous orthogonal moments including Zernike and Legendre moments was introduced by Teague [9]. Their desirable qualities of orthogonality, speed of computation and robustness have found a wider range of applications such as character recognition, two-dimensional (2D) direction-of-arrival estimation, and trademark segmentation and retrieval [10-13]. However, these continuous moments pose certain problems in computation: they require coordinate transformation and suitable approximation of the continuous moment integrals. The transformation and approximation they require create additional opportunities for the occurrence of error in the computation of the feature descriptors. This recognition of the error potential in continuous orthogonal moments led to a new set of discrete orthogonal moments such as Tchebichef, Krawtchouk and Hahn moments as these do not require coordinate transformation and the discretization step in the moment computation [14-18].

The computation of both continuous and discrete orthogonal moments can be realized directly or via the GMs. The complexity in deriving higher order GMs using a direct calculation approach raises a significant challenge for real-time applications. A number of studies address this issue using different approaches. Hatamian [19] proposed a novel approach that uses 2D all-pole digital filters with separable impulse responses to implement the first 16 GMs. Wong and Siu [20] moved the delay element in the basic filter structure as proposed in [19] from the feed-forward to the feedback path. Their method considered moment computation of up to the third order. Using a similar structure of cascaded digital filters, Kotoulas and Andreadis showed orthogonal moments can be generated from their outputs [21]. To reduce the chip area size, they introduced an overflow counter in each of the basic filter structures [22]. However, the plurality of large bit-width adders in the digital filter structure presents a major challenge to chip synthesis, placement and the routing process. Taking a different tack, Al-Rawi [23] generalized the relationship between the moments and the digital filter outputs using a recurrence formula.

Two facts demand our attention at this point. One, in all the aforementioned literature, the basic concept involved in the computation of moments using the digital filter structure has remained unchanged over the past three decades [19]-[20] even though this digital filter structure was formulated when only low orders of moments were used. Two, many recent works have involved increasingly higher moment orders. They include, among others, invariant image watermarking (30 orders) [24], moving object reconstruction (55 orders) [25], and hand shape verification (60 orders) [26].

Two models have been proposed to deal with higher order moments. The usage of cascaded all-pole digital filters in generating higher order GMs for the formulation of orthogonal moments has been successfully explored by Kotoulas and Andreadis. In their work [21]-[22], the 40th and 70th high order Zernike and Tchebichef moments, respectively were obtained from the digital filter outputs and their transform coefficients. Their digital filter was based on the feedforward model, and for a N   ×   N image, the digital filter output values for row filtering are sampled at N + 2 ,   N + 3 ,   N + 4 ,   ,   N + p + 2 , where p is the maximum order. The algorithm they propose, however, is undermined by a computational problem. At these time instances, the digital filter output values are much larger when compared to the earlier time instances. This is because the digital filter operates as an accumulator: their output values increase as the number of digital filters directly related to the order increases. The sample of digital filter output values obtained from the row filtering for each row are then used as inputs to the respective digital filters arranged in the column filtering. This further increases the size of the final digital filter outputs. Additionally, since the digital filter used is an approximation except for the first two orders, coefficients are then multiplied from second order onwards to make them exact. The coefficients, both positive and negative, are determined from the impulse response of the digital filter. The model proposed by Wong and Siu [20], though the digital filter outputs for all orders are sampled at their respective N , also suffers from a similar problem. The current approaches, it is clear, thus suffer from an increase in computational complexity arising from the large increase in the digital filter output values as the order increases [33]-[34].

The method of computation we propose in this work attempts to reduce computational complexity – and save time through a reduction in the number of additions – by addressing the problems arising from: 1) The increase in digital filter output values as the order of moment’s increases and 2) the consequent use of positive and negative coefficient multipliers to make them exact. To circumvent the problems arising from these two facts, we are proposing the use of only positive coefficient multipliers which then makes it possible to use lower digital filter outputs as the order of the moment increases in generation of GMs. As will be discussed in greater detail in Section 3, the proposed method is based on the formulation and understanding of the impulse response of the digital filters, the unit step function to be used and their relationship with GMs. This formulation makes it possible for the digital filter outputs to be evaluated at earlier instances at   N ,     N - 1 ,     N - 2 ,   ,   N - p , where the lowest digital filter output value, sampled at N - p is for the highest order. Meanwhile, this set of output values starts to decrease after p / 2 moment orders.

Recently, another types of discrete orthogonal moments such as Krawtchouk, dual Hahn, Racah, Meixner and Hahn moments have been introduced in image analysis community [16]–[17]. 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 [14]–[19]. Most of them concentrated on the fast computation of geometric moments and continuous orthogonal moments. This work examines various aspects; both theory and applications of image moment implementation using digital filter structures. Since these aspects can be discussed rather independently, we devote each chapter to the discussion of one particular aspect of moment structures. The following is a summary of contents of the sections.

  • Section 2: Orthogonal Moments. Numerous types of orthogonal polynomial, both in 1D and 2D, have been described in traditional mathematical literature. In this chapter we present a survey of orthogonal moments that are of importance in image analysis. The literature on orthogonal moments is very broad, namely in the area of practical applications, and our survey has no claim on completeness. We divide orthogonal polynomials and orthogonal moments into two basic groups. The polynomials orthogonal on a rectangle originate from 1D orthogonal polynomials whose 2D versions were created as products of 1D polynomials in x and y. The main advantage of the moments orthogonal on a rectangle is that they preserve the orthogonality even on the sampled image. They can be made scale-invariant but creating rotation invariants from them is very complicated. The polynomials orthogonal on a disk are intrinsically 2D functions. They are constructed as products of a radial factor (usually a 1D orthogonal polynomial) and angular factor which is usually a kind of harmonic function. When implementing these moments, an image must be mapped into a disk of orthogonality which creates certain resampling problems. On the other hand, moments orthogonal on a disk can easily be used for construction of rotation invariants because they change under rotation in a simple way.

  • Section 3: A New Formulation of Geometric Moments from Lower Output Values of Digital Filters. In this chapter we propose a new method to accelerate geometric moment’s computation using digital filters based on the lower output values. It is shown in this chapter a brief reviews of the digital filter methods employed in [19] and [20]. First, a description of the proposed method that includes the theoretical formulation of the relationship between the digital filter outputs and GMs is provided. Second, we discuss the computational complexity with both an artificial and two real images, and the computational time. Finally, this study with some suggestions for future research is concluded.

  • Section 4: A Reduced 2D digital Filter Structure for Fast Computation of Geometric Moments. It is shown in this chapter how to design a reduced 2D digital filter grid for fast computation of geometric moments. For this design, the 1D and 2D all-pole digital filter design procedure using the Z-transform properties is described. It also describes the recurrence equations for the desired filter outputs. The work shows the digital filter design used in [3] and [4], and shows the implementation of the proposed architecture. Finally, the computation results of the proposed method and the method used in [3] is illustrated.

  • Section 5: Conclusions. The presentation is concluded, summarizing the contents of the work and discussing possibilities which may be open for the future research.

Advertisement

2. Moment functions

Geometric Moments (GMs) and complex moments (CMs) are the simplest among moment functions, with the kernel function defined as a product of the pixel power coordinates. These type of moments are non-orthogonal and because of this problem, the inverse GMs or CMs formulation are not possible. On the other hand, the orthogonal moment functions have been used widley for image analysis. The orthogonal moment functions are based on the orthogonal polynomials such as Legendre, Zernike, Tchebichef, Krawtchouk and so on. All these moment functions play an important role in continuous or discrete domains of polynomials range.

2.1. Geometric and complex moments

GMs are defined with the basis kernel x p y q . The p + q th order two-dimensional GMs are denoted by m p q , and can be expressed as

m p q = - + x p y q f x , y d x d y   E1

where f x , y is the image intensity function. GMs of low orders have an intuitive meaning, m 00 is a “mass” of the image (for binary images, m 00 is an area of the object), m _ 01 / m _ 00   and m _ 10 / m _ 00   define the center of gravity or centroid of the image. Second-order moments m 02 and m 20 describe the “distribution of mass” of the image with respect to the coordinate axes. In mechanics they are called the moments of inertia. Another popular mechanical quantity, the radius of gyration with respect to an axis, can also be expressed in terms of moments as m 02 / m 00 and m 20 / m 00 , respectively.

Another popular choice of the polynomial basis x + i y p x - i y q where i is the imaginary unit, leads to complex moments

c p q = - + x + i y p x - i y q f x , y d x d y   E2

GMs and CMs carry the same amount of information. Each CM can be expressed in terms of GMs as

c p q = k = 0 p l = 0 q p k q l - 1 q - l i p + q - k - j m k + j , p + q - k - j E3

and vice versa

m p q = k = 0 p l = 0 q p k q l - 1 q - l 2 p + q i q c k + l , p + q - k - l E4

CMs are introduced because they behave favorably under image rotation. This property can be advantageously employed when constructing invariants with respect to rotation.

2.2. Orthogonal moments

If the polynomial basis p k j   x ,   y is orthogonal, i.e. if its elements satisfy the condition of orthogonality

G P p q x , y P m n x , y d x d y = 0   E5

or weighted orthogonality

G w x , y P p q x , y P m n x , y d x d y = 0   E6

for any indexes p m or q n , we speak about orthogonal (OG) moments. G is the area of orthogonality.

In theory, all polynomial bases of the same degree are equivalent because they generate the same space of functions. Any moment with respect to a certain basis can be expressed in terms of moments with respect to any other basis. From this point of view, OG moments of any type are equivalent to geometric moments.

However, a significant difference appears when considering stability and computational issues in a discrete domain. Standard powers are nearly dependent both for small and large values of the exponent and increase rapidly in range as the order increases. This leads to correlated geometric moments and to the need for high computational precision. Using lower precision results in unreliable computation of geometric moments. OG moments can capture the image features in an improved, non-redundant way. They also have the advantage of requiring lower computing precision because we can evaluate them using recurrent relations, without expressing them in terms of standard powers.

Unlike geometric moments, OG moments are coordinates of f in the polynomial basis in the common sense used in linear algebra. Thanks to this, the image reconstruction from OG moments can be performed easily as

f x , y = j k M k j P k j x , y   E7

2.3. Continuous moments

Some of orthogonal moments are in terms of a continuous variable such as Legendre, Zernike and Gaussian-Hermite moments. All of these continuous moments depend on the same continuous polynomials. Here, we will discuss about such these polynomial functions and moments.

2.3.1. Legendre moments

There have been many works describing the use of the Legendre moments in image processing, e.g. references [29] and [30], among many others. The Legendre moments are defined as

λ p q = 2 p + 1 2 q + 1 4 - 1 + 1 P p x P q y f x , y d x d ;   p , q = 0 ,   1 ,   2 ,     E8

where P n x is the n th degree Legendre polynomial (expression by the so-called Rodrigues’ formula)

P p x = 1 2 p p ! d p d x p x 2 - 1 p E9

and the image f x ,   y is mapped into the square - 1 ,   1 × - 1 ,   1 . The Legendre polynomials of low degrees expressed in terms of x p are

P 0 x = 1 ,   P 1 x = x , P 2 x = 1 2 3 x 2 - 1 , P 3 x = 1 2 5 x 3 - 3 x ,   P 4 x = 1 8 35 x 4 - 30 x 2 + 3 . E10

The relation of orthogonality is

- 1 1 P p x P q x d x = 2 2 q + 1 δ p q   E11

The recurrence relation, which can be used for efficient computation of the Legendre polynomials, is

P 0 x = 1 ,   P 1 x = x , P p + 1 x = 2 p + 1 p + 1 x P p x - p p + 1 P p - 1 x   E12

2.3.2. Zernike moments

Zernike moments (ZMs) were introduced into image analysis about 30 years ago by Teague [9] who used ZMs to construct rotation invariants. He used the fact that the ZMs keep their magnitude under arbitrary rotation. He also showed that the Zernike invariants of the second and third orders are equivalent to the Hu invariants when expressed in terms of geometric moments. He presented the invariants up to the eighth order in explicit form but no general rule about how to derive them was given. Later, Wallin [31] described an algorithm for the formation of rotation invariants of any order. Numerical properties and possible applications of ZMs in image processing among others. ZMs of the nth order with repetition l are defined as

A p q = p + 1 π 0 2 π 0 1 V p q * r , θ f r , θ r d r d θ ,       p = 0 ,   1 ,   2 ,     q = - p ,   - p + 2 ,   ,   p     E13

i.e. the difference n   -   l is always even. The asterisk means the complex conjugate. The Zernike polynomials are defined as products

V p q r , θ = R p q r e i q θ     E14

where the radial part is

R p q r = k = q , q + 2 ,     p B p q k r k E15

The coefficients

B p q k = - 1 p - k 2 p + k 2 ! p - k 2 ! k + q 2 ! k - q 2 !     E16

can be used for conversion from geometric moments,

A p q = p + 1 π k = q , q + 2 ,     p j = 0 k - q 2 l = 0 q k - q 2 j q l w l B p q k m k - 2 j - l , 2 j + l   E17

where

w = - i     ;     q > 0 i           ;       q 0     E18

The Zernike polynomials satisfy the relation of orthogonality

0 2 π 0 1 V p q * r , θ V k l r , θ r d r d θ = π p + 1 δ k p δ l q E19

The recurrence relation for the radial part is

R p q r = 2 p r p + q R p - 1 , q - 1 r - p - q p + q R p - 2 . q r   E20

Computation of the Zernike polynomials by this formula must commence with

R p p r = R p , - p r = r p     ,   p = 0 ,   1 ,      

2.4. Discrete moments

There is a group of orthogonal polynomials defined directly on a series of points and therefore they are especially suitable for digital images. Some of these polynomials such as Tchebichef, Krawtchouk, Hahn, dual Hahn and Meixner polynomials.

2.4.1. Tchebichef moments

The 2D TMs of order p + q of an image intensity function f n , m with size N × M is defined as

T p q = A p , N A q , M n = 0 N - 1 m = 0 M - 1 t p n t q m f n , m   E21

where t p n is the p th order orthogonal discrete Tchebichef polynomial defined by [8]

t p n = p ! k = 0 p - 1 p - k N - 1 - k p - k p + k p n k E22

and

A p , N = β p , N ρ p , N

where β p , N is a normalization factor. The simplest choice of this factor is N p . The recurrence relation of Tchebichef polynomials with respect to the chosen order is:

p + 1 t p + 1 n - 2 p + 1 2 n - N + 1 t p n + p N 2 - p 2 t p - 1 n = 0 E23

where p 1 and the first two polynomials are t 0 n = 1 and t 1 n = 2 n - N + 1 . The orthogonality property satisfies the following squared-norm:

ρ p , N = 2 p ! N + p 2 p + 1 E24

2.4.2. Krawtchouk moments

The definition of the n th order classical Krawtchouk polynomial is defined as

K n x ; p , N = k = 0 n a k , n , p x k = F 1 - n , - x ; - N ; 1 p 2   E25

where x , n = 0 ,   1 ,   2 ,   ,   N ,   N > 0 ,   p 0,1 and F 1 2 is the generalized hypergeometric function

F 1 a , b ; c ; z 2 = k = 0 a k b k c k z k k !     E26

and x k is the Pochhammer symbol given by

x k = x x + 1 x + 2 x + k - 1 k 1     a n d   x 0 = 1 E27

The normalized and weighted Krawtchouk polynomials K - n x ; p , N are defined as [10]

K - n x ; p , N = K n x ; p , N w x ; p , N ρ n ; p , N E28

where the weight function, w and the square norm, ρ are given as

w x ; p , N = N x p x 1 - p N - x   E29

and

ρ n ; p , N = p - 1 p n n ! - N n   E30

The normalized and weighted Krawtchouk polynomials have the following three-term recurrence relation:

p n - N K - n + 1 x ; p , N = A p N - 2 n + n - x K - n x ; p , N - B n 1 - p K - n - 1 x ; p , N E31

where

A = 1 - p n + 1 p N - n

B = 1 - p 2 n + 1 n p 2 N - n N - n + 1

with

K - 0 x ; p , N = w x ; p , N

K - 1 x ; p , N = 1 - 1 N p x w x ; p , N .

The 2D Krawtchouk moment of order n + m of an image intensity function f x , y with size N × M is defined as [16]

Q n m = x = 0 N - 1 y = 0 M - 1 K - n x ; p 1 , N - 1 K - m y ; p 2 , M - 1 f x , y E32

The orthogonality property leads to the following inverse moment transform

f x , y = n = 0 N - 1 m = 0 M - 1 Q n m K - n x ; p 1 , N - 1 K - m y ; p 2 , M - 1 E33

If only the moments of order up to N m a x   , M m a x are computed, then the reconstructed image in (2.30) can be approximated by

f ~ x , y = n = 0 N m a x m = 0 M m a x Q n m K - n x ; p 1 , N - 1 K - m y ; p 2 , M - 1 E34
Advertisement

3. Formulation of geometric moments using digital filters

This section first reviews the generation of GMs using digital filter structure as proposed by Hatamian [19]. This is then followed by a review of the improved version used by Wong and Siu [20].

3.1. Hatamian’s model

Hatamian proposed the all-pole digital filter structure to compute GMs up to the 16th order. The one dimensional GMs of order p for a N -length sequence x n is defined in this model as

m p = n = 0 N - 1 n p x n E35

One reason for using digital filters as a moment generator is based on the convolution of the aforementioned sequence with impulse response, n p u n , where u n is the unit step function. Hence, the output of the digital filter y p evaluated at the point n   =   N - 1 can be expressed:

y p N = k = 0 N - 1 x k N - k p     E36

where x n is the reversed sequence. Figure 1 shows the structure of a single pole digital filter with transfer function 1 z - 1 , which is equivalent to an accumulator with unity feedback. This accumulator has a delay in the feed-forward path. For p cascaded filters, the corresponding transfer function is given by

H p z = 1 z - 1 p + 1   E37

Figure 1.

Single-pole filter structure [19] in feedforward path.

The 1D cascaded filters structure is shown in Figure 2, where H 0 z = 1 z - 1 .

Figure 2.

Cascading of single-pole filters for generating of moments up to order p .

The relationship between GMs and the all-pole digital filter outputs are related by the following expression

m p = r = 0 p C p , r y r     E38

where y r is the r th digital filter output and C p , r is a matrix of coefficients directly obtained from the impulse responses of the all-pole digital filters as given in [27]:

C p , r = 0 ; r > p - 1 p ; r = 0 , p 0 r C p - 1 , r - 1 - r + 1 C p - 1 , r ; r > 0 , p > 0   E39

For a two dimensional image, the relationship between the GMs and digital filters outputs can be expanded to

m p , q = r = 0 p C p , r s = 0 q C q , s y r , s     E40

However, the all-pole filter structure has delays in the feed-forward path; hence it causes an increase in the computation time.

3.2. Wong and Siu’s model

To overcome this problem, Wong and Siu [20] moved the delay unit to the feedback path of the filter, as shown in Figure 3. The transfer function is given as

H p z = 1 1 - z - 1 p + 1 E41

Figure 3.

Single-pole filter structure [20] in feedback path.

In this case, however, the GMs are obtained from the digital filter outputs and a different matrix coefficient, as shown below:

m p = r = 0 p D p , r y r E42

where the coefficients of D p , r are obtained from the following recurrence formula shown in [23].

D p , r = 0 ; p > 0 , r = 0 1 ; p = 0 , r = 0 r D p - 1 . r - 1 - D p - 1 , r ; o t h e r s E43

For a two dimensional image, the relationship between the GMs and the improved digital filters structure outputs are related by

m p , q = r = 0 p D p , r s = 0 q D q , s y r , s   E44

3.3. Proposed method based on the lower output values of digital filters

We begin with the one-dimensional case, where the results can be easily extended to two-dimensional. Consider a digital filter with impulse response h p n =   n p u n , where u n is the unit step function and p is the moment order. Now, assume the input of the digital filter is given as x n as mentioned in (3.2). Based on the convolution theorem, the output, y n is therefore

y p n = x n * h p n E45

Using the digital filter as shown in Figure. 3 and changing the unit step function to u n + p to accommodate the sampling of the digital filter outputs at earlier instances, we get the following

y p n = x n * n + p p u n + p   = k = 0 n + p x k n - k + p p       E46

Substituting, n = N - p yields

y p N - p = k = 0 N x k N - k p E47

Expanding the binomial equation, and using the Stirling numbers we get

y p N - p = 1 p ! k = 0 N i = 0 p s 1 p , i x k N - k i E48

where s 1 p , i are the Stirling numbers of the first kind [28], which satisfy

N - k ! N - k - p ! = i = 0 p s 1 p , i N - k i E49

Using (3.2), we can rewrite (3.15) in terms of GMs as follows:

y p N - p = 1 p ! i = 0 p s 1 p , i m i   E50

Now by taking the inverse of (3.16), the GMs can be obtained in terms of the digital filter outputs thus:

m p = r = 0 p r ! s 2 p , r y r N - r E51

where s 2 p , r are the Stirling numbers of the second kind [28], and the Stirling numbers of the first and second kind can be considered to be inverses of one another:

p = 0 max i , r - 1 p - r s 1 p , i s 2 r , p = δ i r   E52

where δ i r is the Kronecker delta.

Notice now, for the p order, it can be shown that the digital filter outputs are sampled at N - p , unlike the previous works which were sampled at N or later instances of N [19]-[20]-[21]. As the order p 2 is reached, the digital filter output values begin to decrease. This allows the use of low value digital filter outputs for the formulation of GM. The 2D moments can be obtained by expanding the 1D model for the digital filter outputs as follows:

m p , q = r = 0 p s = 0 q r ! s ! s 2 p , r s 2 q , s y r s N - r , N - s E53

3.4. Experimental studies

A set of experiments were carried out to validate the theoretical framework developed in the previous sections and to evaluate the performance of the proposed structure. This section is divided into 3 parts. In the first subsection, an artificial image of size 4×4 is used to generate GMs up to third order. The computational complexity of three algorithms – the algorithms of [19], [20] and the proposed method – is then analyzed and discussed in the second subsection. In the third subsection, the speed of the proposed method is compared with the speed achieved using [19] and [20].

3.4.1. Artificial test image

rtificial test image of size 4×4 was used to prove the validity of the proposed approach. In this case, the digital filter outputs up to third order were generated. The intensity function of the test image is given in the following matrix:

x m , n = 111 114 109 101 103 116 113 108 106 102 107 110 112 104 105 115  

The difference between the digital filter output values for [20] and proposed structure is shown in Table 1. It is clear that for orders higher than one, the proposed output values are much lower than [20] as the order increases.

Digital filter outputs Filter structure output values[20] Proposed structure output values
y 00 1736 1736
y 01 4326 4326
y 02 8651 4325
y 03 15148 2172
y 10 4358 4358
y 11 10870 10870
y 12 21750 10880
y 20 8742 4384
y 21 21811 10941
y 30 15331 2205

Table 1.

A comparison of filter output values between [20] and the proposed method for an artificial image, x m , n , up to third order.

3.4.2. Computational complexity

The advantage of the proposed method lies in the smaller digital filter output values as compared to [19] and [20]. However, it would still be useful to study the computational complexity of these three methods and the direct method in term of the number of additions and multiplications. The proposed method, [19] and [20] consist of two main steps. Digital filter outputs are obtained from the respective digital filter structure. Then, these outputs are linearly combined to compute GMs.

For a grayscale image of size N × N and GM up to order of s , where s   =   p + q , the number of additions and multiplications for the proposed method, [19] and [20] are shown in Table 2.

Algorithm Additions(Digital filter stages) Additions (Digital filter outputs to GMs) Multiplications (Digital filter outputs to GMs)
[19] s + 1 N + s + 2 2 N + 1 s s + 1 s + 2 s + 7 24 s 4 + 10 s 3 + 23 s 2 - 34 s - 24 24
[20] s + 1 N + s + 2 2 N
s s - 1 s 2 + 3 s + 14 24 s s - 1 s 2 + 3 s + 14 24
Proposed method s + 1 N N + 2 - s + 2 s - 3 6 s s - 1 s 2 + 3 s + 14 24 s s - 1 s 2 + 3 s + 14 24

Table 2.

Complexity analysis of GMs computation using digital filters for image of size N × N and maximum order of s = p + q .

It can be seen that even though the complexity of the linear combination stage for the proposed method is the same as [20], there is saving in the number of additions at the digital filters stage. This can be clearly shown in the example below. For N   =   512 and s = 45 , the number of additions needed in the filter stage for [20] is 12612096 while the proposed method just requires 12090594 additions. The summary of the complexity comparison for all the three methods to compute GMs up to 45th order is shown in Table 3.

Algorithm Additions Multiplications
[19] 12847524 210795
[20] 12791451 179355
Proposed method 12269949 179355

Table 3.

Complexity analysis of GMs computation using digital filters for image of size 512 × 512 and s = 45 .

For a 128 × 128 grayscale image, the advantage of the proposed filter structure as compared to [19] and [20] is clearly depicted in Figure 4.

Figure 4.

Number of additions for a 128 × 128 grey-scaled image.

3.4.3. Speed performance and comparison studies

The computation speed of the proposed method is compared with [19] and [20]. CPU elapsed time is used in the evaluation process in all the performed numerical experiments. The codes were all written in MATLAB7 and simulations were run with a 3GHz Intel Core2 with 2GB RAM and the average time is used in the discussion. The images used for the experiments were the Pepper and Lena images, as shown in Figure 5.

Table 4 shows the simulation time for GMs computation on the Pepper image of size 128×128 for orders of 5 to 55, in a step of 10. The same experiment was repeated on the Lena image of size 512×512. The simulation times are shown in Table 5.

Moment order ( s = p + q ) [19] [20] Proposed method
5 0.4 0.39 0.388
15 1.12 1.104 1.05
25 2.03 1.97 1.81
35 3.28 3.14 2.82
45 5.15 4.87 4.32
55 7.96 7.48 6.63

Table 4.

CPU elapsed time in milliseconds for the 128 × 128 Pepper’s test image.

Moment order ( s = p + q ) [19] [20] Proposed method
5 6.03 6.02 6.00
15 16.264 16.222 16.018
25 26.817 26.722 26.13
35 37.866 37.677 36.494
45 49.663 49.325 47.343
55 62.542 61.982 58.99

Table 5.

CPU elapsed time in milliseconds for the 512 × 512 Lena’s test image.

The tables clearly show that the proposed method requires less time than [19] and [20] to compute GMs of the same order. They also show that the time saving increases as the order of moments increases. In Figure 6 and Figure 7 we provide a comparison of required CPU time between [19], [20] and the proposed method.

Figure 5.

Test images: (a) Peppers and (b) Lena.

Figure 6.

Linear scale of CPU time in seconds for the 128 × 128 gray-scale peppers image.

Figure 7.

Linear scale of CPU time in seconds for the 512 × 512 gray-scale Lena image.

Advertisement

4. A Reduced 2D digital filter structures for fast computation of geometric moments

In the previous works, the linear transformation is performed using an external PC to relate the outputs of the digital filter structure to generate the moments. However, finding of a relationship between the geometric or orthogonal moments and the digital filters outputs has been stood as the main meaning of similar works [19]-[20].

In all the above aforementioned literatures, the basic concept involved the computation of geometric and other types of moments using the accumulator grid structure has remain unchanged over the past decades.

First we summarize the designing modality of all-pole digital filters using 1-D and 2-D Z-transforms [32]. We believe that relevance creation manner among the real-time and Z-domain is one of the most essential issues in studying of digital image moments. This section presents the results of a study aimed at the formulation of a new method to reduce the filter resources used in the digital filter structure. This study, though not exhaustive, serves to provide a suitable classification framework that underlies a new approach in digital filter design for the computation of moments.

4.1. Reduced digital filter structure

Unlike the previous researchers who used a 1-D Z-transform to derive a 2-D digital filter structure by cascading the filters both in the rows and columns. However, we use a 2-D definition of Z-transform to obtain the impulse response of the filter which led to a reduced digital filter structure as compared with [19]. The 2-D Z-transform for the image, f m , n is given as:

F z 1 , z 2 = m = 1 + n = 1 + f m , n z 1 - m z 2 - n E54

The impulse response for a 2-D image becomes:

h p , q m , n = m + p m u m n + q n u n E55

and the transfer function H p , q z 1 , z 2 , in the 2-D Z-transform domain for this filter structure is shown as

H p , q z 1 , z 2 = 1 1 - z 1 - 1 p + 1 1 - z 2 - 1 q + 1 E56

Using the above transfer function, the relationship between the input and the output of the digital filter is:

Y p , q z 1 , z 2 = X z 1 , z 2 1 - z 1 - 1 p + 1 1 - z 2 - 1 q + 1 E57

Based on (4.4), the zero order of the digital filter output is derived as

Y 00 z 1 , z 2 = X z 1 , z 2 1 - z 1 - 1 1 - z 2 - 1 E58

Thereafter, a recurrence relationship between the previous and the next outputs of each digital filter for the row and columns as shown in Figure 8 can be obtained:

Y p + 1 , q z 1 , z 2 = Y p , q z 1 , z 2 1 - z 1 - 1   E59
Y p , q + 1 z 1 , z 2 = Y p , q z 1 , z 2 1 - z 2 - 1   E60

Figure 8.

Recurrence relationship between the digital filter outputs of the row and column.

By taking the inverse 2-D Z- transform of (4.6) and (4.7), we get the following:

y p + 1 , q m , n = y p + 1 , q m - 1 , n + y p , q m , n   E61
y p , q + 1 m , n = y p , q + 1 m , n - 1 + y p , q m , n E62

The implementation of proposed digital filter structure for generating moments up to p + q orders is shown in Figure 9.

Figure 9.

Reduced digital filters for generating the 2-D geometric moments up to p + q order.

Figure 10.

Digital filters for generating the 2-D geometric moments up to p + q order used in [2] and [8].

As compared to the digital filter structure used in [19] and [20] as shown in Figure 10, it can be seen that the difference is the prefix, y p q and y p used in the rows. In the proposed model, the outputs y 00 , y 10 ,..., y p 0 occur at the row filter, unlike in [19] and [20], they occur at the column filters. Hence, the difference in savings of digital filters used in the proposed method is determined by the maximum p order. for example, in the design of the 40th order geometric moments, where the maximum p order is 40, and thus the number of digital filters used in proposed method will be 40 digital filters less than [19] and [20].

In our proposed method, we begin by showing the relationship between the digital filter outputs and the geometric moments by considering a 1D image. So, the first few outputs of the digital filter are

y 0 N = k = 1 N x k h 0 N - k = μ 0 y 1 N = k = 1 N x k h 1 N - k = k = 1 N x k N - k + 1 = N + 1 μ 0 - μ 1 y 2 N = k = 1 N x k h 2 N - k = k = 1 N x k 1 2 N - k + 1 N - k + 2 = 1 2 N + 1 N + 2 μ 0 - 1 2 2 N + 3 μ 1 + 1 2 μ 2 E63

Hence by solving them, the above geometric moments can be obtained in terms of the digital filters outputs.

μ 0 = y 0 μ 1 = N + 1 y 0 - y 1 μ 2 = N + 1 2 y 0 - 2 N + 3 y 1 + 2 y 2 E64

A matrix notation showing the above relationship between the geometric moments and the digital filter outputs as expressed

μ P = C N Y P E65

where μ P is the geometric moment vector, Y P is the digital filter output vector, and C N is a square matrix that a recurrence relationship between this matrix elements is given as

C p r = 0                                                                                                                                                       ;             p < r - 1 p p !                                                                                                                             ;               p = r N + 1 p                                                                                                                           ;               r = 0 - p C p - 1 , r - 1 + p k = r p - 1 C p - 1 , k 2 k - r + 1 × 3 k - r + 1 2       ;         o t h . E66

where, represents the floor function.

Following the same procedure used in obtaining the 1-D relationship digital filter outputs and geometric moments, it can also be extended for 2-D image. This is done by taking the transpose of the digital filter outputs and the transpose of the matrix, C N . For a 2-D image of dimensions × N , the geometric moments can be obtained from

μ p q = C M Y p q T C N T E67

Also, the summation forms of (4.12) and (4.14) can be written as:

μ p = r = 0 p C p r y r   E68
μ p q = r = 0 p s = 0 q C p r C q s y s r E69

4.2. Experimental results

In this subsection, we will begin with an example to determine the geometric moments up to third order for 2-D image using the proposed and existing method [19]. Figure.3. shows the proposed digital filter structure and the structure used in [19]. As can be seen from Figure 11(a) and (b), the proposed filter structure used three less digital filters. The difference between them is maximum p - order. As the number of moment orders increases the savings of the digital filters will be large. For example, the geometric moments used are forty orders, and then the number of digital filters will be reduced by forty as compared with existing methods.

Figure 11.

Digital filter structure for generating up to third order geometric moments for 2-D image. (a) proposed model and (b) existing model.

4.2.1. Artifical test image

Artificial test images of small size are used to prove validity of the proposed architecture. To illustrate the workings, an artificial image with size of 2 × 3 to generate up to third order of geometric moments is considered. The intensity function of the test image is represented by the following input matrix:

x m , n = 5 3 6 2 4 1  

Consider the dimension of the input image is 2 × 3 , it means the endpoint of the filter outputs, is 6 . Therefore, all generated outputs by the row filters are defined at different intervals till 6 , where be represented by the Table 6. Table 7 shows the generated outputs by the column filters for two sampled seconds (3,6). The input image must be reversed in this method and denoted as x R .

n 0 1 2 3 4 5 6
x R 0 1 4 2 6 3 5
y 0 0 1 5 7 6 9 14
y 1 0 1 6 13 6 15 29
y 2 0 1 7 20 6 21 50
y 3 0 1 8 28 6 27 77

Table 6.

State table method used in [8] for obtaining row filter outputs.

n 3 6 n 3 6 n 3 6 n 3 6
y 0 7 14 y 1 13 29 y 2 20 50 y 3 28 77
y 00 7 21 y 10 13 42 y 20 20 70 y 30 28 105
y 01 7 28 y 11 13 55 y 21 20 90
y 02 7 35 y 12 13 68
y 03 7 42

Table 7.

State table method used in [8] for obtaining column filter outputs.

The highlighted outputs can be collected as Y matrix in (4.12) and the coefficients matrix ( D ) as defined in (3.9), will generate the third order moments’ set of the artificial image as follows:

μ 00 = 21   ,   μ 01 = 42   ,   μ 02 = 98   ,   μ 03 = 252 μ 10 = 28   ,   μ 11 = 55   ,   μ 12 = 125 μ 20 = 42   ,   μ 21 = 81 μ 30 = 70   E70

If we derive the moments of the same example with the proposed method, the endpoint of the procedure is also 6. However, the results of the digital filter outputs are listed in Tables 8 and 9. In this case, according to Figure 11(a), it is well-known that the number of the digital filter is deduced up to maximum p - order. Furthermore, in this method it does not need to reverse of the input sequence.

n 0 1 2 3 4 5 6
x T 0 5 2 3 4 6 1
y 0 5 7 3 7 6 7
y T 0 5 3 6 7 7 7
y 00 0 5 8 14 7 14 21
y 10 0 5 13 27 7 21 42
y 20 0 5 18 45 7 28 70
y 30 0 5 23 68 7 35 105

Table 8.

State table of proposed method for obtaining row filter outputs.

n 3 6 n 3 6 n 3 6 n 3 6
y 00 14 21 y 10 27 42 y 20 45 70 y 30 68 105
y 01 14 35 y 11 27 69 y 21 45 115
y 02 14 49 y 12 27 96
y 03 14 63

Table 9.

State table of proposed method for obtaining column filter outputs.

Based on (4.13) and (4.14), we can derive the digital filter outputs’ matrix ( Y )   and the coefficients matrices ( C M   ,   C N ), respectively. Then, the set of third order moments are obtained as (4.17).

4.2.2. Real test image

The images used for the experiments were the Pepper (128×128) and Lena (512×512) images as shown in Figure 12(a) and (b). As shown in Figure 13(a) and (b) the number of additions for digital filter processes are compared in [19] and the proposed method.

Figure 12.

Test images (a) Pepper and (b) Lena.

Figure 13.

Comparison of the number of additions in digital filter part for [19] and proposed method for (a) Pepper image (b) Lena image.

Advertisement

5. Conclusions

Orthogonal moments are widely used in image analysis and as pattern features in pattern classification. The computation of orthogonal moments can be achieved via geometric moments. Hatamian introduced cascaded digital filters, where each filter operates as an accumulator to generate geometric moments.

One of the weaknesses in using the outputs of the cascaded digital filters to generate the GMs is that the filter outputs increase exponentially as the orders of the moments increase. This work proposes a new formulation to solve this problem by sampling at earlier instances of N ,   N - 1 , . N + p , where p is the maximum moment order for an N × N image. This step then paved the way to use a set of lower digital filter output values. The work demonstrates the efficacy and validity of the new algorithm in two ways: one, by comparing its complexity of computation with the complexity of two state of the art models proposed by Katoulos and Andreadis [21] and Wong and Siu [20] and two, by carrying out a set of experiments on speed of computation comparing the results obtained using the proposed method with those obtained using existing methods. A number of findings indicate the superiority of the proposed method: (1) A savings of as much as 45% is achieved for the proposed method in the number of additions as the moment order approaches N when compared with the existing methods and (2) this leads to less computational time for the proposed method to derive the GMs. This work has focused on the software implications of the algorithm. If the proposed method is implemented in FPGA or ASIC based platforms, a great savings in terms of bit-widths will be realized.

Also we showed a reduced method where the number of digital filters used in the generating of geometric moments is reduced by p -order when compared with the existing methods. The proposed method is modeled using the 2D Z-transform, and the theoretical framework for the proposed reduced digital filter structure is developed and the experimental results validate the performance.

References

  1. 1. M. K. Hu. Visual pattern recognition by moment invariants, IRE Trans. Information Theory 8: 1962, 179-187.
  2. 2. H. S. Hsu. Moment preserving edge detection and its application to image data compression, Opt. Eng. 32: 1993, 1596–1608.
  3. 3. M. I. Heywood. Fractional central moment method for moment-invariant object classification, Proc. Inst. Elect. Eng. 142: 1995, 213–219.
  4. 4. S. Ghosal and R. Mehrotra. Orthogonal moment operators for subpixel edge detection, Pattern Recognition 26: 1993, 295–306.
  5. 5. S. O. Belkasim. Pattern recognition with moment invariants—A comparative study and new results, Pattern Recognition 24: 1991, 1117–1138.
  6. 6. J. Flusser. Pattern recognition by affine moment invariants, Pattern Recognition 26: 1993, 167–174.
  7. 7. J.F. Boyce and W.J. Hossack. Moment invariants for pattern recognition, Pattern Recognition Letters 1: 1983, 451-456.
  8. 8. Dong Xu and Hua Li. Geometric moment invariant. Pattern Recognition 41: 2008, 240-249.
  9. 9. M.R. Teague. Image analysis via the general theory of moments, J. Optical Society of America 70: 1980, 920-930.
  10. 10. A. Goshtasby. Template matching in rotated images, IEEE Transaction on Pattern Analysis and Machine Intelligence PAMI-7: 1985, 338–344.
  11. 11. V. Markandey and R. J. P. Figureueiredo. Robot sensing techniques based on high dimensional moment invariants and tensors, IEEE Transactions on Robotics and Automation 8: 1992, 186–195.
  12. 12. Y.S. Kim, W.Y. Kim. Content-based trademark retrieval system using visually salient feature, Image and Vision Computing 16: 1998, 931–939.
  13. 13. C.W. Chong, P. Raveendran, R. Mukundan. A comparative analysis of algorithms for fast computation of Zernike moments, Pattern Recognition, 36: 2003, 731–742.
  14. 14. Yap P. T., Paramesran R., Ong S. H. Image analysis using Hahn moments, IEEE Transaction on Pattern Analysis and Machine Intelligence PAMI-11: 2007, 2057–2062.
  15. 15. R. Mukundan, S. H. Ong, and P. A. Lee. Image analysis by Tchebichef moments, IEEE Transaction on Image Processing 10: 2001, 1357–1364.
  16. 16. P. T. Yap, R. Paramesran, and S. H. Ong. Image analysis by Krawtchouk moments, IEEE Transaction on Image Processing 12: 2003, 1367–1377.
  17. 17. G.Wang and S.Wang. Recursive computation of Chebyshev moment and its inverse transform, Pattern Recognition 39: 2006, 47–56.
  18. 18. Guojun Zhang, Zhu Luo, Bo Fu, Bo Li, Jiaping Liao, Xiuxiang Fan, Zheng Xi. A symmetry and bi-recursive algorithm of accurately computing Krawtchuk moments, Pattern Recognition Letters 31: 2010, 548-554.
  19. 19. M. Hatamian. A real-time two-dimensional moment generating algorithm and its single chip implementation, IEEE Transaction on Acoustic, Speech and Signal Processing, ASSP-34: 1986, 546–553.
  20. 20. 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, 146: 1999, 73-79.
  21. 21. L. Kotoulas and I. Andreadis. Fast computation of Chebyshev moments, IEEE Transaction on Circuits and System for Video Technology 16: 2006, 884–888.
  22. 22. L. Kotoulas and I. Andreadis. Real-time computation of Zernike moments, IEEE Transaction on Circuits and System for Video Technology 15: 2005, 801–809.
  23. 23. M. Al-Rawi, Fast zernike moments. Journal on Real-Time Image Processing 3: 2008, 86–96.
  24. 24. H. S. Kim and H Lee. Invariant image watermark using Zernike moments, IEEE Transaction on Circuits and System for Video Technology 13: 2003, 766–775.
  25. 25. S. P. Prismall, M. S. Nixon, and J. N. Carter. On moving object reconstruction by moments, in 13th British Machine Vision Conference, 2002, pp: 73–82.
  26. 26. G. Amayeh, G. Bebis, A. Erol, and M. Nicolescu. Peg-free hand shape verification using high order Zernike moments, in Proceeding Conference on Computer Vision and Pattern Recognition Workshop, 2006, pp: 17–22.
  27. 27. M. Al-Rawi, Y. Jie. Practical fast computation of Zernike moments, Journal of Computer Science and Technology 17: 2002, 181–188.
  28. 28. Hayes MH. Schaums’s outline of theory and problems of digital signal processing, Mc-Graw Hill, 1999, New York.
  29. 29. Zhang, H., Shu, H., Luo, L. and Dillenseger, J. L. A Legendre orthogonal moment based 3D edge operator, Science in China Series G: Physics, Mechanics and Astronomy, vol. 48, no. 1, 2005, pp. 1–13.
  30. 30. R. Mukundan and K. R. Ramakrishnan, Fast computation of Legendre and Zernike moments, Pattern Recognition 28, 1995, 1433–1442.
  31. 31. Wallin, A. and Kübler, O. Complete sets of complex Zernikemoment invariants and the role of the pseudoinvariants, IEEE Transactions Pattern Analysis and Machine Intelligence, vol. 17, no. 11, 1995, pp. 1106–10.
  32. 32. Barmak Honarvar, Raveendran Paramesran, Kim Han-Thung, Kah-Hyong Chang. A reduced 2-D digital filter structure for fast implemebntation of geometric moments, International Conference on Computer and Electrical Engineering 4th (ICCEE), Singapore, 2011.
  33. 33. Chern-Loon Lim, Barmark Honarvar, Kim Han Thung, Raveendran Paramesran. Fast computation of exact Zernike moments using cascaded digital filters. Journal Information Sciences, Vol. 181, No.17, 2011, pp 3638-3651.
  34. 34. Kah-Hyong Chang, Raveendran Paramesran, Barmak Honarvar Shakibaei Asli and Chern-Loon Lim. Efficient Hardware Accelerators for the Computation of Tchebichef Moments, IEEE Transaction on Circuit, System, and Video Technology. Vol 22, No. 3, 2012, pp 414-425.

Written By

Barmak Honarvar Shakibaei Asli and Raveendran Paramesran

Submitted: 24 March 2012 Published: 16 January 2013