# A Framework for Moment Invariants

For more than half a century, moments have attracted lot ot interest in the pattern recognition community.The moments of a distribution (an object) provide several of its characteristics as center of gravity, orientation, disparity, volume. Moments can be used to define invariant characteristics to some transformations that an object can undergo, commonly called moment invariants. This work provides a simple and systematic formalism to compute geometric moment invariants in n-dimensional space.

There are no comments yet.

## Authors

• 4 publications
• ### Isomorphism between Differential and Moment Invariants under Affine Transform

The invariant is one of central topics in science, technology and engine...
05/20/2017 ∙ by Erbo Li, et al. ∙ 0

• ### Using the discrete radon transformation for grayscale image moments

Image moments are weighted sums over pixel values in a given image and a...
08/25/2020 ∙ by William Diggin, et al. ∙ 0

• ### MomentsNet: a simple learning-free method for binary image recognition

In this paper, we propose a new simple and learning-free deep learning n...
02/22/2017 ∙ by Jiasong Wu, et al. ∙ 0

• ### Geometric Moment Invariants to Motion Blur

In this paper, we focus on removing interference of motion blur by the d...
01/21/2021 ∙ by Hongxiang Hao, et al. ∙ 0

• ### Facial Expression Classification Using Rotation Slepian-based Moment Invariants

Rotation moment invariants have been of great interest in image processi...
06/28/2016 ∙ by Cuiming Zou, et al. ∙ 0

• ### Fast 3D Image Moments

An algorithm to efficiently compute the moments of volumetric images is ...
12/15/2020 ∙ by William Diggin, et al. ∙ 0

• ### Invariant Representative Cocycles of Cohomology Generators using Irregular Graph Pyramids

Structural pattern recognition describes and classifies data based on th...
05/18/2011 ∙ by Rocio Gonzalez-Diaz, et al. ∙ 0

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## keywords:

Geometric moments, affine invariants, n-dimensional space.

## 1 Introduction

Since they were introduced in 1962 by Hu [1]

, Moment Invariants have generated a lot of interest in the pattern recognition field. During more that half a century, many theoretical frameworks and applications have been developed: pose estimation

[2, 3], character recognition [4], target recognition [5], quality inspection [6], image matching [7], multi-sensors fusion [8] and visual servoing [9], [10].

Initially, moment invariants have been mainly applied in 2D space. Subsequently, invariant from moments defined in higher dimensional space have been defined [8, 10, 11]. Although using moments of order higher than 2 is not new [12, 13, 14], such applications are gaining interest thanks to 3D vision sensors.

The first important result for deriving moment invariants is the fundamental theorem of moment invariants (FTMI) [1]. Hu employed his theorem to derive seven 2D moment invariants. In fact, the FTMI contains some mistakes that have been emphasized by Mamistvalov in [15] in 1970 (in Russian). Despite this, the FTMI as proposed by Hu has been quoted in several works until when Reiss established the revised fundamental theorem of moment invariants (RFTMI) in 2D Space. The FTMI was generalized for the n-dimensional case and applied in multi-sensor fusion in [8]. Unfortunately, the generalized theorem contains the same mistake as the one given by Hu. Finally, Mamistvalov proposed the correct generalization of the RFTMI to n-dimensional solids. The idea behind using the FTMI is that invariants of n-ary forms are also invariant in the case where the coefficients of the n-ary form are replaced by the corresponding moments. [16] proposed an algorithm for determining invariants of binary forms. In [17]

, a systematic method to derive independent moment invariants to orthogonal transformations in n-dimensional space has been proposed. The proposed scheme is based on rotation speed tensor rather than rotation matrix to obtain the invariant to rotations. More recent works in the last decade proposed systematic schemes for 2D and 3D cases

[18, 19], [20]. Despite the difference of terminology, the way to construct invariants in [16] and in [18] can be considered as similar.

This paper proposes a unified and novel scheme to derive affine invariants from geometric moments of n-dimensional solids. The idea behind the method is to consider that any affine transformation can be decomposed using SVD into a rotation followed by a non-uniform scale change then by another rotation. Firstly, the method proposed in this paper is quite simple to understand. Second, the method ensures that all possible invariants are obtained and redundancy between different invariants is quite easy to express and to eliminate using matrix algebra. In the next section, basic definitions of moment in n-dimensional space are presented. Then, in the subsequent sections, invariance to scale changes, to rotation and affine transformations will be dealt with.

## 2 Geometrical moments in n-dimensional space

### 2.1 Notations

The following notations will be used in the sequel:

• : the dimension of the considered space.

• and a moment and a centered moment of order of n-dimensional object.

• : vector composed by all moments of order

.

• : vector composed by all monomials of degree and using as variable the entries of .

• : vector obtained by all possible products between the entries of , ,….

• : scale change transformation in n-dimensional space

• : orthogonal transformation in n-dimensional space.

• : non-singular non singular matrix defining an affine transformation in n-dimensional space.

• : invariant to scale change.

• : invariant to rotations.

• : affine invariant.

### 2.2 Geometrical moments in n-dimensional space

We first recall some basic definitions of moment functions. Denoting the coordinates of a point in a n-dimensional space, the moments of the density function are defined by:

 mp1…pn=∫∞−∞…∫∞−∞xp11…xpnnf(x1,…,xn)dx1dx2…dxn=∫∞−∞…∫∞−∞xp11…xpnnf(X)dX. (1)

The moments of the density function exist if is piecewise continuous and has nonzero values only in a finite region of the space. The moment is called of order

Similarly, the centered moments of order are defined by:

 μp1…pn=∫∞−∞…∫∞−∞(x1−¯¯¯x1)p1…(xn−¯¯¯xn)pnf(X)dX, (2)

where are the coordinates of the object gravity center. It is well known that the centered moments are invariant to translations in their respective n-dimensional space. In the sequel, the objects are considered centered at the frame origin, which means that . Based on central moments, we propose an automatic scheme for deriving invariants to scale, to orthogonal transformations and finally to affine invariants. The results presented in this paper for continuous case can be extended straightforwardly moments of discrete distribution defined by

 mp1…pn=∑…∑xp11…xpnnf(x1,…,xn) (3)

## 3 Scale change

A scale change in n-dimensional space is defined by the following transformation:

 X′=SX (4)

where . The scale change is called uniform if . Invariants to uniform scale are easy to derive. Using (2) it is easy to show that after a scale change defined by , and moments of higher are multiplied by and respectively (remind ). Therefore, the ratio in an invariant to uniform scale change.

Let us now deal with a non-uniform scale change. For that, let define the following product of moments:

 pm=l∏i=1μkipi1…pin, (5)

such that

 l∑i=1(pij+1)ki=d,∀j=1,…,n (6)

and where is a positive integer. From (5), it can be seen that can be a product of moments of different orders. For each moment of the product, the power on the coordinate is given by the integer . This means that after the scale change (4), and are multiplied by and respectively. This results in a multiplication by and on and respectively. Therefore, after the scale change , the whole product is multiplied by (if the condition (6) is satisfied). Finally, since after (4), is multiplied by , the ratio:

 is=pmμd0,0…0 (7)

is an invariant to the scale change defined by (4).

Let us now gives some example of invariants to scale in 2D and 3D spaces:

• 2D space: ,

• 3D space:

• 4D space:

In the next section, a new scheme to obtain invariants to orthogonal transformation is given.

### 3.2 Orthogonal transformation and rotation speed

An orthogonal transformation is defined by the relation:

 X′=RX, (8)

where is a rotation matrix that have to satisfy and (

is the identity matrix in the n-dimensional space). One can show that a moment after a rotation can be expressed as linear combination of moments of the same order, where the coefficients of those combinations are polynomials on rotation matrix entries. The rotation invariance of some functions of moments are obtained thanks to the orthogonality condition of

. The latter is composed of constraints that are nothing but polynomials of orders

on the rotation matrix entries. For this reason, it is not possible to build invariants to rotations from moments of odd orders without putting them to some even power.

Rather basing our reasoning on the rotation matrix and its orthogonality condition, it is possible to build invariants based on rotation speed (Tensor) in very simple way. For that, let us consider that an n-dimensional solid undergoes a transformation in time. If a rotational speed is applied, the speed of each point of an n-dimensional object is given by:

 ˙X=LX (9)

where is an antisymmetric matrix defined by rotational speeds in the 2D planes built by two different axes. For instance is defined as follows:

• In 2D space:

 L2D=[0−ωω0] (10)

where is the rotation speed in the 2D plane.

• In 3D space:

 L3D=⎡⎢⎣0−ω3ω2ω30−ω1−ω2ω10⎤⎥⎦ (11)

where , , are respectively the rotation speeds in the planes , and . The scalars , , can be also be called respectively the rotation speeds around the x-axis, the y-axis and the z-axis in the case of 3D space.

• In 4D space, let us consider that the 4D frame has , , and . The antisymmetric matrix can be defined by:

 L4D=⎡⎢ ⎢ ⎢⎣0ω1−ω2ω3−ω10ω4−ω5ω2−ω40ω6−ω3ω5−ω60⎤⎥ ⎥ ⎥⎦ (12)

where , , , , , are respectively the rotation speeds in the planes , , , , and .

Actually, every two frame axis of an n-dimensional space specifies a 2D plane. Therefore, there exist different planes and then the same number of rotational speeds.

### 3.3 Moment time variation and rotational speeds

After taking the derivative of (1), the time variation of a moment is obtained by [17], [21]:

 ˙mp1…pn=n∑i=0∫∞−∞…∫∞−∞pi˙xixpi−1n∏j=1,j≠ixp11…xpnnf(x1,…,xn)dx1dx2…dxn+∫∞−∞…∫∞−∞xp11…xpnn˙f(x1,…,xn)dx1dx2…dxn+=∫∞−∞…∫∞−∞xp11…xpnnf(x1,…,xn)(n∑i=0∂˙xi∂xi)dx1dx2…dxn (13)

Since the matrix is antisymmetric (the diagonal entries are null), we have . This implies that the third term of (13) vanishes when rotational speeds are applied to the object. The second term of (13) vanishes as well if we assume that the time derivative of density function . The latter assumption has been also made in [22] and [23] to prove the the Revised FTMI. Assuming means that applying a rotation on the object point does not change its corresponding density function value. According to (9), we have ( are the entries of the matrix ). Combining this with (13), the time variation of moment caused by rotational speeds can be obtained by:

 ˙mp1…pn=n∑i=0n∑j=0pilijmp1,…,pi−1,…,pj+1,pn. (14)

Let us now consider for instance moments from 2D, 3D and 4D spaces.

• In 2D space, using (10) leads to:

 ˙mp1p2=(−p1mp1−1,p2+1+p2mp1+1,p2−1)ω. (15)
• In 3D space, using (11) leads to:

 ˙mp1p2p3=(p2mp1,p2−1,p3+1−p3mp1,p2+1,p3−1)ω1+(p3mp1−1,p2,p3−1−p1mp1−4,p2,p3+1)ω2+(p1mp1−1,p2+1,p3−p2mp1+1,p2−1,p3)ω3. (16)
• In 4D space, using (12) leads to:

 ˙mp1p2p3p4=(p1mp1−1,p2+1,p3,p4−p2mp1+1,p2−1,p3,p4)ω1+(p3mp1+1,p2,p3−1,p4−p1mp1−1,p2,p3+1,p4)ω2+(p1mp1−1,p2,p3,p4+1−p4mp1+1,p2,p3,p4−1)ω3+(p2mp1,p2−1,p3+1,p4−p3mp1,p2+1,p3−1,p4)ω4+(p4mp1,p2+1,p3,p4−1−p2mp1,p2−1,p3,p4+1)ω5+(p3mp1,p2,p3−1,p4+1−p4mp1,p2,p3+1,p4−1)ω6. (17)

In the next section, a simple method to determine invariant to rotations using the relation between the time variation of moments and the rotational speeds.

### 3.4 Time variation of Moment vectors

Let be the vector composed by all moments of order . Let be the monomials vector of degree computed from . As an example from 2D space for and :

 v12=[m20,m11,m02]⊤,v22=[m220,m20m11,m20m02,m211,m02m11,m202]⊤

Let us also define moment vectors mixing moments of different orders and . For instance, by multiplying the entries of and , a new moment vector can be obtained as

 m(1,2)(2,3)=[m20m230m20m30m21m20m30m12…m02m203.]⊤.

Moment vectors from three different orders or more can also be defined. For instance by all possible products between the entries of the vectors , and .

Using (14), it can be concluded that the time variation of each entry of is a linear combination of the other entries and the rotational speed. This implies that the time variation of the moment vector can be written as follow:

 ˙v1p=n!(n−2)!2!∑i=0Lωiv1pv1pωi (18)

where are matrices of integers. As a simple example from 2D space, let us consider . For the latter vector, using (15), we obtain:

 ˙v12=Lωv12v12=⎡⎢⎣0−2010−1020⎤⎥⎦v12ω. (19)

Since is defined by the monomials on , the time derivative can be expressed as linear combination of the entries. We have then

 ˙vkp=n!(n−2)!2!∑i=0Lωivkpvkpωi. (20)

Since are matrices of integers, are also of the same nature. This is also true for any vectors mixing moments of different orders. In the following, it will be shown that it is easy to build invariants to rotations as linear combination of the entries of the previous kinds of moment vectors.

#### 3.4.1 Rotation invariants

Let us consider a scalar , where is a vector of coefficients. Therefore, the time derivative of is defined by:

 dirkpdt=αk⊤p˙vkp. (21)

Combining (21) with (20) gives:

 dirkpdt=n!(n−2)!2!∑i=0αk⊤pLωivkpvkpωi. (22)

The scalar is invariant rotation if:

 αk⊤pLωivkpvkp=0,∀i=1,…,n!(n−2)!2!.

This implies the following condition:

 Lωi⊤vkpαkp=0,∀i=1,…,n!(n−2)!2! (23)

If we take again the simple moment vector , we have:

 Lω⊤v12=⎡⎢⎣010−2020−10⎤⎥⎦

The null space of is:

 α12=[101]⊤

Which gives as invariant .

In the next section, the results about both invariant to rotations and those to non-uniform scale change will be used to derive affine invariants in a very straightforward manner.

## 4 Affine invariants

### 4.1 Proposed method

Since rotation transformation is a subgroup of affine ones, one can conclude easily that an affine invariant is an invariant to rotation. Let us consider that the affine transformation is defined by a matrix , such that:

 X′=AX. (24)

Here, the translation has not been considered since we consider that the object is centered. Actually, using singular value decomposition, any non-singular matrix

can be decomposed as:

 A=R2SR1,

where and are rotations and is non uniform scale change. This means that an affine transformation is equivalent to a rotation followed by a non-uniform scale change then by another rotation. To explain the proposed approach, let us consider building affine invariants from:

 v22=[m220,m20m11,m20m02,m211,m02m11,m202]⊤

In the vector of , two entries hold the condition to be invariant to non-uniform scale change (6), which are and . The vector composed by these moments products is an invariant to non-uniform scale change. Using (15), their time derivatives are given by:

 ⎧⎪ ⎪ ⎪⎨⎪ ⎪ ⎪⎩d(m20m02)dt=˙m20m02+m20˙m02=(−2m02m11+2m20m11)ωd(m211)dt=2m11˙m11=(2m11m20−2m11m02)ω (25)

Since is invariant to rotations, from (25) we obtain:

 ˙vs22=1m400⎡⎢⎣d(m20m02)dtd(m211)dt⎤⎥⎦=Lvs22v22m400ω=[0200−200200−20]v22m400ω (26)

Let us consider . where is vector of coefficients of the same size as . As it has been shown in the previous section, is rotation invariant if . Therefore, it can be obtained that , which leads to the invariant:

 ia22=m20m02−m211m400 (27)

which is the well known and the simplest affine invariant in 2D space. Actually, this scheme can be applied to any moment vector in a n-dimensional space as follow:

• Consider a moment vector (or one combining moments of different orders ),

• Build a new moment vector by selecting only entries of if divided by the required power of become invariants to non-uniform scale change.

• The time derivative of when rotational speeds are applied to the object can be written as:

 ˙vs=1md0…0n!(n−2)!2!∑i=0Lωivsvkpωi. (28)
• Compute where:

 α⊤Lωivsvkp=0,∀i=1,…,n!(n−2)!2!.

Since each entry of is an invariant to non-uniform scale change and the linear combination is invariant to rotation, therefore is an affine invariant. In the following, some example invariant to rotations and to affine transformations in 4D space.

 ir32(1)=m20012−m0012m0210−m0012m2010−m0030m0012+m20021−m0021m0201−m0021m2001−m0003m0021+m20102−m0102m0120−m0102m2100−m0300m0102+3m20111+m20120−m0120m2100−m0300m0120+m20201−m0201m2001−m0003m0201+m20210−m0210m2010−m0030m0210+m21002−m1002m1020−m1002m1200−m3000m1002+3m21011+m21020−m1020m1200−m3000m1020+3m21101+3m21110+m21200−m3000m1200+m22001−m0003m2001+m22010−m0030m2010+m22100−m0300m2100ir32(2)=3m0003m0021+3m0012m0030+3m0003m0201+3m0012m0210+3m0021m0201+3m0102m0120+3m0030m0210+3m0102m0300+3m0120m0300+3m0003m2001+3m0012m2010+3m0021m2001+3m1002m1020+3m0030m2010+3m0102m2100+3m0201m2001+3m1002m1200+3m0120m2100+3m0210m2010+3m1020m1200+3m0300m2100+3m1002m3000+3m1020m3000+3m1200m3000+m20003+m20030−3m20111+m20300−3m21011−3m21101−3m21110+m23000 (29)
 ia42=1m60000(m20011m21100−m0200m2000m20011+2m2000m0011m0101m0110−2m0011m0101m1010m1100−2m0011m0110m1001m1100+2m0200m0011m1001m1010+m20101m21010−m0020m2000m20101−2m0101m0110m1001m1010+m20110m21001+2m0020m0101m1001m1100+2m0002m0110m1010m1100+m0002m0020m0200m2000−m0020m0200m21001−m0002m0200m21010−m0002m2000m20110−m0002m0020m21100) (30)

### 4.2 Discussion

The set of constraints given by (23) means that if is invariant to rotation, its time variation caused by any of the rotational speeds is null. Let us consider the case of 3D space. In that case, as it has been mentioned above, there exist , , are respectively the rotation speeds in the planes , and respectively. Let us consider a vector of 3D moments and an invariant to rotations. According to , satisfies the three conditions:

 (c1)Lω1⊤vkpαkp=0(c2)Lω2⊤vkpαkp=0(c3)Lω3⊤vkpαkp=0.

Each of the three constraints implies the invariance of with respect to the rotations in the plane corresponding to . This means that the constraints and implies invariance with respect to rotations in the planes and . Actually, if and are satisfied, there is no need to check since a rotation in the plane can be expressed as two consecutive rotations in the plane to bring the x-axis to the z-axis position then a rotation in the plane. In n-dimensional space as well, the vector of coefficients has to ensure invariance with respect to rotations only in well chosen planes instead of . To show that, let us consider that n-dimensional has n axis named by Latin letter . The x-axis combined to each of the other ones form planes () and offer possible planar rotations. Actually, any other rotation can be obtained as applying two consecutive rotations from considered above. For instance, a rotation in the in the plane can be obtained as two consecutive rotations in the plane followed another in plane.

In practice, the matrices are very sparse. First, when they are calculated and stored, one can consider only non-null values. Second, the vector of coefficients can be computed using null space adapted to sparse matrix. This becomes necessary for large moment vectors. To give an idea how sparse are those matrix, let us consider the 3D moment vector , which is of size equal to . Let us consider computing an affine invariant from this vector. In that case, the entries of satisfying the condition to be invariant to non-uniform scale change (6) are only . From these entries, an invariant vector to non-uniform scale can be defined by:

 vs43=[m003m021m120m300,m2012m120m300,m003m030m111m300,m012m021m111m300m012m030m102m300,m2021m102m300,m003m021m2210,m003m030m201m210,m2012m2210,m012m021m201m210,m003m111m120m210,m012m102m120m210,m012m2111m210,m021m102m111m210,m030m2102m210,m012m030m2201,m2021m2201,m003m2120m201,m012m111m120m201,m