Abstract
We propose a general structural formula of shape-color primitive by using partial derivatives of each color channel in this paper. By using shape-color primitive, shape-color differential moment invariants (SCDMIs) can be constructed very easily, which are invariant to shape affine and color affine transforms. And 50 instances of SCDMIs are obtained. In experiments, several commonly used image descriptors and SCDMIs are used in image classification and retrieval for color image databases, respectively. By comparing the results, we find that SCDMIs get better results.
Student is the first author.
You have full access to this open access chapter, Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
Image classification and retrieval for color images are two hotspots in pattern recognition. How to extract effective features, which are robust to color variations caused by the changes in the outdoor environment and geometric deformations caused by viewpoint changes, is the key issue. A classical approach is to construct invariant features for color images. Moment invariant is one of them.
Moment invariant was first proposed by Hu in [1]. In 1962, He defined geometric moment and constructed 7 geometric moment invariants which were invariant to the similarity transform (rotation, scaling and translation). Researchers applied them to many fields in pattern recognition and achieved good results [2, 3]. Nearly 30 years later, Flusser et al. constructed affine moment invariants (AMIs) in [4] which are invariant to affine transform. The geometric deformation of an object, which is caused by the viewpoint change, can be represented by projective transform. However, general projective transform is a kind of complex nonlinear transform. So, it’s difficult to construct projective moment invariants. When the distance between the camera and the object is much larger than the size of the object itself, the geometric deformation can be approximated by the affine transform. AMIs have been used in many practical applications [5, 6]. In order to get more AMIs, researchers designed various methods. Suk et al. presented the graph method in [7], which can be used to construct AMIs with arbitrary orders and degrees. Xu et al. proposed the concept of geometric primitives in [8], including distance, area and volume. AMIs can be constructed by using various geometric primitives. This method made the construction of moment invariants has geometric meaning.
The above-mentioned moment invariants are all designed for gray images. With the popularity of color images, invariants for color images began to appear gradually. Researchers tried to construct features which have invariance for geometric deformations and the changes in color space (Fig. 1).
Geusebroek et al. [9] proved that the affine transform model was the best linear model to simulate changes in color resulting from changes in the outdoor environment. Mindru et al. constructed the moment invariants in [10], which were invariant to shape affine and color diagonal-offset transforms. These invariants were obtained by using the related concepts of Lie group. Some complex partial differential equations had to be solved. Thus, the number of them was limited and difficult to be generalized. Suk et al. [11] put forward affine moment invariants for color images by combining all color channels. But this approach was not intuitive and did not work well for the changes in color space. To solve these problems, Gong et al. [12,13,14] constructed the color primitive by using the concept of geometric primitive proposed in [8]. Combining the color primitive with some shape primitives, moment invariants that were invariant to shape affine and color affine transforms can be obtained easily, which were named shape-color affine moment invariants (SCAMIs). In [14], they obtained 25 SCAMIs which satisfied the independency of functions. However, we find that a large number of SCAMIs with simple structures and good properties are missed in [14].
In this paper, we propose a general structural formula of shape-color primitives by using partial derivatives of each color channel. Then, two special cases of shape-color primitives are used to construct shape-color differential moment invariants (SCDMIs), which are invariant to shape affine and color affine transforms. We find that SCAMIs proposed in [14] is a special case of our method. Finally, commonly used image descriptors and SCDMIs are used to image classification and retrieval for color images, respectively. By comparing the results, we find that SCDMIs get better results.
2 Related Work
In order to construct image features which are robust to color variations and geometric deformations, researchers have made various attempts. Among them, SCAMIs proposed in [14] are worthy of special attention, which have invariance for shape affine and color affine transforms. Two affine transforms are defined by
where SA and CA are nonsingular matrices.
For the color image I(R(x, y), G(x, y), B(x, y)), let \((x_{p},y_{p}),(x_{q},y_{q}),(x_{r},y_{r})\) be three arbitrary points in the domain of I. The shape primitive and the color primitive are defined by
where \(\bar{X}\) represents the mean value of X, \(X \in \{x,y,R,G,B\}\). Then, using (3), the shape core (sCore) can be defined by
where n and m represent that the sCore is the product of m shape primitives which are constructed by n points \((x_{1},y_{1}),(x_{2},y_{2}),...,(x_{n},y_{n})\). \(k<l\), \(r<n\), \(k,l,r \in \left\{ 1,2,...n\right\} \). \(d_{i}\) represents the number of times that the point \((x_{i},y_{i})\) occurs in all shape primitives, \(i=1,2,...,n\).
Similarly, the color core (cCore) can be defined by
Where N and M represent that the cCore is the product of M color primitives which are constructed by N points \((x_{1},y_{1}),(x_{2},y_{2}),...,(x_{N},y_{N})\). \(G<K<L\), \(P<Q<N\), \(G,K,L,P,Q \in \left\{ 1,2,...N\right\} \). \(D_{i}\) represents the number of times that the point \((x_{i},y_{i})\) occurs in all color primitives, \(i=1,2,...,N\).
Suppose the color image I(R(x, y), G(x, y), B(x, y)) is transformed into the image \(I^{'}(R^{'}(x^{'},y^{'}),G^{'}(x^{'},y^{'}),B^{'}(x^{'},y^{'}))\) by two transforms defined by (1) and (2). \((x^{'}_{p},y^{'}_{p}),(x^{'}_{q},y^{'}_{q})\) and \((x^{'}_{r},y^{'}_{r})\) in \(I^{'}\) are the corresponding points of \((x_{p},y_{p}),(x_{q},y_{q})\) and \((x_{r},y_{r})\) in I. Gong et al. [14] have proved
Further results can be concluded that
Therefore, the SCAMIs can be constructed by
where In(X) means multiple integrals. Then there is a relation
It must be said that \(\max \{n,N\}\), \(\max \limits _{i}\{d_{i}\}\) and \(\max \limits _{i}\{D_{i}\}\) are named the degree, the shape order and the color order of SCAMIs, respectively. In fact, (11) can be expressed as the polynomial of shape-color moments. This kind of moments was first proposed in [16] and defined by
Gong et al. [14] pointed out that they constructed all SCAMIs of which degrees \(\leqslant 4\), shape orders \(\leqslant 4\) and color orders \(\leqslant 2\). They obtained 24 SCAMIs which are functional independencies using the method proposed by Brown [17]. However, we will point out in Sect. 3 that they omitted many simple and well-behaved SCAMIs.
3 The Structural Framework of SCDMIs
In this section, we introduce the general definitions of shape-color differential moment and shape-color primitive, firstly. Then, using the shape-color primitive, the shape-color core can be constructed. Finally, according to (11) and the shape-color core, we obtain the general structural formula of SCDMIs. Also, 50 instances of SCDMIs are given for experiments in Sect. 4.
3.1 The Definition of General Shape-Color Moment
Definition 1
Suppose the color image I(R(x, y), G(x, y), B(x, y)) has the k-order partial derivatives \((k=0,1,2,...)\). The general shape-color differential moment is defined by
where \((R^{(k)}(x,y)\), \(G^{(k)}(x,y), B^{(k)}(x,y))\) represent the k-order partial derivatives of (R(x, y), G(x, y), B(x, y)). \(\bar{R}, \bar{G}, \bar{B}\) represent the mean values of R, G, B. \(\delta (k)\) is the impact function.
We can find that (13) and (14) are identical, when \(k=0\). Therefore, the shape-color moment is a special case of the general shape-color differential moment.
3.2 The Construction of General Shape-Color Primitive
Definition 2
Suppose the color image I(R(x, y), G(x, y), B(x, y)) has the k-order partial derivatives \((k=0,1,2,...)\). \((x_{p},y_{p}),(x_{q},y_{q}),(x_{r},y_{r})\) are three arbitrary points in the domain of I. The general shape-color primitive is defined by
where
We can find that C(p, q, r) defined by (4) is a special case of \(SCP_{k}(p,q,r)\), when \(k=0\).
3.3 The Construction of General Shape-Color Core
Definition 3
Using Definition 2, the general shape-color core (scCore) is defined by
Where \(k=1,2,...\), N and M represent that the \(scCore_{k}\) is the product of M shape-color primitives constructed by N points \((x_{1},y_{1}),(x_{2},y_{2}),...,(x_{N},y_{N})\). \(G<K<L\), \(P<Q<N\), \(G,K,L,P,Q \in \left\{ 1,2,...N\right\} \). \(D_{i}\) represents the number of times that the point \((x_{i},y_{i})\) occurs in all shape-color primitives, \(i=1,2,...,N\).
Obviously, \(cCore(N,M;D_{1},D_{2},...,D_{N})\) defined by (6) is a special case of \(scCore_{k}(N,M;D_{1},D_{2},...,D_{N})\), when \(k=0\).
3.4 The Construction of SCDMIs
Theorem 1
Let the color image I(R(x, y), G(x, y), B(x, y)) be transformed into the image \(I^{'}(R^{'}(x^{'},y^{'}),G^{'}(x^{'},y^{'}),B^{'}(x^{'},y^{'}))\) by (1) and (2), \((x_{p}^{'},y_{p}^{'}),(x_{q}^{'},y_{q}^{'})\) and \((x_{r}^{'},y_{r}^{'})\) in \(I^{'}\) are the corresponding points of \((x_{p},y_{p}),(x_{q},y_{q})\) and \((x_{r},y_{r})\) in I, respectively. Suppose that R(x, y), G(x, y), B(x, y), \(R^{'}(x^{'},y^{'}), G^{'}(x^{'},y^{'})\), \(B^{'}(x^{'},y^{'})\) have the k-order partial derivatives \((k=0,1,2,...)\). Then there is a relation
where
Further, the following relation can be obtained
where
By using Maple2015, the proof of Theorem 1 is obvious. We can find that (10) is a special case of (21), when \(k=0\). So, when we replace \(cCore(N,M;D_{1},D_{2},...,D_{N})\) in (11) with \(scCore_{k}(N,M;D_{1},D_{2},...,D_{N})\), (12) is still tenable. Now, we can define SCDMIs.
Theorem 2
Then there is a relation
where
(23) can be expressed as the polynomial of \(SCM^{k}_{pq\alpha \beta \gamma }\). (11) is a special case of (23) when \(k=0\). The proof of (24) is exactly the same as that of (12) proposed in [14].
3.5 The Instances of SCDMIs
We can use (23) to construct instances of SCDMIs by setting different k values. However, color images are discrete functions. The partial derivatives can’t be accurately calculated. As the order of the partial derivative increases, the calculation error is also increasing, which will greatly affect the stability of SCDMIs. So, we only set \(k=0,1\) in this paper.
When \(k=0\), \(SCDMIs_{0}\) are equivalent to SCAMIs. We construct \(SCDMIs_{0}\) of which degrees \(\leqslant 4\), shape orders \(\leqslant 4\) and color orders \(\leqslant 1\). Gong et al. [14] pointed out that in order to obtain \(SCDMIs_{0}\) of which degrees \(\leqslant 4\), shape orders \(\leqslant 4\) and color orders \(\leqslant 1\), \(scCore_{0}(3,1;1,1,1)\) must be C(1, 2, 3). This judgment is wrong. In fact, \(scCore_{0}(3,1;1,1,1)\) can be C(1, 2, 3), C(1, 2, 4), C(1, 3, 4) and C(2, 3, 4). Thus, lots of \(SCDMIs_{0}\) were missed in [14]. By correcting this shortcoming, we get 25 \(SCDMIs_{0}\) that satisfy the independency of functions by using the method proposed by [17].
At the same time, when \(k=1\), \(SCP_{1}(p,q,r)\) is defined by
where
By replacing C(1, 2, 3), C(1, 2, 4), C(1, 3, 4) and C(2, 3, 4) with \(SCP_{1}(1,2,3)\), \(SCP_{1}(1,2,4)\), \(SCP_{1}(1,3,4)\) and \(SCP_{1}(2,3,4)\), 25 \(SCDMIs_{1}\) can be obtained. Therefore, we can construct the feature vector SCDMI50, which is defined by
The construction methods of 50 instances are shown in Table 1. In order to more clearly explain that SCDMIs can be expanded into the polynomial of \(SCM^{k}_{pq\alpha \beta \gamma }\), we give the shape-color moment polynomial of \(SCMIs_{0}^{3}\).
4 Experimental Results
In this section, some experiments are designed to evaluate the performance of SCDMI50. Firstly, we verify the stability and discriminability of SCDMI50 by using synthetic images. Then, some retrieval experiments based on real image databases are performed. Also, we chose some commonly used image descriptors for comparison.
It is worth noting that we have to choose a appropriate method to calculate the first order partial derivatives of R(x, y), G(x, y) and B(x, y). In [21], the 5 points difference formulas were used for approximating the first partial derivatives of discrete grayscale images and achieved good results. For color images, they can be defined by
where \(C \in \{R,G,B\}\). We choose this method because it guarantees the computational accuracy of the first partial differential to a certain extent and also maintains a relatively fast calculation speed.
4.1 The Stability and Discriminability of SCDMI50
We select 50 different kinds of butterfly images, which are shown in Fig. 2(a). Then, 5 shape affine transforms and 4 color affine transforms are applied to each image. One image can get 20 transformed versions which are shown in Fig. 2(b). Thus, we obtain the database containing 1000 images. \(10\%\) images selected randomly are used as the training data and the rest make up the testing data.
For comparison with SCDMI50, we chose some commonly used global features of gray images or color images.
-
Hu moments, which were composed of 7 invariants under the shape similarity transform, proposed in [1]. Hu moments were designed for gray images.
-
AMIs which were composed of 17 invariants under the shape affine transform proposed in [18]. AMIs were designed for gray images.
-
RGhistogram, which consisted of 60-dimensional features and was scale-invariant in color space, proposed in [19]. The pixel range of each color channel was divided into 20 intervals for statistics.
-
Transformed color distribution, which consisted of 60-dimensional features, was proposed in [19]. Transformed color distribution was scale-invariant and sift-invariant in color space. The pixel range of each color channel was divided into 20 intervals for statistics.
-
Color moments consisted of the first, second and third geometric moments of each channel of the color image, which were proposed in [15]. Color moments are sift-invariant in color space.
-
GPSOs were invariant under the shape affine transforms and the color diagonal-offset transform, which were proposed in [10]. GPSOs consisted of 21 moment invariants.
Subsequently, image classification is performed on the butterfly database by using different kinds of features. We use the Nearest Neighbor classifier based on the Chi-Square distance to estimate the species of test images. Finally, we list the classification accuracies obtained by using different features in Table 2.
On the one hand, we can find that the classification result obtained by using SCDMI50 is better than those obtained by using other features. And, color information is very important for the classification. On the other hand, in order to observe the property of SCDMI50 more clearly, we use Chi-Square distance to calculate the feature distance between any two images. So, we can get a \(1000 \times 1000\) distance matrix which is shown in Fig. 3. Obviously, the color of the area near the diagonal is lighter than those of other regions, indicating that SCDMI50 of similar images are similar in values, and vice versa. Also, these results demonstrate that the construction formula of SCDMIs designed in Sect. 3 is correct.
4.2 Image Retrieval on Real Image Database
In order to further test the performance of SCDMI50, the database COIL-100 proposed in [20] is chosen for our experiment. COIL-100 contains 7202 images of 100 categories, each of which has 72 images taken from different angles. We choose 20 classes, each class contains 8 images \((0^{\circ }, 10^{\circ }, 20^{\circ }, 30^{\circ }, 40^{\circ }, 50^{\circ }, 60^{\circ }, 70^{\circ })\). For each image, 6 color affine transforms are applied. Thus, 960 images of 20 categories are obtained, each of categories contains 48 images which are shown in Fig. 4.
Then, retrieval experiment is performed on this database. Similar to Sect. 4.1, We choose Chi-Square distance to measure the similarity of two images. The Precision-Recall curves obtained by using different features are shown in Fig. 5(a).
Obviously, the result obtained by using SCDMI50 is far superior to those obtained by using other features. This is because that traditional image features are constructed by using only color information or shape information. However, we use two kinds of information while constructing SCDMI50. In addition, traditional image descriptors are only stable for simple changes in color space, such as the diagonal-offset transforms. When the color space changes drastically, they are less robust.
Finally, we compare the retrieval results of SCDMI50, \(SCDMI_{0}25\) and \(SCDMI_{1}25\) which are shown in Fig. 5(b). \(SCDMI_{0}25\) and \(SCDMI_{1}25\) are defined by
Because of the calculation error of partial derivatives, the result obtained by using \(SCDMI_{1}25\) slightly worse than that obtained by using \(SCDMI_{0}25\), but far better than those obtained by using traditional features. Meanwhile, \(SCDMI_{1}25\) increase the number of invariants which have simple structures and good properties. We combine \(SCDMI_{1}25\) and \(SCDMI_{0}25\) to get SCDMI50 which achieve the best retrieval result in our experiment.
5 Conclusion
In this paper, we propose a kind of shape-color differential moment invariants (SCDMIs) for color images, which are invariant to the shape affine and color affine transforms, by using partial derivatives of each color channel. It is obvious that all SCAMIs proposed in [14] are the special cases of SCDMIs, when \(k=0\). Then, we correct the mistake in [14] and obtain 50 instances of SCDMIs, which have simple structures and good properties. Finally, several commonly used image descriptors and SCDMIs are used in color image classification and retrieval, respectively. By comparing the experimental results, we find that SCDMIs get better results.
References
Hu, M.K.: Visual pattern recognition by moment invariants. IRE Trans. Inf. Theory 8(2), 179–187 (1962)
Zhang, Y.D., Wang, S.H., Sun, P., Phillips, P.: Pathological brain detection based on wavelet entropy and Hu moment invariants. Bio-Med. Mater. Eng. 26(s1), S1283–S1290 (2015)
Dudani, S.A., Breeding, K.J., McGhee, R.B.: Aircraft identification by moment invariants. IEEE Trans. Comput. 26(1), 39–46 (1977)
Flusser, J., Suk, T.: Pattern recognition by affine moment invariants. Pattern Recogn. 26(1), 167–174 (1993)
Flusser, J., Suk, T.: Affine moment invariants: a new tool for character recognition. Pattern Recogn. Lett. 15(4), 433–436 (1994)
Renuka, L., Vrushsen, P.: Facial expression recognition based on affine moment invariants. Int. J. Comput. Sci. Issues 9(6), 388–392 (2012)
Suk, T., Flusser, J.: Graph method for generating affine moment invariants. In: Proceedings of the International Conference on Pattern Recognition, pp. 192–195 (2004)
Xu, D., Li, H.: Geometric moment invariants. Pattern Recogn. 41(1), 240–249 (2008)
Geusebroek, J.M., Van den Boomgaard, R., Smeulders, A.W.M., Geerts, H.: Color invariance. IEEE Trans. Pattern Anal. Mach. Intell. 23(12), 1338–1350 (2001)
Mindru, F., Tuytelaars, T., Van Gool, L., Moons, T.: Moment invariants for recognition under changing viewpoint and illumination. Comput. Vis. Image Underst. 94(1), 3–27 (2004)
Suk, T., Flusser, J.: Affine moment invariants of color images. In: International Conference on Computer Analysis of Images and Patterns, pp. 334–341 (2009)
Gong, M., Hu, P., Cao, W.G., Li, H.: A kind of shape-color moment invariants. In: 12th International Conference on Computer-Aided Design and Computer Graphics, pp. 425–432 (2011)
Gong, M., Li, H., Cao, W.G.: Moment invariants to affine transformation of colours. Pattern Recogn. Lett. 34(11), 1240–1251 (2013)
Gong, M., Hao, Y., Mo, H.L., Li, H.: Naturally Combined Shape-Color Moment Invariants under Affine Transformations (2017). http://arxiv.org/abs/1705.10928
Stricker, M.A., Orengo, M.: Similarity of color images. In: IS&T/SPIE’s Symposium on Electronic Imaging: Science & Technology, pp. 381–392. International Society for Optics and Photonics (1995)
Mindru, F., Van Gool, L., Moons, T.: Model estimation for photometric changes of outdoor planar color surfaces caused by changes in illumination and viewpoint. In: Proceedings of the International Conference on Pattern Recognition, pp. 620–623 (2002)
Brown, A.B.: Functional dependence. Trans. Am. Math. Soc. 38(2), 379–394 (1935)
Suk, T., Flusser, J.: Affine moment invariants generated by graph method. Pattern Recogn. 44(9), 2047–2059 (2011)
Sande, K.V.D., Gevers, T., Snoek, C.: Evaluating color descriptors for object and scene recognition. IEEE Trans. Pattern Anal. Mach. Intell. 32(9), 1582–1596 (2010)
Nene, S.A., Nayer, S.K., Murase, H.: Columbia object image library (\(COIL-100\)). Technical Report CUCS-006-96, CUCS (1996)
Wang, Y.B., Wang, X.W., Zhang, B., Wang, Y.: Projective invariants of D-moments of 2D grayscale images. J. Math. Imaging Vis. 51(2), 248–259 (2015)
Acknowledgments
This work has been funded by National Natural Science Foundation of China (Grant No. 60873164, 61227802 and 61379082).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2017 Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Mo, H., Li, S., Hao, Y., Li, H. (2017). Shape-Color Differential Moment Invariants Under Affine Transforms. In: Yang, J., et al. Computer Vision. CCCV 2017. Communications in Computer and Information Science, vol 772. Springer, Singapore. https://doi.org/10.1007/978-981-10-7302-1_16
Download citation
DOI: https://doi.org/10.1007/978-981-10-7302-1_16
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-10-7301-4
Online ISBN: 978-981-10-7302-1
eBook Packages: Computer ScienceComputer Science (R0)