1 Introduction

Image classification is a computer vision system that allows an image to take a place according to its visual content. This system has two main stages: the first step is the feature extraction in which the descriptor vectors of the images are calculated and stored in a database. The second step is the process of applying a classification algorithm, like the artificial neural networks (ANN), C-means (CM), fuzzy C-means “(FCM)”, k-nearest neighbours method “(k-NN)”, etc.

The extraction of descriptor vectors of the image is an operation that makes it possible to convert an image into a vector of real or complex values, which serves as the signature of the processed image. That is to say, for an accurate system of classification, the used descriptor vector must be invariant to the three image transformations (translation, rotation and scale), which means that the descriptor vectors of the image and the transformed image by translation, rotation or scale remain the same.

In the last several years, moments have been widely used in different applications of pattern recognition [2, 11, 18, 23], image processing [1, 8, 16] and computer vision [14, 21, 24, 25]. The feature vectors extracted from the non-orthogonal moments first introduced by Hu in 1962 [11]. In 1980, Teague has used the orthogonal moments, which are based on the orthogonal polynomials, in object recognition and image analysis [18]. Teh and Chin [19, 20] confirmed that the orthogonal moments are used to represent an image with the minimum of information redundancy.

The extraction of invariant moments from the orthogonal moments is a very difficult task. In this context, many authors have used the technique of expressing the invariant moments as a linear combination of geometric moment invariants, where the latter are invariants under translation, scaling and rotation of the image they describe. It is used by M.K. Hosny [9, 10] to extract the invariants of orthogonal Gegenbauer moment, by Papakostas et al [16] to derive invariants of the Krawtchouk orthogonal moments, by Zhu [26] to obtain the invariants of Tchebichef moments (TMI), Krawtchouk (KMI) moments, Hahn moments (HMI), Tchebichef-Krawtchouk moments (TKMI), Tchebichef-Hahn moments (THMIs) and Krawtchouk-Hahn moments (KHMI). It is used also by Hmimid et al [8] to build the invariants of Meixner-Tchebichef moments (MTMIs), Meixner-Krawtchouk moments (MKMIs) and Meixner-Hahn moments (MHMIs), etc.

In this paper, we use this technique to construct a new set of invariants of adapted Jacobi moments (AJMIs). This technique is based on the classic explicit form of polynomials. On the other hand, the Jacobi polynomials, which are defined in Eq. (1), are linear combinations of \(\left( {\frac{x - 1}{2}} \right)^{i}\). This obstructs the extraction of invariants from orthogonal moments. For this reason, we introduce in this paper a new series of orthogonal polynomials based on the Jacobi polynomials. We call them “the orthogonal adapted Jacobi polynomials (OAJP)”. This set of orthogonal polynomials is used to define a new type of orthogonal moments, which are called adapted orthogonal Jacobi moments (AJMs). This helps to create a set of orthogonal moments (AJMIs) invariant to translation, rotation and scale. These invariant moments are written in terms of geometric invariant moments presented by Hu [11]. We also apply a new 2D image classification technique using these invariant moments and the k-nearest neighbour algorithm (k-NN) [12, 17].

The approach followed in this paper is tested using some experimental tests, including the invariance of our orthogonal moments under translation, rotation and scale, the reconstruction of images, the object recognition and the classification of image databases. The performance of the proposed feature vectors is compared with the seven invariant moments of Hu [11], Legendre invariant moments (LMIs) [4, 22], Tchebichef invariant moments (TMIs) [14] using the three different image databases: the MPEG7-CE shape [13], the COIL-20 image database [3] and the ORL-faces database [15].

After this short introduction, this essay is going to be structured as follows: we begin with introducing the adapted Jacobi polynomials in Sects. 2. In Sect. 3, we will use the mentioned polynomials to define a new set of orthogonal moments called orthogonal adapted Jacobi moment (AJMs). In Sect. 4, we introduce a computation of invariants of the adapted Jacobi moments (AJMIs). In Sect. 5, we present some tests in the reconstruction of the images, the object recognition and the classification of image databases. Finally, we end up our essay with conclusions and possible implications.

2 Orthogonal Adapted Jacobi Polynomials

The Jacobi polynomial of the nth order is defined as follows [6]:

$$\left\{ \begin{array}{l} P_n^{\alpha ,\beta }\left( x \right) = \frac{{\left( {\alpha + n + 1} \right)}}{{n!\left( {\alpha + \beta + n + 1} \right)}}\mathop \sum \limits_{i = 0}^n \left( {\begin{array}{*{20}{c}} n\\ i \end{array}} \right)\frac{{\left( {\alpha + \beta + n + i + 1} \right)}}{{\left( {\alpha + i + 1} \right)}}{\left( {\frac{{x - 1}}{2}} \right)^i}\\ x \in \left[ { - 1,1} \right] \end{array} \right.$$
(1)

where \(\Gamma \left( z \right)\) is the Gamma function and \(\alpha , \beta \in \left( { - 1, + \infty } \right)\).

The set of Jacobi polynomials [5,6,7] satisfies the orthogonality condition:

$$ \mathop \smallint \limits_{ - 1}^{1} P_{n}^{\alpha ,\beta } \left( x \right)P_{m}^{\alpha ,\beta } \left( x \right)w_{\alpha ,\beta } \left( x \right)dx = \rho \left( { n,\alpha ,\beta } \right)\delta_{nm} $$
(2)

where \(\delta_{nm}\) is the Kronecker delta and \(w_{\alpha ,\beta }\) is weight function defined by

$$ w_{\alpha ,\beta } \left( x \right) = \left( {1 - x} \right)^{\alpha } \left( {1 + x} \right)^{\beta } $$
(3)

And

$$ \rho \left( { n,\alpha ,\beta } \right) = \frac{{2^{n + \beta + 1} }}{2n + \alpha + \beta + 1}\frac{{\left( {n + \alpha + 1} \right)}}{{\left( {n + \alpha + \beta + 1} \right)n!}} $$
(4)

Figures 1, 2 present the graphs of the first six Jacobi polynomials with \(\alpha = 3, \beta = 3 \) and the first polynomials with \(\alpha = 1, \beta = 3.\)

Fig. 1
figure 1

The graphs of the first six Jacobi polynomials with \(\alpha = 3, \beta = 3\)

Fig. 2
figure 2

The graphs of the first six Jacobi polynomials with \(\alpha = 1, \beta = 2\)

For \( N \ge 2,\) the adapted Jacobi polynomial \(A_{n}^{\alpha ,\beta ,N} \left( t \right)\) of size \(N\) is obtained

directly from the Jacobi polynomial \(P_{n}^{\alpha ,\beta } \left( x \right)\) by letting

$$ A_{n}^{\alpha ,\beta ,N} \left( t \right) = P_{n}^{\alpha ,\beta } \left( {\frac{N - 2t}{N}} \right), 0 \le t \le N $$
(5)

According to Eq. (1), the adapted Jacobi polynomial \(A_{n}^{\alpha ,\beta ,N} \left( t \right)\) can be written as:

$$ \begin{aligned} A_{n}^{\alpha ,\beta ,N} \left( t \right) &= P_{n}^{\alpha ,\beta } \left( {\frac{N - 2t}{N}} \right) \hfill \\ &= \frac{{\Gamma\left( {\alpha + n + 1} \right)}}{{n!\Gamma\left( {\alpha + \beta + n + 1} \right)}}\mathop \sum \limits_{i = 0}^{n} \left( {\begin{array}{*{20}c} n \\ i \\ \end{array} } \right)\frac{{\Gamma\left( {\alpha + \beta + n + i + 1} \right)}}{{\Gamma\left( {\alpha + i + 1} \right)}}\left( {\frac{ - t}{N}} \right)^{i} \hfill \\ \end{aligned} $$

By letting

$$ B\left( {\alpha ,\beta ,N,n,i} \right) = \frac{{\Gamma\left( {\alpha + n + 1} \right)}}{{n!\Gamma\left( {\alpha + \beta + n + 1} \right)}}\left( {\begin{array}{*{20}c} n \\ i \\ \end{array} } \right)\frac{{\Gamma\left( {\alpha + \beta + n + i + 1} \right)}}{{\Gamma\left( {\alpha + i + 1} \right)}}\left( {\frac{ - 1}{N}} \right)^{i} $$
(6)

The polynomial \(A_{n}^{\alpha ,\beta ,N} \left( t \right) \) can be written as

$$ A_{n}^{\alpha ,\beta ,N} \left( t \right) = \mathop \sum \limits_{i = 0}^{n} B\left( {\alpha ,\beta ,N,n, i} \right)t^{i} ,{\text{for}}\quad 0 \le t \le N $$
(7)

Theorem 1

The adapted Jacobi polynomials are orthogonal over on the interval \(\left[ {0,{ }N} \right]\) with the weighting function.

$$ v_{\alpha ,\beta ,N} \left( t \right) = t^{\alpha } \left( {N - t} \right)^{\beta } $$
(8)

and

$$\mathop \int \limits_0^N A_n^{\alpha ,\beta ,N}\left( t \right)A_m^{\alpha ,\beta ,N}\left( t \right){v_{\alpha ,\beta ,N}}\left( t \right)dt = C\left( {~n,N,\alpha ,\beta } \right){\delta _{nm}}$$
(9)

where \(C\left( {n,N,\alpha ,\beta } \right)\) is the constant normalization defined as :

$$ C\left( {n,N,\alpha ,\beta } \right) = \left( \frac{N}{2} \right)^{\alpha + \beta + 1} \rho \left( { n,\alpha ,\beta } \right) $$

Proof of Theorem 1.

Generally, we say that a set of polynomials \(\left\{ {P_{i} ,i = 0,1, \ldots } \right\}\) is orthogonal with the weighting function \(v\left( t \right)\) if

$$ \mathop \int \limits_{a}^{b} P_{n} \left( t \right)P_{m} \left( t \right)v\left( t \right)dt = \alpha_{n} \delta_{nm} $$
(10)

where \( \alpha_{n}\) is a real number and \(\delta_{nm}\) is the Kronecker delta defined by:

$$ \delta_{nm} = \left\{ {\begin{array}{*{20}c} {1 \quad {\text{if}}\, n = m} \\ {0 \quad {\text{if}}\, n \ne m} \\ \end{array} } \right. $$
(11)

We return to the proof of theorem. By substituting \(A_{n}^{\alpha ,\beta ,N} \left( t \right) = P_{n}^{\alpha ,\beta } \left( {\frac{N - 2t}{N}} \right),{ }v_{\alpha ,\beta ,N} \left( t \right) = t^{\alpha } \left( {N - t} \right)^{\beta }\) and \( x = \frac{N - 2t}{N} \) in Eq. (2), we get

$$ \begin{aligned} \mathop \int \limits_{0}^{N} A_{n}^{\alpha ,\beta ,N} \left( t \right)A_{m}^{\alpha ,\beta ,N} \left( t \right)v_{\alpha ,\beta ,N} \left( t \right)dt &= \mathop \int \limits_{0}^{N} P_{n}^{\alpha ,\beta } \left( {\frac{N - 2t}{N}} \right)P_{m}^{\alpha ,\beta } \left( {\frac{N - 2t}{N}} \right)t^{\alpha } \left( {N - t} \right)^{\beta } dt \hfill \\ &= \left( \frac{N}{2} \right)^{\alpha + \beta + 1} \mathop \int \limits_{ - 1}^{1} P_{n}^{\alpha ,\beta } \left( x \right)P_{m}^{\alpha ,\beta } \left( x \right)\left( {1 - x} \right)^{\alpha } \left( {1 + x} \right)^{\beta } dx \hfill \\ \end{aligned} $$
(12)

Equations (12) and (2) give

$$ \begin{gathered} \mathop \smallint \limits_{0}^{N} A_{n}^{\alpha ,\beta ,N} \left( t \right)A_{m}^{\alpha ,\beta ,N} \left( t \right)v_{\alpha ,\beta ,N} \left( t \right)dt = \left( \frac{N}{2} \right)^{\alpha + \beta + 1} \rho \left( { n,\alpha ,\beta } \right)\delta_{nm} \hfill \\ = C\left( { n,N,\alpha ,\beta } \right)\delta_{nm} \hfill \\ \end{gathered} $$

3 Orthogonal Adapted Jacobi Moments

According to the theoretical framework mentioned in the previous sections, the adapted Jacobi polynomials \(A_{m}^{\alpha ,\beta ,M} \left( x \right)A_{N}^{\alpha ,\beta ,N} \left( y \right) \) and the grey-level images of size \(M \times N \) are defined on the same rectangle \( \left[ {0,M} \right] \times [0,N\)]. With this advantage, we define in Eq. (13) a new set of orthogonal moments, which they allow us to build a new series of image descriptor vectors presented in Eq. (15).

The adapted Jacobi orthogonal moments (AJMs) of a grey-level image \(f \) are defined as follow:

$$ \begin{aligned} AJ_{nm} &= \frac{1}{{\sqrt {C\left( { n,N,\alpha ,\beta } \right)C\left( { m,M,\alpha ,\beta } \right)} }} \hfill \\ &\times \mathop \smallint \limits_{0}^{N} \mathop \smallint \limits_{0}^{M} A_{n}^{\alpha ,\beta ,N} \left( x \right)A_{m}^{\alpha ,\beta ,M} \left( y \right)f\left( {x,y} \right)v_{\alpha ,\beta ,N} \left( x \right)v_{\alpha ,\beta ,M} \left( y \right)dxdy \hfill \\ \end{aligned} $$
(13)

In this case, \(f:\left[ {0,N} \right] \times \left[ {0,M} \right] \to {\mathbb{R}}\) is a function defined over the rectangle \(\left[ {0,N} \right] \times \left[ {0,M} \right].\) Therefore Eq. (13) can be approximated by:

$$ \begin{aligned} AJ_{nm} &\cong \frac{1}{{\sqrt {C\left( { n,N,\alpha ,\beta } \right)C\left( { m,M,\alpha ,\beta } \right)} }} \hfill \\ &\times \mathop \sum \limits_{x = 0}^{N - 1} \mathop \sum \limits_{y = 0}^{M - 1} A_{n}^{\alpha ,\beta ,N} \left( x \right)A_{m}^{\alpha ,\beta ,M} \left( y \right)f\left( {x,y} \right)v_{\alpha ,\beta ,N} \left( x \right)v_{\alpha ,\beta ,M} \left( y \right) \hfill \\ \end{aligned} $$
(14)

where \(\left( {f\left( {x,y} \right)} \right)_{x = 0, \ldots ,M - 1;y = 0, \ldots ,N - 1 }\) is a matrix of size \( M \times N.\)

The relation (14) makes it possible to construct a descriptor vector of an image \(f\left( {x, y} \right)\) of size \(M \times N\) in the form of a matrix \(V\left( f \right) = \left( {AJ_{ij} } \right)\) for a given size \(\left( {p + 1} \right) \times \left( {q + 1} \right)\) as follows:

$$ V\left( f \right) = \left( {\begin{array}{*{20}c} {\begin{array}{*{20}c} {AJ_{00} } & {AJ_{01} } \\ {AJ_{10} } & {AJ_{11} } \\ \end{array} } & {\begin{array}{*{20}c} { \ldots .} & {AJ_{0q} } \\ { \ldots .} & {AJ_{1q} } \\ \end{array} } \\ {\begin{array}{*{20}c} \vdots & \vdots \\ {AJ_{p0} } & {AJ_{p1} } \\ \end{array} } & {\begin{array}{*{20}c} \vdots & \vdots \\ { \ldots .} & {AJ_{pq} } \\ \end{array} } \\ \end{array} } \right) = M_{1} \times H \times N_{1} $$
(15)

where

$$ M_{1} = \left( {\begin{array}{*{20}c} {\begin{array}{*{20}c} {A_{0}^{M} \left( 0 \right)} & {A_{0}^{M} \left( 1 \right)} \\ {A_{1}^{M} \left( 0 \right)} & {A_{1}^{M} \left( 1 \right)} \\ \end{array} } & {\begin{array}{*{20}c} { \ldots .} & {A_{0}^{M} \left( {M - 1} \right)} \\ { \ldots .} & {A_{1}^{M} \left( {M - 1} \right)} \\ \end{array} } \\ {\begin{array}{*{20}c} \vdots & \vdots \\ {A_{P}^{M} \left( 0 \right)} & {A_{P}^{M} \left( 1 \right)} \\ \end{array} } & {\begin{array}{*{20}c} \vdots & \vdots \\ { \ldots .} & {A_{P}^{M} \left( {M - 1} \right)} \\ \end{array} } \\ \end{array} } \right) $$
$$ H = \left( {\begin{array}{*{20}c} {\begin{array}{*{20}c} {h_{00} } & {h_{01} } \\ {h_{10} } & {h_{11} } \\ \end{array} } & {\begin{array}{*{20}c} { \ldots .} & {h_{0,N - 1} } \\ { \ldots .} & {h_{1,N - 1} } \\ \end{array} } \\ {\begin{array}{*{20}c} \vdots & \vdots \\ {h_{M - 1,0} } & {h_{M - 1,1} } \\ \end{array} } & {\begin{array}{*{20}c} \vdots & \vdots \\ { \ldots .} & {h_{M - 1,N - 1} } \\ \end{array} } \\ \end{array} } \right) $$
$$ N_{1} = \left( {\begin{array}{*{20}c} {\begin{array}{*{20}c} {A_{0}^{N} \left( 0 \right)} & {A_{1}^{N} \left( 0 \right)} \\ {A_{0}^{N} \left( 1 \right)} & {A_{1}^{N} \left( 1 \right)} \\ \end{array} } & {\begin{array}{*{20}c} \ldots & {A_{q}^{M} \left( 0 \right)} \\ \ldots & {A_{q}^{N} \left( 1 \right)} \\ \end{array} } \\ {\begin{array}{*{20}c} \vdots & \vdots \\ {A_{0}^{N} \left( {N - 1} \right)} & {A_{1}^{N} \left( {N - 1} \right)} \\ \end{array} } & {\begin{array}{*{20}c} \vdots & \vdots \\ \ldots & {A_{q}^{M} \left( {N - 1} \right)} \\ \end{array} } \\ \end{array} } \right) $$

where \(p\) and \(q\) are user-defined integers.

\(A_{i}^{M} \left( j \right) = A_{i}^{\alpha ,\beta ,M} \left( j \right), A_{i}^{N} \left( j \right) = A_{i}^{\alpha ,\beta ,N} \left( j \right) \) and \( h_{ij} = f\left( {j,i} \right)v_{\alpha ,\beta ,N} \left( j \right)v_{\alpha ,\beta ,M} \left( i \right)\).

Based on the orthogonality property of the adapted Jacobi polynomials, the image function \(f \left( {x, y} \right)\) defined on the rectangle \(\left[ {0,N} \right] \times \left[ {0,M} \right] \) can be written as:

$$ f\left( {x,y} \right) = \mathop \sum \limits_{n = 0}^{\infty } \mathop \sum \limits_{m = 0}^{\infty } AJ_{nm} A_{n}^{\alpha ,\beta ,N} \left( x \right)A_{m}^{\alpha ,\beta ,M} \left( y \right) $$
(16)

where the orthogonal adapted Jacobi moments,\(AJ_{nm}\), are calculated over the rectangle \(\left[ {0,N} \right] \times \left[ {0,M} \right]\). If only adapted Jacobi moments of order smaller than or equal to \( Max \) are given, then the image function \(f\left( {x,{ }y} \right)\) can be reconstructed as follows:

$$ \tilde{f}\left( {x,y} \right) \approx \mathop \sum \limits_{n = 0}^{{{\text{Max}}}} \mathop \sum \limits_{m = 0}^{n} AJ_{n - m,m} A_{n - m}^{\alpha ,\beta ,N} \left( x \right)A_{m}^{\alpha ,\beta ,M} \left( y \right) $$
(17)

4 Computation of Adapted Jacobi Invariant Moments

To use the proposed moments (AJMs) in 2D image classification, we need to construct descriptor vectors invariant under the three types of transformations: translation, rotation and scale of the image. Therefore, to obtain the translation, scale and rotation invariants of adapted Jacobi orthogonal moments (AJMIs), we follow the same strategy used by Papakostas et al. for Krawtchouk moments [16].

4.1 Geometric Invariant Moments

Given a function image \(g \left( {x, y} \right)\) defined on the rectangle \(\left[ {0,N} \right] \times \left[ {0,M} \right], \) the geometric moment of order \(\left( {n + m} \right)\) is defined as [11]:

$$ GM_{nm} \left( g \right) = \mathop \sum \limits_{x = 0}^{N - 1} \mathop \sum \limits_{y = 0}^{M - 1} x^{n} y^{m} g\left( {x,y} \right) $$
(18)

The set of geometric moments, which are invariant under rotation, scaling and translation is defined as [8,9,10, 16]:

$$ \begin{gathered} {\text{GMI}}_{nm} = {\text{GM}}_{00}^{ - \gamma } \mathop \sum \limits_{x = 0}^{N - 1} \mathop \sum \limits_{y = 0}^{M - 1} \left[ {\left( {x - \overline{x}} \right){\text{cos}}\theta + \left( {y - \overline{y}} \right){\text{sin}}\theta } \right]^{n} \times \hfill \\ \left[ {\left( {y - \overline{y}} \right){\text{cos}}\theta - \left( {x - \overline{x}} \right){\text{sin}}\theta } \right]^{m} g\left( {x,y} \right) \hfill \\ \end{gathered} $$
(19)

With

$$ \gamma = \frac{n + m}{2} + 1 $$
(20)
$$ \overline{x} = \frac{{ GM_{10} }}{{ GM_{00} }};\overline{ y} = \frac{{ GM_{01} }}{{ GM_{00} }} $$
(21)

And

$$ \theta = \frac{1}{2}{\text{tan}}^{ - 1} \left( {\frac{{2\mu_{11} }}{{\mu_{20} - \mu_{02} }}} \right) $$
(22)

where \(\mu_{nm}\) is the central geometric moment of order \(\left( {n + m} \right)\) defined as

$$ \mu_{nm} \left( g \right) = \mathop \sum \limits_{x = 0}^{N - 1} \mathop \sum \limits_{y = 0}^{M - 1} \left( {x - \overline{x}} \right)^{n} \left( {y - \overline{y}} \right)^{m} g\left( {x,y} \right) $$
(23)

By using the binomial formula with Eq. (19), the set of geometric moments, which are invariant to the three geometric transformation, is defined as follow:

$$ {\text{GMI}}_{nm} = {\text{GM}}_{00}^{ - \gamma } \mathop \sum \limits_{i = 0}^{n} \mathop \sum \limits_{j = 0}^{m} \left( {\begin{array}{*{20}c} n \\ i \\ \end{array} } \right)\left( {\begin{array}{*{20}c} m \\ j \\ \end{array} } \right)\left( { - 1} \right)^{j} \left( {{\text{sin}}\theta } \right)^{i + j} \left( {{\text{cos}}\theta } \right)^{n + m - i - j} \mu_{n - i + j, m - j + i} $$
(24)

4.2 Adapted Jacobi Invariant Moments

We substitute the formula (7) in (14), we get

$$ \begin{aligned} AJ_{nm} &= \frac{1}{{\sqrt {C\left( { n,N,\alpha ,\beta } \right)C\left( { m,M,\alpha ,\beta } \right)} }}\mathop \sum \limits_{i = 0}^{n} \mathop \sum \limits_{j = 0}^{m} B\left( {\alpha ,\beta ,N,n, i} \right)B\left( {\alpha ,\beta ,M,m, j} \right) \hfill \\ & \times \mathop \sum \limits_{x = 0}^{N - 1} \mathop \sum \limits_{y = 0}^{M - 1} x^{i} y^{j} f\left( {x,y} \right)v_{\alpha ,\beta ,N} \left( x \right)v_{\alpha ,\beta ,M} \left( y \right) \hfill \\ \end{aligned} $$
(25)

We consider the function \(h\left( {x, y} \right)\) defined as:

$$ h\left( {x,y} \right) = f\left( {x,y} \right)v_{\alpha ,\beta ,N} \left( x \right)v_{\alpha ,\beta ,M} \left( y \right) $$
(26)

By using Eqs. (18), (26) and (25), we get

$$ \begin{aligned} AJ_{nm} &= \frac{1}{{\sqrt {C\left( { n,N,\alpha ,\beta } \right)C\left( { m,M,\alpha ,\beta } \right)} }} \hfill \\ & \times \mathop \sum \limits_{i = 0}^{n} \mathop \sum \limits_{j = 0}^{m} B\left( {\alpha ,\beta ,N,n, i} \right)B\left( {\alpha ,\beta ,M,m, j} \right)GM_{ij} \left( h \right) \hfill \\ \end{aligned} $$
(27)

The adapted Jacobi invariant moments (AJMIs) can be expanded in terms of GMIs as follows:

$$ \begin{gathered} {\text{AJI}}_{nm} = \frac{1}{{\sqrt {C\left( { n,N,\alpha ,\beta } \right)C\left( { m,M,\alpha ,\beta } \right)} }} \hfill \\ \times \mathop \sum \limits_{i = 0}^{n} \mathop \sum \limits_{j = 0}^{m} B\left( {\alpha ,\beta ,N,n, i} \right)B\left( {\alpha ,\beta ,M,m, j} \right)GMI_{ij} \left( h \right) \hfill \\ \end{gathered} $$
(28)

Based on Eq. (28), we can construct a feature vector invariant to the three geometric transformations defined as follows:

$$ V = \left( {{\text{AJI}}_{{{\text{ij}}}} } \right), i = 0, \ldots ,p;j = 0, \ldots ,q $$
(29)

To evaluate the performance of this descriptor vector, we will present an experimental study in the next section.

5 Experimental Results

In this section, we focus on the experimental analysis taking into account the orthogonal moments (AJMs) and their invariants (AJMIs) discussed in previous sections. Note that, all our numerical experiments are performed in Matlab 2018 on a PC HP, Intel(R) Core(TM) I5-5200U CPU @ 2.20 GHz, 4 GB of RAM, O.S w.7. For the images recognition by adapted orthogonal invariant moments (AJMIs), we have worked on three image databases: the MPEG7-CE shape database [13], the Columbia Object Image Library (COIL-20) database [3] and the ORL database [15] under five different conditions: translation, scale, rotation, noise and normal. A comparative study with well-known orthogonal moments is suggested to evaluate the effectiveness of our approaches. The techniques which are used to test the performances of the proposed moments are explained in three parts: at first, we test the invariance under translation, scale and rotation (TSR) for the proposed orthogonal moments (AJMIs). Second, we measure the ability of (AJMs) for the reconstruction of grey-scale images. In the third part, we will present an evaluation on the accuracy of the proposed descriptor vector for the recognition of object and the classification of image databases. The criterion “recognition rate” presented in Eq. (37) is used to evaluate the recognition accuracy of the proposed invariant moment with the existing invariant moments such as the seven moments of Hu, the Legendre (LMIs) and the Tchebichef (TMIs) invariant moments.

5.1 TSR Invariance of (AJMIs)

The invariance to the three geometric transformations the translation, the scale and the rotation (TSR) is necessary in pattern recognition and object classification because most images databases contain in fact transformed objects. So, these objects must be correctly recognized, whatever their geometric situation. In other words, the derived invariants of (AJMs) must remain unchanged if the image is transformed. In this part, we use the grey-level images of Lena and Barbara presented in Fig. 3 of size \(128 \times 128.\)

Fig. 3
figure 3

The images of Lena and Barbara

These images are scaled by factors \({ }\left\{ {\lambda \left( i \right),i = 0, \ldots ,30} \right\}\), rotated by angles \({ }\left\{ {{\uptheta }\left( {\text{j}} \right),{\text{j}} = 0, \ldots ,36} \right\}\) and translated by vectors \({ }\left\{ {u\left( k \right),k = 0, \ldots ,40} \right\}\), such that

$$ \theta \left( i \right) = 10i, i = 0, \ldots ,36 $$
(30)
$$ { }\lambda \left( j \right) = 0.5 + \left( {0.5} \right)j, j = 0, \ldots ,30 $$
(31)
$$ u\left( k \right) = \left( { - 10 + 2k, - 10 + 2k} \right), k = 0, \ldots ,40 $$
(32)

To measure the degree of the invariability of (AJMIs), we use the relative error between the two sets of invariant moments corresponding to the original image \({ }f\left( {x,y} \right)\) and the transformed image \({ }f^{{{\text{tr}}}} \left( {x,y} \right) \) as

$$ E\left( {f,f^{{{\text{tr}}}} } \right) = \frac{{\left\|{{{\text{AJI}}\left( f \right) - {\text{AJI}}\left( {f^{{{\text{tr}}}} } \right)}}\right\|}}{{\left\|{{{\text{AJI}}\left( f \right)}}\right\|}} $$
(33)

where \(\left\| . \right\|\) is the Euclidean norm, \({\text{AJI}}\left( {\text{f}} \right){ }\) is the adapted Jacobi orthogonal invariant moments for the original image and \({\text{AJI}}\left( {f^{{{\text{tr}}}} } \right)\) is the adapted Jacobi orthogonal invariant moment for the transformed image. We also present a comparative study of this error of our moments (AJMIs) with other well-known invariant moments such as Hu [11], Legendre invariant moment [5, 22], Tchebichef invariant moments [14]. Figures 4 and 5 show the relative error of the proposed adapted Jacobi invariant moments AJMIs, Hu invariant moments, Legendre (LMIs) and Tchebichef (TMIs) invariant moments relative to rotation. According to the results showed in these figures, we can say that the invariant moments (AJMIs) have better performance than the other tested invariant moments in all angles of rotation. Figures 6 and 7 show the graphs of the relative error for the scaled images using the proposed adapted Jacobi invariant moments AJMIs, Hu invariant moments, Legendre and Tchebichef invariant moments.

Fig. 4
figure 4

The error \(E\left( {f, f^{r} } \right) \) for the rotated images \(f^{r }\) using the adapted Jacobi invariant moments (AJMIs), Hu, Legendre (LMIs) and Tchebichef (TMIs) invariant moments using “image Lena”

Fig. 5
figure 5

The error \(E\left( {f,f^{r} } \right) \) for the rotated images \(f^{r}\) using the adapted Jacobi invariant moments (AJMIs), Hu, Legendre (LMIs) and Tchebichef (TMIs) invariant moments using “image Barbara”

Fig. 6
figure 6

The error \(E\left( {f,f^{s} } \right) \) for the scaled images \(f^{s} \) using the adapted Jacobi invariant moments (AJMIs), Hu, Legendre (LMIs) and Tchebichef (TMIs) invariant moments using “image Lena”

Fig. 7
figure 7

The error \(E\left( {f,f^{s} } \right) \) for the scaled images \(f^{s} \) using the adapted Jacobi invariant moments (AJMIs), Hu, Legendre (LMIs) and Tchebichef (TMIs) invariant moments using “image Barbara”

From the results presented in the previous figures, we see that the orthogonal adapted Jacobi invariant moments (AJMIs) are stable for the three image transformations. Therefore, the proposed orthogonal invariant moments could be important tools in pattern recognition that require the property of invariance under the translation, the scale and the rotation the image.

We can also see that the relative error for the proposed moments is lower than the error for the other invariant moments for all factors of scale. Figures 8 and 9 present the graphs of the error for the translated images. The results of this figure show that the error in our orthogonal invariant moments (AJMIs) is lower than the error in the other invariant moments for all the vectors in translation vector. This error reduction can play a very important role in pattern recognition field, the idea that we will explore in details in the next section.

Fig. 8
figure 8

The error \( E\left( {f,f^{t} } \right) \) for the translated images \(f^{t }\) using the adapted Jacobi invariant moments (AJMIs), Hu, Legendre ( LMIs) and Tchebichef (TMIs) invariant moments using “image Lena”

Fig. 9
figure 9

The error \(E\left( {f,f^{t} } \right) \) for the translated images \({ }f^{t} \) using the adapted Jacobi invariant moments (AJMIs), Hu, Legendre ( LMIs) and Tchebichef (TMIs) invariant moments using “image Barbara”

Tables 1, 2, and 3 present some values of the adapted Jacobi orthogonal invariant moments (AJMIs) for transformed images of “image Lena” (Figs. 10, 11, 12). According to the results shown in these tables, we can see that the moments of the same order are almost equal; this reveals the invariability of the proposed moments for the three image transformations, the translation, the scaling and the rotation.

Table 1 Some values of the adapted Jacobi orthogonal invariant moments AJMIs for the four translated images of “image Lena”
Table 2 Some values of the adapted Jacobi orthogonal invariant moments AJMIs for the four rotated images of “image Lena”
Table 3 Some values of the adapted Jacobi orthogonal invariant moments AJMIs for the four scaled images of “image Lena”
Fig.10
figure 10

Original and three translated images of Lena

Fig.11
figure 11

Original and three rotated images of Lena

Fig.12
figure 12

Original and three scaled images of Lena

5.2 Image Reconstruction by Adapted Jacobi Orthogonal Moments

In this section, we will discuss the ability of the adapted Jacobi for the reconstruction of 2D images using Eq. (17). The ability to reconstruct 2D images is measured by the mean squared error (MSE) defined by Eq. (34) between the original image \(f\left( {x,y} \right) \) of size \(N \times M\) and the reconstructed image \(\hat{f}\left( {x,y} \right)\) presented by Eq. (17), where \(AJ_{ij}\) is the adapted Jacobi moments (AJMs) computed by Eq. (15).

$$ {\text{MSE}} = \frac{1}{NM}\mathop \sum \limits_{x = 0}^{N - 1} \mathop \sum \limits_{y = 0}^{M - 1} \left[ {f\left( {x,y} \right) - \hat{f}\left( {x,y} \right)} \right]^{2} $$
(34)

A set of the images, plotted in Figs. 13 and 14, is used as the test images in this study. In the first experiment, we perform visual tests for the reconstruction of the two images Girl and Barbara presented in Fig. 13c and d and the two transformed images Dog and House presented in Fig. 14 using three types of orthogonal moments. The reconstructions of images based on the proposed orthogonal moments (AJMs), Legendre orthogonal moment (LMs) and Techebichif orthogonal moments (TMs) of order 50, 100, 150 are illustrated in Figs. 15, 16, 17, and 18. The analysis of the results presented in these four figures shows the quality of the reconstruction of AJMs. They also indicate that the reconstructed image is closer to the original when the order of the maximum moment reaches a certain value. We observe that the reconstruction results based on the proposed orthogonal moments (AJMs) are better than all the other orthogonal moments that we have tested.

Fig. 13
figure 13

Test images: a Dog, b House, c Girl, d Barbara, e Baboon and f Cameramen

Fig. 14
figure 14

Transformed images of the image “Dog” and the image “House”

Fig. 15
figure 15

Reconstructed images of image “Barbara” using our orthogonal moments (AJMs), Legendre moments (LMs) and Tchebichef moments (TMs)

Fig. 16
figure 16

Reconstructed images of image “Girl” using our orthogonal moments (AJMs), Legendre moments (LMs) and Tchebichef moments (TMs)

Fig. 17
figure 17

Reconstructed images of “transformed image of Dog” using our orthogonal moments (AJMs), Legendre moments (LMs) and Tchebichef moments (TMs)

Fig. 18
figure 18

Reconstructed images of “transformed image of House” using our orthogonal moments (AJMs), Legendre moments (LMs) and Tchebichef moments (TMs)

In the second experiment, we test the capacity of noisy image reconstruction using the proposed orthogonal moments (AJMs). In this context, we use two images “Baboon” and “Cameramen” (Fig. 13e and f). We add two types of noise: Gaussian noise (mean 0, variance: 0.01) and salt-and-pepper noise (3%). The reconstructions of the images are performed by three types of orthogonal moments: (AJMs), (LMs) and (TMs) with the maximal order 200. We represent the results of this experiment in Fig. 19. Other times, the results of this experiment show the priority of our orthogonal moments (AJMs) in the reconstruction of noisy images.

Fig. 19
figure 19

a is reconstructed images using Gaussian noise-contaminated images and b is reconstructed images using salt-and-pepper noise-contaminated images. The maximum order used is 200 for each algorithm

In the third experiment, we perform a reconstruction test of the two images Dog and House presented in Fig. 13 and another test on their transformed images illustrated in Fig. 14. Knowing that the maximum order of the orthogonal ranges from 0 to 200, the MSE’s values of the proposed AJMs are compared with their corresponding values of the geometric moments (GMs), the Legendre (LMs) and the Tchebichef (TMs) moments, where these values are plotted and displayed in Figs. 20, 21, 22 and 23.

Fig. 20
figure 20

Reconstruction error MSE of adapted Jacobi moments (AJMs), geometric moments (GMs), Legendre LMs and Tchebichef moments (TMs) for image “House”

Fig. 21
figure 21

Reconstruction error MSE of adapted Jacobi moments (AJMs), geometric moments (GMs), Legendre moments (LMs) and Tchebichef moments (TMs) for image “Dog”

Fig. 22
figure 22

Reconstruction error MSE of adapted Jacobi moments (AJMs), geometric moments (GMs), Legendre moments (LMs) and Tchebichef moments (TMs) for transformed image “House”

Fig. 23
figure 23

Reconstruction error MSE of adapted Jacobi moments (AJMs), geometric moments (GMs), Legendre moments (LMs) and Tchebichef moments (TMs) for transformed image “Dog”

From these four graphs, we notice that the MSE values decrease and approach zero as the order of the moment increases. The proposed adapted Jacobi orthogonal moment is highly accurate and stable for all moment orders compared with the other tested orthogonal moments.

5.3 Image Classification

For a very precise image classification system, the used descriptor vector must be invariant to the three image transformations (translation, rotation and scale), which means that the descriptor vectors of the image and the transformed image by translation, rotation or scale must be equal. In the proposed classification system, we use the proposed orthogonal adapted Jacobi invariant moments (AJMIs) shown in Eq. (28) to extract the descriptor vectors of the images as follow:

$$ V\left( f \right) = \left( {{\text{AJI}}_{ij} } \right), i = 0, \ldots ,5 \;{\text{and}}\, j = 0, \ldots ,5 $$
(35)

For the second phase, we use the k-nearest neighbour algorithm (k-NN) based on the following distance:

$$ d\left( {V_{1} ,V_{2} } \right) = \sqrt[{}]{{\mathop \sum \limits_{i = 1}^{p} \left( {v_{1i} - v_{2i} } \right)^{2} }} $$
(36)

where \(V_{1} = \left( {v_{11} ,v_{12} , \ldots ,v_{1p} } \right)\) and \(V_{2} = \left( {v_{21} ,v_{22} , \ldots ,v_{2p} } \right)\) are two vectors of \({\mathbb{R}}^{p} .\)

The training images are characterized by the feature vectors extracted using Eq. (35). They are stored in a multidimensional characteristic space, each with a membership class label. The training phase of the algorithm consists only of storing the feature vectors and class labels of the training samples. In the classification phase, \(k\) is a user-defined constant, to classify a new image \(x,\) we seek among the training images the \(k\) closest to this image. The image \(x \) is assigned to the most frequent class among these \(k \) images.

Generally, the quality of the classification depends on the choice of the value \(k\) and the size of the descriptor vector used. In this work, we tried different values of \(k,\) we found that the classification of MPEG7-CE shape and COIL-20 databases gave better results for \(k = 2.\) On the other hand, the classification of ORL database is more efficient for \( k = 4\).

Concerning the number of moments OAJIs, we have also found that the best descriptor vector is the \(6 \times 6\) matrix, which is composed of 36 invariant moments \( {\text{AJI}}_{ij} ,i,j = 0, \ldots ,5\), as shown in Eq. (35).

To classify a database containing at least one class composed of a single element, in this case, we can use the algorithm k-NN with \(k = 1\), i.e. 1-NN.

To test our image classification, which is based on the proposed orthogonal invariant moments and the k-nearest neighbour algorithm (k-NN) as illustrated in Fig. 24, we use the three very well-known image databases: the first database is MPEG7-CE Shape. This database contains images of the objects geometrically deformed. The size of each image in this database is \( 256 \times 256\).

Fig. 24
figure 24

Flow chart of the algorithm of our classification system

In this experiment, we have considered ten classes of objects and each class contains 20 images. Figure 25 shows some images of MPEG7-CE shape database. The second is the Columbia Object Image Library (COIL-20) database, which consists of 1440 images of size \(128{ } \times 128{ }\) distributed as 72 images for each object. Figure 26 shows some images from this database. The third image database is the ORL database. This database contains ten different images for the face of each person. The total number of images is equal to 400. All images of this database have the size \( 92 \times 112\). Figure 27 shows a set of images of 40 faces.

Fig. 25
figure 25

Some objects of MPEG7-CE shape database

Fig. 26
figure 26

Some images of “COIL-20 database”

Fig. 27
figure 27

Some images of ORL database

We tested the performance of the adapted Jacobi orthogonal invariant moments (AJMIs), and we performed a comparative study with other well-known invariant moments as Hu, Legendre (LMIs) and Tchebichef (TMIs) invariant moments. This study was done on the two previous databases by adding different densities of salt-and-pepper noise 1%, 2%, 3% and 4%. Figure 24 presents the flow chart of the algorithm of our image classification system.

In the comparative study, we used a feature vector in the form of a \(6{ } \times { }6\) matrix all the invariant moments tested, as presented in Eq. (35).

We use the criteria defined in Eq. (37) to measure the performance of each image classification system.

$$\eta=\frac{\mathrm{Number\, of\, correcty\, classified\, images}}{\mathrm{Number,\ of\, images\, used\, in \,the\, test}}\times 100\%$$
(37)

This coefficient is called “The recognition precision”. Tables 4, 5, and 6 show the results of image classification for the three databases. From these results, we can deduce that our classification system based on orthogonal invariant moments (AJMIs) and the k-nearest neighbours’ algorithm (k-NN) is better than the systems, which are based on the other invariant moments though the accuracy of the recognition is decreasing according to the density of noise. In addition to that, our proposed orthogonal invariant moments (AJMIs) are robust in the three geometric transformations despite the noisy conditions and the accuracy recognition compared with the other tested descriptors.

Table 4 Classification results of the “MPEG7-CE shape database” with the salt-and-pepper noise
Table 5 Classification results of the “COIL-20 database” with the salt-and-pepper noise
Table 6 Classification results of the “ORL database” with the salt-and-pepper noise

6 Conclusion

As it is known, a good image classification system requires the extraction of descriptor vectors, which are invariant to geometric transformations and resistant to noise. For this reason, we have proposed in this paper a set of orthogonal invariant moments (AJMIs) based on orthogonal adapted Jacobi polynomials. These invariant moments are derived algebraically from the geometric invariant moments, which are invariant under three geometric transformations: translation, rotation and scale. We have applied also a new 2D image classification system using these invariant moments (AJMIs) and the “k-nearest neighbours” algorithm (k-NN). The approach suggested is examined through the use of some experimental tests, including the invariance of our orthogonal moments under translation, scale and rotation, the reconstruction of images, the object recognition and the classification of 2D image databases. The performance of the suggested invariant moments is compared with well-known orthogonal invariant moments such as Hu, Legendre invariant moments (LMIs) and Tchebichef invariant moments (TMIs) using three different databases: the “MPEG7-CE shape database”, the “Columbia Object Library (COIL-20) database” and the ORL database. The experimental tests prove that both our orthogonal invariant moments (AJMIs) and our suggested image classification system are efficient.