# Cutting Affine Moment Invariants

Authors: Jianwei Yang; Ming Li; Zirun Chen; Yunjie Chen
Journal: Mathematical Problems in Engineering
 (2012)

---

## Abstract

The extraction of affine invariant features plays an important role in many fields of image processing. In this paper, the original image is transformed into new images to extract more affine invariant features. To construct new images, the original image is cut in two areas by a closed curve, which is called general contour (GC). GC is obtained by performing projections along lines with different polar angles. New image is obtained by changing gray value of pixels in inside area. The traditional affine moment invariants (AMIs) method is applied to the new image. Consequently, cutting affine moment invariants (CAMIs) are derived. Several experiments have been conducted to evaluate the proposed method. Experimental results show that CAMIs can be used in object classification tasks.


---

## Body

## 1. Introduction

The extraction of affine invariant features plays a very important role in object recognition and has been found applicable in many fields such as shape recognition and retrieval [1, 2], watermarking [3], identification of aircrafts [4, 5], texture classification [6], image registration [7], and contour matching [8].Many algorithms have been developed for affine invariant features extraction. Based on whether the features are extracted from the contour only or from the whole shape region, the approaches can be classified into two main categories: region-based methods and contour-based methods [9]. For good overviews of the various techniques, refer to [9–12].Contour-based methods [4, 5, 13–18] provide better data reduction and the contour usually offers more shape information than interior content [9]. But these methods are unapplicable to objects with several separable components (like some Chinese characters).In contrast to contour-based methods, region-based techniques take all pixels within a shape region into account to obtain the shape representation. Moment invariant methods are the most widely used techniques. The commonly usedaffine moment invariants (AMIs) [19–21] are extensions of the classical moment invariants firstly developed by Hu [22]. Although the moment-based methods can be applicable to binary or gray-scale images with low computational demands, they would be sensitive to noise. Hence, only a few low-order moment invariants can be used and limit the ability of object classification with a large-sized database [18].A number of new region-based methods have also been introduced, such as Ben-Arie’s frequency domain technique [23, 24],cross-weighted moment (CWM) [25], and Trace transform [26]. A novel approach called multi scale autoconvolution (MSA) was derived by Rahtu et al. [27]. These new methods give high accuracy, but usually at the expense of high complexity and computational demands [27]. It is reported in [27] that one needs O(N4) and O(N2log2N) operations for computing CWM and MSA, respectively. It can be shown that some of these methods are sensitive to noise in the background. To derive robust affine invariant features, in [28], we cut the object into slices by division curves which are derived from the object based on the obtained general contour (GC). The affine invariant descriptors are constructed by summing up the gray value associated with every pixels in each slice. However, the maximum of the division quantity τ is hard to be determined. To cut object into small slices, the computational complexity is very large.Recently, structure moment invariants have been introduced in [29, 30]. These invariants are very efficient in object classification tasks for gray level images or color images, but they are unapplicable to binary images. The density of binary images can not be changed only by squaring.All in all, contour-based methods can only be used to objects with single boundary; whereas some region-based methods can achieve high accuracy but usually at the expense of high computational demands, and some region-based methods are unapplicable to binary images.To extract affine invariant features more efficiency, we transform the original image into new images in this paper. Affine invariants are extracted from new images. In order to construct new images, the original image is cut in two areas: the inside area and the outside area. To establish correspondence between areas of an image and those of its affine transformed image, as in [28], general contour (GC) of the image is constructed by performing projection along lines with different polar angles. A nonnegative constant is added to the gray value associated with every pixel of inside area. As a result, new images are obtained. Consequently, affine invariant features can be derived from these new images. In this paper, AMIs method is applied to the obtained new images. More affine invariant features, cutting affine moment invariants (CAMIs), are extracted. Furthermore, we combine CAMIs with the original AMIs (we call the obtained affine invariants as CCAMIs). To test and evaluate the proposed method, several experiments have been conducted. Experimental results show that CAMIs and CCAMIs can be used in object classification tasks.The rest of the paper is organized as follows: in Section2, the GC of an image is introduced. Consequently, the image is cut in two areas by putting GC on the image. New image is formed by changing gray value of the inside area. We apply AMIs method to the new image in Section 3. The performance of the proposed method is evaluated experimentally in Section 4. Finally, some conclusion remarks are provided in Section 5.


## 2. The Construction of New Images

To derive affine invariant features, we construct new images by cutting the original image in two areas. New images can be obtained by changing the gray value associated with pixels in one of these areas.


### 2.1. GC of an Image

Suppose that an image is represented byI(x,y) in the 2D plane. Firstly, the origin of the reference system is transformed to the centroid of the image. To derive general contour of an image, the Cartesian coordinate system should be converted to polar coordinate system. Hence, the shape can be represented by a function f of r and θ, namely,(2.1)I(x,y)=f(r,θ),
where r∈[0,∞), and θ∈[0,2π). Take projection along lines from the centroid with different angles by computing the following integral:(2.2)g(θ)=∫0∞f(r,θ)dr,
where θ∈[0,2π).Definition 2.1.
For an angleθ∈ℝ, if g(θ) is given in (2.2), then (θ,g(θ)) denotes a point in the plane of ℝ2. Let θ go from 0 to 2π, then {(θ,g(θ))∣θ∈[0,2π)} forms a closed curve. We call this closed curve the general contour (GC) of the image.By (2.2), a single value is correspond to an angle θ∈ℝ. Consequently, a single closed curve can be derived from any image. For an image I, we denote the GC extracted from it as ∂I. Equation (2.2) is called central projection transform in [31–33]. It has been used in those papers to extract rotation invariant signature by combining wavelet analysis and fractal theory. Satisfying classification rates have been achieved in the recognition of rotated English letters, Chinese characters, handwritten signatures, and so forth. As aforementioned, in [28], by employing GC, we derive division curves to cut object into slices. The affine invariant descriptors are constructed by summing up the gray value associated with every pixels in each slice. However, the maximum of the division quantity is hard to be determined. In this paper, we use GC to construct new images. Affine invariant features are extracted from these new images.


### 2.2. The Affine Property of GC

An affine transformationA of coordinates x∈ℝ2 is defined as(2.3)x′=Ax+b,
where b=(b1b2)∈ℝ2, and A=(a11a12a21a22) is a 2-by-2 nonsingular matrix with real entries.Affine maps parallel lines onto parallel lines, intersecting lines into intersecting lines. Based on these facts, it can be shown that the GC extracted from the affine transformed image is also the same affine transformed version of GC extracted from the original image. In other words, if two imagesI and I′ are related by an affine transformation A,(2.4)Ϝ′={x′∣x′=Ax+b,x∈F},
where F and F′ are supports of I and I′, respectively. Then ∂I and ∂I′, GCs of I, and I′ are related by the same affine transformation A too:(2.5)∂I′={x′∣x′=Ax+b,x∈∂I}.


### 2.3. The Construction of New Images

To construct new images, we put the GC on the original image. The image is cut in two areas: the inside area (denoted asDinside) and the outside area (denoted as Doutside). In Figure 1(b), we put the GC of Figure 1(a) on the image. Figure 1(c) is the inside area of the image, and Figure 1(d) is the outside area of the image.(a) Chinese character “Fu’’. (b) Put the GC of Figure1(a) on the image. (c) The inside area of Figure 1(a). (d) The outside area of Figure 1(a).
(a)(b)(c)(d)As aforementioned, GC preserves the affine transformation signature. As a result, the inside area preserves affine transformation too. If two imagesI and I′ are related by an affine transformation A as in (2.4), then DinsideI and DinsideI′, inside areas of I and I′, are related by the same affine transformation A too:(2.6)DinsideI′={x′∣x′=Ax+b,x∈DinsideI}.
For example, Figure 2(a) is an affine transform version of Figure 1(a). Put the GC of Figure 2(a) on the image (as shown in Figure 2(b)). Figure 2(c) is the inside area of the image of Figure 2(b). Figure 2(d) is the outside area of the image of Figure 2(b). We observe that Figures 2(c) and 2(d) are affine transformed versions of Figures 1(c) and 1(d). The affine transformation is the same as that of Figure 2(a) to Figure 1(a).(a) An affine transformation version of Figure1(a). (b) Put the GC of Figure 2(a) on the image. (c) The inside area of Figure 2(a). (d) The outside area of Figure 2(a).
(a)(b)(c)(d)Consequently, new images can be constructed by changing gray value associated with pixels inDinside. For an image, a constant d (d≥0) is added to the gray value associated with every pixels in Dinside. The obtained new image is denoted as I(d)(x,y):(2.7)I(d)(x,y)={I(x,y),(x,y)∈Doutside,I(x,y)+d,(x,y)∈Dinside.
For different d, various new images can be derived. It is obvious that I(d)(x,y) is the original image if d=0.Suppose thatI(x,y)̃ is an affine transformed image of the original image I(x,y). I(d)(x,y) is the new image constructed from I(x,y) by (2.7). I(d)(x,y)̃ is the new image constructed from I(x,y)̃ by (2.7). Then I(d)(x,y)̃ is the same version affine transformed image of I(d)(x,y). For example, we add 0.1 to the inside area of Figure 1(a); the obtained new image is shown in Figure 3(a). The gray value of the inside area of Figure 2(a) is also added 0.1; the obtained image is shown in Figure 3(b). We observed that Figure 3(b) is the same affine transform version of Figure 3(a) as that of Figure 2(a) to Figure 1(a).(a) New image constructed from Figure1(a). (b) New image constructed from Figure 2(a).
(a)(b)Some well-developed methods can be applied to the derived new images. More affine invariant features can be constructed. As aforementioned, only a few low-order moment invariants can be used for object classification. We can apply AMIs method to the derived new images. More low-order moment invariants can be extracted. We construct new affine moment invariants in the next section.


## 2.1. GC of an Image

Suppose that an image is represented byI(x,y) in the 2D plane. Firstly, the origin of the reference system is transformed to the centroid of the image. To derive general contour of an image, the Cartesian coordinate system should be converted to polar coordinate system. Hence, the shape can be represented by a function f of r and θ, namely,(2.1)I(x,y)=f(r,θ),
where r∈[0,∞), and θ∈[0,2π). Take projection along lines from the centroid with different angles by computing the following integral:(2.2)g(θ)=∫0∞f(r,θ)dr,
where θ∈[0,2π).Definition 2.1.
For an angleθ∈ℝ, if g(θ) is given in (2.2), then (θ,g(θ)) denotes a point in the plane of ℝ2. Let θ go from 0 to 2π, then {(θ,g(θ))∣θ∈[0,2π)} forms a closed curve. We call this closed curve the general contour (GC) of the image.By (2.2), a single value is correspond to an angle θ∈ℝ. Consequently, a single closed curve can be derived from any image. For an image I, we denote the GC extracted from it as ∂I. Equation (2.2) is called central projection transform in [31–33]. It has been used in those papers to extract rotation invariant signature by combining wavelet analysis and fractal theory. Satisfying classification rates have been achieved in the recognition of rotated English letters, Chinese characters, handwritten signatures, and so forth. As aforementioned, in [28], by employing GC, we derive division curves to cut object into slices. The affine invariant descriptors are constructed by summing up the gray value associated with every pixels in each slice. However, the maximum of the division quantity is hard to be determined. In this paper, we use GC to construct new images. Affine invariant features are extracted from these new images.


## 2.2. The Affine Property of GC

An affine transformationA of coordinates x∈ℝ2 is defined as(2.3)x′=Ax+b,
where b=(b1b2)∈ℝ2, and A=(a11a12a21a22) is a 2-by-2 nonsingular matrix with real entries.Affine maps parallel lines onto parallel lines, intersecting lines into intersecting lines. Based on these facts, it can be shown that the GC extracted from the affine transformed image is also the same affine transformed version of GC extracted from the original image. In other words, if two imagesI and I′ are related by an affine transformation A,(2.4)Ϝ′={x′∣x′=Ax+b,x∈F},
where F and F′ are supports of I and I′, respectively. Then ∂I and ∂I′, GCs of I, and I′ are related by the same affine transformation A too:(2.5)∂I′={x′∣x′=Ax+b,x∈∂I}.


## 2.3. The Construction of New Images

To construct new images, we put the GC on the original image. The image is cut in two areas: the inside area (denoted asDinside) and the outside area (denoted as Doutside). In Figure 1(b), we put the GC of Figure 1(a) on the image. Figure 1(c) is the inside area of the image, and Figure 1(d) is the outside area of the image.(a) Chinese character “Fu’’. (b) Put the GC of Figure1(a) on the image. (c) The inside area of Figure 1(a). (d) The outside area of Figure 1(a).
(a)(b)(c)(d)As aforementioned, GC preserves the affine transformation signature. As a result, the inside area preserves affine transformation too. If two imagesI and I′ are related by an affine transformation A as in (2.4), then DinsideI and DinsideI′, inside areas of I and I′, are related by the same affine transformation A too:(2.6)DinsideI′={x′∣x′=Ax+b,x∈DinsideI}.
For example, Figure 2(a) is an affine transform version of Figure 1(a). Put the GC of Figure 2(a) on the image (as shown in Figure 2(b)). Figure 2(c) is the inside area of the image of Figure 2(b). Figure 2(d) is the outside area of the image of Figure 2(b). We observe that Figures 2(c) and 2(d) are affine transformed versions of Figures 1(c) and 1(d). The affine transformation is the same as that of Figure 2(a) to Figure 1(a).(a) An affine transformation version of Figure1(a). (b) Put the GC of Figure 2(a) on the image. (c) The inside area of Figure 2(a). (d) The outside area of Figure 2(a).
(a)(b)(c)(d)Consequently, new images can be constructed by changing gray value associated with pixels inDinside. For an image, a constant d (d≥0) is added to the gray value associated with every pixels in Dinside. The obtained new image is denoted as I(d)(x,y):(2.7)I(d)(x,y)={I(x,y),(x,y)∈Doutside,I(x,y)+d,(x,y)∈Dinside.
For different d, various new images can be derived. It is obvious that I(d)(x,y) is the original image if d=0.Suppose thatI(x,y)̃ is an affine transformed image of the original image I(x,y). I(d)(x,y) is the new image constructed from I(x,y) by (2.7). I(d)(x,y)̃ is the new image constructed from I(x,y)̃ by (2.7). Then I(d)(x,y)̃ is the same version affine transformed image of I(d)(x,y). For example, we add 0.1 to the inside area of Figure 1(a); the obtained new image is shown in Figure 3(a). The gray value of the inside area of Figure 2(a) is also added 0.1; the obtained image is shown in Figure 3(b). We observed that Figure 3(b) is the same affine transform version of Figure 3(a) as that of Figure 2(a) to Figure 1(a).(a) New image constructed from Figure1(a). (b) New image constructed from Figure 2(a).
(a)(b)Some well-developed methods can be applied to the derived new images. More affine invariant features can be constructed. As aforementioned, only a few low-order moment invariants can be used for object classification. We can apply AMIs method to the derived new images. More low-order moment invariants can be extracted. We construct new affine moment invariants in the next section.


## 3. Cutting Affine Moment Invariants

By applying various region-based methods to the derived new image, some affine invariant features can be extracted. As aforementioned, AMIs method is region-based method with low computational demands. We apply AMIs to the constructed new image.Geometric momentmpq(d) of the new image I(d)(x,y) is defined as(3.1)mpq(d)=∫xpyqI(d)(x,y)dxdy,
where p, q are nonnegative integers. μpq(d) is the central moments:(3.2)μpq(d)=∫(x-x0)p(y-y0)qI(d)(x,y)dxdy,
where x0, y0 are the coordinates of the centroid of the image.For two pointsx1=(x1,y1)T,x2=(x2,y2)T∈ℝ2, we denote the cross product C12 as(3.3)C12=x1y2-x2y1.
After an affine transform, the following equation holds:(3.4)C̃12=JC12,
where J denotes the Jacobian of affine transformation: J=det(A).ForN points (N≥2): Ui=(xi,yi)T∈ℝ2,i=1,2,…N, and non-negative integers nkj(1≤k<j≤N), we define RCAMI(d) of the form:(3.5)RCAMI(d)=∫∏1≤k<j≤NCkjnkj∏i=1NI(d)(xi,yi)dxidyi.
Denote w=∑1≤k<j≤Nnkj. We normalized RCAMI(d) as follows:(3.6)CAMI(d)=RCAMI(d)(μ00(d))w+N.
Using similar argument with that of affine moment invariants (see [20], etc.), it can be shown that CAMI(d) is affine invariant. We call these invariants as cutting affine moment invariants (CAMIs). If d=0, these invariants are the same as moment invariants given in [20].By expandingCkj in (3.5), RCAMI(d) becomes a polynomial of moments given in (3.2). Consequently, we can compute CAMIs from moments given in (3.2). Invariants can be derived by replacing moments in AMIs with the moments given in (3.2). Here, we use the well-developed theory for the AMIs as described in [19]. The following form invariants are used in this paper:(3.7)F1(d)=(μ20(d)μ02(d)-(μ11(d))2)(μ00(d))4,F2(d)=((μ30(d))2(μ03(d))2-6μ30(d)μ21(d)μ12(d)μ03(d)+4μ30(d)(μ12(d))3+4(μ21(d))3μ03(d)-3(μ21(d))2(μ12(d))2)(μ00(d))10F3(d)=(μ20(d)(μ21(d)μ03(d)-(μ12(d))2)-μ11(d)(μ30(d)μ03(d)-μ21(d)μ12(d))+μ02(d)(μ31(d)μ12(d)-(μ21(d))2))(μ00(d))7.,
If we set d=0, (3.7) results in AMIs used in [19]. By changing the constant d, different invariants can be constructed. Consequently, more low-order moment invariants can be extracted. We will show that the obtained CAMIs can be used in object classification. Furthermore, we will combine the obtained CAMIs with the traditional AMIs. The obtained features (we call them CCAMIs) are also used in object classification.


## 4. Experiments

In this section, we evaluate the proposed method in object classification tasks. We will show that the derived affine invariants (CAMIs) can be used in object classification. Furthermore, CAMIs can be combined with the original AMIs (we call the obtained affine invariants as CCAMIs). We denote AMIs used in [19] as: f1, f2, f3 (d=0 in (3.7)).In the first experiment, some binary images of Chinese characters are used. The CAMIs used in this experiment are obtained by settingd equal to 10% of the maximum gray value in the image. Hence, d is set to 0.1. These CAMIs are denoted as: F1(0.1), F2(0.1), F3(0.1). Figure 4(a) shows the original six Chinese characters. Some of these characters are very similar. Figure 4(b) shows the same set of characters deformed by affine transforms. The values of invariants AMIs: f1,f2, f3 and CAMIs: F1(0.1),F2(0.1),F3(0.1) are given in Table 1. It can be seen clearly that CAMIs really are invariant under affine transform. Furthermore, CAMIs are different with the original AMIs.Table 1
AMIs and CAMIs for some similar Chinese characters.
f1·104f2·108f3·106F1(0.1)·104F2(0.1)·108F3(0.1)·106Da1033−29586−6040889−20096−4579Test11029−29457−6013894−20689−4645Quan1132−27041−6406980−18884−4915Test21131−26560−63361000−19504−5051Tai1080−50285−8123904−31880−5861Test31081−51263−8201915−33214−6019Tian939−22855−5612805−15556−4220Test4939−23053−5627816−16216−4341Yao1037−29694−6538907−21196−5118Test51031−28759−6415915−20846−5153Fu850−23926−5847726−15462−4351Test6846−23686−5795726−15324−4354(a) The original six model Chinese characters. (b) Deformed Chinese characters to be recognized.
(a)(b)In the second experiment, we test the combined invariants (CCAMIs):f1,f2,f3, F1(0.1), F2(0.1), F3(0.1). Two groups of Chinese characters, shown in Figures 5(a) and 5(b), are chosen as databases. Each group include 40 Chinese characters with regular script font. The images in Figure 5(a) have size of 128×128, and those in Figure 5(b) have size of 256×256. Some characters in these databases have the same structures, but the number of stokes or the shape of specific stokes may be a little different. The affine transformations are generated by the following transformation matrix [4]: (4.1)T=l(cos⁡θ-sin⁡θsin⁡θcos⁡θ)(ab01a),
where a∈{1,2}, b∈{-1.5,-1,-0.5,0,-0.5,1,1.5}, θ∈{0°,72°,144°,216°,288°}, and l∈{0.8,1.2}. l,θ denote the scaling, rotation transformation, respectively, and a, b denote the skewing transformation.(a) First group of 40 characters. (b) Second group of 40 characters.
(a)(b)Each character will be transformed 140 times as described above. With these affine transformations and the database, 5600 tests run using the proposed method for each group. In our experiments, the classification accuracy is defined as(4.2)η=γη×100%,
where γ denotes the number of correctly classified images, and η denotes the total number of images applied in the test.The AMIs, CAMIs, and the combined invariants CCAMIs are applied to databases in Figures5(a) and 5(b). Classification is performed by the method used in [19]. Table 2 shows the results. For the first group of Chinese characters, we observe that the performance of CAMIs is a little better than that of AMIs, and the combined invariants CCAMIs have better performance than the original AMIs and CAMIs. For the other group of Chinese characters, we observe that the performance of the traditional AMIs is better than that of CAMIs, and the combined invariants CCAMIs have also better performance than the original AMIs and CAMIs. Hence, the original AMIs can be combined with CAMIs, more shape information may be extracted.Table 2
Classification accuracies of AMIs, CAMIs, and CCAMIs in case of different affine transformations.
AMIsCAMIsCCAMIsGroup one86.46%87.62%90.14%Group two95.55%89.64%96.13%


## 5. Conclusions

In this paper, an approach is developed for the extraction of affine invariant features by cutting image into areas: the inside area and the outside area. In order to establish correspondence between areas of an image and those of its affine transformed version, general contour (GC) of the object is employed. A nonnegative constant is added to the gray value associated with every pixel of inside area. Consequently, new image is obtained, and CAMIs are constructed from the new image. To test and evaluate the proposed method, several experiments have been conducted. Experimental results show that CAMIs can be used in object classification tasks.



---

*Source: 928161-2012-04-09.xml*