1 Introduction

Moments are important descriptors of image in computer vision. They have been widely used in many applications such as image reconstruction [11], image watermarking [33], image compression [21], image classification [10], edge detection [2], 3D object analysis [12, 38], image indexing [16], medical image analysis [5], and forgery detection [22].

Generally, moments are divided into two main categories: (1) non-orthogonal moments and (2) orthogonal moments. Geometric moments [6] are the most popular moments in the first category because they are the first that have been applied for image analysis due to their simplicity. However, they suffer from the problem of information redundancy due to the non-orthogonality of their kernel function, which limits their applications in cases where more discriminating information must be captured. This problem led the scientists to introduce the second category of moments, the orthogonal moments, which use orthogonal polynomials as kernel functions. Thanks to the orthogonality property, the orthogonal moments are able to represent images without information redundancy. Therefore, they have drawn considerable attention in several image-related applications. The orthogonal moments are also divided into two large families: Continuous orthogonal moments which are based on continuous orthogonal polynomials such as the moments of Legendre [29], Zernike [13], Gegenbauer [8], Fourier-Mellin [27], Gaussian-Hermite [41] and Chebyshev- Fourier [20]. The second category is the discrete orthogonal moments which are based on discrete orthogonal polynomials such as the moments of Tchebichef [17], Krawtchouk [43], Hahn [44], Charlier [48], Meixner [24], Dual Hahn [46] and Racah [47].

A thorough literature study has shown that the order of the existing orthogonal moments (continuous and discrete) is always limited to an integer, because the kernel function of these moments is defined for the integer order. However, it is sometimes necessary to calculate them for real or fractional orders for reasons of accuracy, security and location of regions in the image. Mathematically, fractional moments are a generalization of classical moments of fractional order equal to 1. In recent years, emphasis has been placed on the search for fractional orthogonal moments. In this direction, some continuous orthogonal moments of fractional order have been proposed, such as the fractional moments of Fourier-Mellin [45], Legendre [35], Zernike [35] and Chebyshev [1]. The continuous orthogonal moments of fractional order are defined by substituting x by xα (\(\alpha \in {\mathbb{R}}_{ + }\)) in the kernel function of classical moments. Therefore, the fractional order of moments becomes a positive real number.

Since the images are discrete, the calculation of fractional continuous moments is characterized by: (1) the need for an appropriate transformation of the image coordinates for these moments to be applied, and by (2) the approximation of the integrals by summations, which causes discretization and approximation errors. To limit these errors, scientists are oriented towards discrete orthogonal moments of fractional order such as the fractional discrete moments of Krawtchouk (FrKMs) [15], Tchebichef (FrTMs) [36], Charlier (FrCMs) [37], and separable Charlier-Meixner (FrCMMs) [40]. Since the method of substitution (x by xα) cannot be applied in the case of discrete moments, the discrete moments of fractional order are derived by using the eigenvalue decomposition of the matrix of the classical kernel function. Fractional discrete orthogonal moments have the particularity of being directly defined in the discrete domain of the image, and that has established them as high discriminative power moment families.

With regard to discrete orthogonal moments of a fractional order, to date, only FrKMs, FrTMs FrCMs, and FrCMMs have been proposed for image processing. The fractional version of other discrete moments is still missing. In addition, FrKMs, FrTMs, FrCMs, and FrCMMs were only developed for grayscale images, which means that a color image can be processed by these descriptors by decomposing it into color systems (RGB or HSB) and each color channel is processed separately with these descriptors. This strategy has the drawbacks of applying the calculation scheme three times, by adding additional time overhead and the color information is not described in a compact and holistic way in a single moment coefficient.

In this paper, we propose a new set of discrete orthogonal moments of fractional order, named Quaternion Cartesian Fractional Hahn Moments (QCFrHMs), based on the new Fractional Hahn Polynomials (FrHPs) and quaternion theory, which can essentially be used for color images representation. First, new Fractional Hahn Polynomials (FrHPs) are proposed using the eigenvalue decomposition of the classical Hahn polynomial matrix. Then, the proposed FrHPs are used as a kernel function to define the new Fractional Hahn Moments (FrHMs). Finally, based on quaternion algebra, the FrHMs for grayscale images are generalized to the Quaternion Cartesian Fractional Hahn Moments (QCFrHMs) for color images. The QCFrHMs with two additional parameters α and β \((\alpha ,\beta \in {\mathbb{R}})\), called fractional orders of QCFrHMs, can process color images in a compact and holistic way. Another advantage is that QCFrHMs and processed images are defined in the Cartesian coordinate system. Therefore, no coordinate conversion is necessary, which reduces the calculation complexity and improves the numerical stability of these descriptors.

To illustrate the application of QCFrHMs, we propose a watermarking scheme for the copyright protection of color images. Several numerical experiments are performed to confirm the effectiveness of QCFrHMs, with respect to the imperceptibility, robustness, and security of the proposed watermarking scheme.

This paper is organized as follows: in the next section, we will give preliminaries which will be used in the rest of the paper, including the classic Hahn moments and their kernel functions. Section 3, which is the theoretical part of this article, provides the definition of FrHPs, FrHMs and QCFrHMs. The watermarking scheme for copyright protection of color images is proposed in Sect. 4 to evaluate the performance of QCFrHMs. Experimental results are presented in Sects. 5 and 6 concludes the paper.

2 Preliminaries

Hahn moments are scalar quantities, which have been used for more than fifteen years to characterize a digital image and capture its significant features [4, 7, 25, 32, 44, 48, 49]. From a mathematical point of view, Hahn moments are “projections” of an image or signal onto the discrete orthogonal Hahn polynomials. The (n+m)th order Hahn moments of a grayscale image \(g = \left\{ {g(x,y)} \right\}_{x,y = 0}^{x,y = N - 1}\) are defined as [49]:

$$M_{n,m} = \sum\limits_{x = 0}^{N - 1} {\sum\limits_{y = 0}^{N - 1} {\tilde{h}_{n}^{(a,b)} (x;N)\tilde{h}_{m}^{(a,b)} (y;N)} } g(x,y) \, n,m = 0,1,2,....,N - 1$$
(1)

where N is the number of pixels in each coordinate axis of the image, \(\tilde{h}_{n}^{(a,b)} (x;N)\) is the n-th order ortho-normalized Hahn polynomial (kernel function), defined as [48]

$$\tilde{h}_{n}^{(a,b)} (x;N) = h_{n}^{(a,b)} (x;N)\sqrt {\frac{\omega (x)}{{\rho (n)}}}$$
(2)

with ω(x) and ρ(n) are the weight function and the square norm of the Hahn polynomial, respectively, defined as:

$$\omega (x) = \left( {\begin{array}{*{20}c} {a + x} \\ x \\ \end{array} } \right)\left( {\begin{array}{*{20}c} {b + N - x} \\ {N - x} \\ \end{array} } \right)$$
(3)
$$\rho (n) = \frac{{( - 1)^{n} n!(n + a + b + 1)_{N + 1} (b + 1)_{n} }}{{N!(2n + a + b + 1)(a + 1)_{n} ( - N)_{n} }}$$
(4)

and \(h_{n}^{(a,b)} (x;N)\) is the classical Hahn polynomials defined as [18]:

$$\begin{gathered} h_{n}^{(a,b)} (x;N) = \frac{{( - 1)^{n} (b + 1)_{n} (N - n)_{n} }}{n!} \times {}_{3}F_{2} ( - n, - x,n + 1 + a + b;b + 1,1-N;1) \hfill \\ {\text{ with }}x,n = 0,1, \ldots ,N - 1, \, a > - 1 \, \& \, b > - 1 \hfill \\ \end{gathered}$$
(5)

where a and b are adjustable parameters that control the shape of the Hahn polynomials, and \({}_{3}F_{2} (.)\) is the generalized hypergeometric function given by:

$${}_{3}F_{2} (x_{1} ,x_{2} ,x_{3} ;y_{1} ,y_{2} ;z) = \sum\limits_{k = 0}^{\infty } {\frac{{(x_{1} )_{k} (x_{2} )_{k} (x_{3} )_{k} z^{k} }}{{(y_{1} )_{k} (y_{2} )_{k} k!}}}$$
(6)

and \((x)_{k}\) is the Pochhammer symbol given by:

$$(x)_{k} = x(x + 1)(x + 2)...(x + k - 1),{\text{ for }}k \ge 1{\text{ and }}(x)_{0} = 1$$
(7)

The Hahn polynomials satisfy the following orthogonality relationship:

$$\sum\limits_{x = 0}^{N - 1} {\tilde{h}_{n}^{(a,b)} (x;N)} \tilde{h}_{m}^{(a,b)} (x;N) = \delta_{n,m} { ; }n,m = 1,2,....,N - 1$$
(8)

Thanks to the orthogonality property of Hahn polynomials, an image can be reconstructed from its Hahn moments using the following formula:

$$g(x,y) = \sum\limits_{n = 0}^{N - 1} {\sum\limits_{m = 0}^{N - 1} {\tilde{h}_{n}^{(a,b)} (x;N)\tilde{h}_{m}^{(a,b)} (y;N)} } M_{n,m}$$
(9)

where g(x, y) is the grey level of the image \(g = \left\{ {g(x,y)} \right\}_{x,y = 0}^{x,y = N - 1}\) at position (x, y).

Note that, when the order of moments (n+m) increases, the calculation of Hahn moments can be limited by two major problems: The first is related to the propagation of numerical errors when calculating Hahn polynomials. The second is related to the high computational cost, especially for large images. To overcome these problems, Daoui et al. proposed a stable computation of Hahn polynomials using a method based on the modified Gram-Shmidt Orthonormalization Process (GSOP) [4]. This process a considerably reduces the propagation of numerical errors during the calculation of Hahn polynomials. And to reduce calculation time, we use matrix formulas to calculate Hahn moments and to reconstruct the images from Hahn moments. These formulas are given as follows:

$$M = H^{T} gH$$
(10)
$$g = HMH^{T}$$
(11)

Where g denotes N×N grayscale image matrix, H is the Hahn polynomial matrix and M is the Hahn moment matrix, with.

$$\begin{gathered} M = \left\{ {M_{n,m} } \right\}_{n = 0,m = 0}^{n = N - 1,m = N - 1} \hfill \\ H = \left\{ {\tilde{h}_{n}^{(a,b)} (x;N)} \right\}_{i = 0,x = 0}^{n = N - 1,x = N - 1} \hfill \\ g = \left\{ {g(x,y)} \right\}_{x,y = 0}^{x,y = N - 1} \hfill \\ \end{gathered}$$
(12)

Hahn polynomials are a generalization of several other types of polynomials such as the discrete orthogonal polynomials of Tchebichef, Krawtchouk and Meixner. The latter are obtained from Hahn polynomials by adjusting the parameters {a,b} [44], which shows the ability of Hahn polynomials to include properties for the description of local and global regions of interest in the images. However, Hahn moments introduced in the literature are limited to an integer order because Hahn polynomials (kernel functions) are defined for integer orders. In this direction, we propose, in the following sections, the calculation of the Hahn polynomials and the Hahn moments for fractional or real orders in order to generalize their calculation and to benefit other properties for non-integer orders.

3 Proposed quaternion cartesian fractional hahn moments

In this section, we introduce new Hahn moments, which are the Quaternion Cartesian Fractional Hahn Moments (QCFrHMs). These latter are based on the new Fractional Hahn Polynomials (FrHPs) and generalize the classical Hahn moments, this is the case where the fractional order is equal to 1. In addition, the proposed moments are able to describe the color information of an image in a compact and holistic way.

3.1 Proposed fractional hahn polynomials

Let H be Hahn’s polynomial matrix of size \(N \times N\). The matrix H checks the following four properties [18]: (1) orthogonal matrix, (2) real matrix, (3) unitary matrix, (4) the eigenvalues \(\lambda_{i}\) (i = 1, 2,…, N) of H are of modulus 1, i.e.\(\lambda_{i} = e^{{j\varphi_{i} }}\), where \(\varphi_{i}\) is the argument of \(\lambda_{i}\).

Using eigenvalue decomposition, the matrix H is written as:

$$H = X\Lambda X^{*}$$
(13)

where \(\Lambda = diag(\lambda_{1} ,......\lambda_{N} )\) is the diagonal matrix whose diagonal coefficients are the eigenvalues of the matrix H. The passage matrix \(X = [u_{1} ,......,u_{N} ]\) is a square matrix whose i-th column is the eigenvector ui of the matrix H corresponds to the eigenvalue\(\lambda_{i}\),\(X^{*} = [u_{1}^{*} ,......,u_{N}^{*} ]\) is the conjugate transposed matrix of X, satisfying\(P_{i} \triangleq u_{i} u_{i}^{*}\) , where \(P_{i}\) denotes the orthogonal projection onto the eigenspace corresponding to the eigenvalue \(\lambda_{i}\).

The Eq. (13) can be rewritten as follows:

$$H = \sum\limits_{i = 1}^{N} {\lambda_{i} u_{i} u_{i}^{*} } = \sum\limits_{i = 1}^{N} {e^{{j\varphi_{i} }} u_{i} u_{i}^{*} }$$
(14)

The spectral decomposition of H is given as follows:

$$H = \lambda_{1} P_{1} + \lambda_{2} P_{2} + ......... + \lambda_{N} P_{N} = \sum\limits_{i = 1}^{N} {e^{{j\varphi_{i} }} P_{i} }$$
(15)

Based on the spectral representation of the Hahn polynomials (Eq. 15), we define the Fractional Hahn Polynomials (FrHPs) of fractional order \(\alpha , \, (\alpha \in {\mathbb{R}})\) by taking the orthogonal projection \(P_{i}\) on the eigenspace corresponding to the eigenvalue \(\lambda_{i}^{\alpha }\). Therefore, its spectral decomposition is given as follows:

$$H^{\alpha } = \lambda_{1}^{\alpha } P_{1} + \lambda_{2}^{\alpha } P_{2} + ......... + \lambda_{N}^{\alpha } P_{N} = \sum\limits_{i = 1}^{N} {e^{{j\alpha \varphi_{i} }} P_{i} }$$
(16)

Also, we can use the following matrix notation:

$$H^{\alpha } = X\Sigma^{\alpha } X^{*}$$
(17)

where \(\Sigma\) is the diagonal matrix whose diagonal elements are the eigenvalues of the classical matrix H in exponential form:

$$\Sigma = Diag\{ e^{{j\varphi_{1} }} ,e^{{j\varphi_{2} }} ,..........,e^{{j\varphi_{N - 1} }} ,e^{{j\varphi_{N} }} \}$$
(18)

Fractional Hahn polynomials of fractional order have other important properties that generalize the properties of classical Hahn polynomials of order 1. These properties are summarized as follows:

  1. (i)

    \(H^{0} = X\Sigma^{0} X^{*} = XX^{*} = I\) , where I is the identity matrix.

  2. (ii)

    \(H^{1} = X\Sigma^{1} X^{*} = X\Sigma X^{*} = H\) .

  3. (iii)

    \(H^{\alpha } H^{\beta } = (X\Sigma^{\alpha } X^{*} )(X\Sigma^{\beta } X^{*} ) = (X\Sigma^{\alpha + \beta } X^{*} ) = H^{\alpha + \beta }\) .

  4. (iv)

    \(H^{ - \alpha } = (H^{\alpha } )^{ - 1}\), because \(H^{\alpha } H^{ - \alpha } = (X\Sigma^{\alpha } X^{*} )(X\Sigma^{ - \alpha } X^{*} ) = (X\Sigma^{\alpha - \alpha } X^{*} ) = I\)

The property (i) shows that the zero fractional order gives the identity matrix. The property (ii) indicates that classical Hahn polynomials can be obtained when the fractional order is equal to 1. the index additivity property (iii) shows that the product of two matrices of FrHPs of orders α and β can be calculated from the matrix of FrHPs of order α + β. The unitary property (iv) shows that the inverse of the FrHPs matrix of fractional order α is the FrHPs matrix of order α−.

3.2 Proposed quaternion cartesian fractional hahn moments (QCFrHMs)

In this subsection, we first propose a new set of moments called Fractional Hahn Moments (FrHMs) which generalizes the classical Hahn moments, and which are based on the FrHPs proposed in the previous subsection. Next, we introduce a new set of Quaternion Cartesian Fractional Hahn Moments (QCFrHMs) where color images can be processed holistically and compactly with these descriptors.

Enlightened by the definition of classical Hahn Moments (Eq. 10), we project a grayscale image on a polynomial basis formed by the proposed FrHPs to define the Fractional Hahn Moments (FrHMs).

Definition 1.

Let g represents a grayscale image matrix defined in Cartesian coordinate system, The Fractional Hahn Moments (FrHMs) of fractional orders α and β, \((\alpha ,\beta \in {\mathbb{R}})\) , are given by.

$$M^{\alpha ,\beta } = H^{\alpha } gH^{\beta }$$
(19)

and the reconstruction of the image g from its moments is given by.

$$g = H^{ - \alpha } M^{\alpha ,\beta } H^{ - \beta }$$
(20)

where \(H^{\alpha }\) and \(H^{\beta }\) are the FrHP matrices of fractional order α and β, respectively. \(H^{ - \alpha }\) and \(H^{ - \beta }\) are the inverse matrices of \(H^{\alpha }\) and \(H^{\beta }\), respectively.

The compact representation of image content is a fundamental problem in image processing. The proposed FrHMs (Eq. 19) with the two additional parameters \((\alpha ,\beta )\) generalize the classical Hahn moments (of fractional orders equal to 1). However, FrHMs cannot represent color images directly in a compact and holistic way. To extend the properties of FrHMs to color image processing, we will generalize FrHMs from the scalar field to the vector field based on the quaternion representation of the color image.

Sangwine [23] proposed to encode the three channel components of a RGB image \(f = \{ f(x,y), \, (0 \le x,y < N)\}\) on the three imaginary parts of a pure quaternion, that is.

$$f_{q} (x,y) = 0 + f_{R} (x,y)i + f_{G} (x,y)j + f_{B} (x,y)k$$
(21)

where\(f_{R} (x,y)\), \(f_{G} (x,y)\) and \(f_{B} (x,y)\) are the red, green and blue components of the quaternion color pixel\(f_{q} (x,y)\), respectively, and i, j, k are complex operators obeying the following rules:

$$i^{2} + j^{2} + k^{2} = - 1{ , }ij = - ji = k{ , }jk = - kj = i{ , }ki = - ik = j$$
(22)

Also, the representation of the quaternion color image can be used by the following matrix form as.

$$f_{q} = f_{R} i + f_{G} j + f_{B} k$$
(23)

where\(f_{R}\), \(f_{G}\) and \(f_{B}\) represent the matrices of the red, green and blue channels of the quaternion color image matrix\(f_{q}\), respectively.

Sangwine’s quaternion representation is used in this paper to define the Quaternion Cartesian Fractional Hahn Moments (QCFrHMs) for color image representation.

Definition 2.

Let \(f_{q} = f_{R} i + f_{G} j + f_{B} k\) be a quaternion color image matrix defined in Cartesian coordinate system, The Quaternion Cartesian Fractional Hahn Moments of fractional orders α and β, \((\alpha ,\beta \in {\mathbb{R}})\), are given by.

$$Q^{\alpha ,\beta } = H^{\alpha } f_{q} H^{\beta }$$
(24)

and the reconstruction of the quaternion color image \(f_{q}\) from its moments is given by.

$$f_{q} = H^{ - \alpha } Q^{\alpha ,\beta } H^{ - \beta }$$
(25)

It should be noted that fractional orders \(\alpha ,\beta = 1\) lead to the classical Hahn moments of integer order, called the Quaternion Cartesian Hahn Moments (QCHMs). In other words, QCFrHMs are a generalization of QCHMs for fractional orders. In addition, with QCFrHMs, the color image is processed directly by a single vector field where each coefficient of QCFrHMs simultaneously contains the color information of all three color channels. Therefore, QCFrHMs can make a more compact and discriminating representation of the color image.

For grayscale images or single-channel images, FrHMs are special cases of QCFrHMs as shown in the following equation:

$$\begin{gathered} Q^{\alpha ,\beta } = H^{\alpha } f_{q} H^{\beta } \hfill \\ \, = H^{\alpha } (f_{R} i + f_{G} j + f_{B} k)H^{\beta } \hfill \\ \, = H^{\alpha } f_{R} H^{\beta } i + H^{\alpha } f_{G} H^{\beta } j + H^{\alpha } f_{B} H^{\beta } k \hfill \\ \, = M^{\alpha ,\beta } (f_{R} )i + M^{\alpha ,\beta } (f_{G} )j + M^{\alpha ,\beta } (f_{B} )k \hfill \\ \end{gathered}$$
(26)

where\(M^{\alpha ,\beta } (f_{R} )\), \(M^{\alpha ,\beta } (f_{G} )\) and \(M^{\alpha ,\beta } (f_{B} )\) are the FrHMs of the red, green and blue channels of the color image \(f_{q}\) , respectively,

Equation (26) shows that QCFrHMs can be expressed from FrHMs.

The proposed QCFrHMs depend on four parameters: the fractional orders α and β \((\alpha ,\beta \in {\mathbb{R}})\) and the polynomial parameters (a, b), unlike the classical Hahn moments which depend only on the polynomial parameters (a, b). The additional fractional orders (α, β) can give a wide choice in the domains where QCFrHMs are applied.

4 Application in color image watermarking

With the easy accessibility of data and the increasing use of the Internet, color images can suffer from illegal copying and redistribution in unsecured networks. The digital watermarking method, one of the most important and popular methods for copyright protection of digital images [33]. The principle of the digital watermarking method, for copyright protection, is to integrate into an original image an invisible mark, called a watermark, containing a copyright code. The watermarked image can then be distributed in insecure networks because it will always bear the mark of its owner.

A watermarking scheme is efficient if the watermarked image is very close to the original image (Imperceptibility Requirement) and if the various attacks (including common image processing attacks and geometric distortions) do not prevent watermark extraction (Robustness Requirement). In addition, hidden watermark should only be identified by the owner of the original image (Security Requirement).

Many watermarking schemes based on quaternion moments have been proposed for the copyright protection of color images. Based on Quaternion Radial Tchebichef Moments (QRTMs), Tsougenis et al. [30] proposed a robust watermarking scheme against desynchronization attacks and common signal processing attacks. Based on these descriptors and MLNCML chaotic system, robust zero-watermarking method was proposed in [39] for the copyright protection of stereo color images. Based on the probability density gradient and the color invariance model, Wang et al. [34] proposed a robust color image watermarking scheme using local Quaternion Exponent Moments (QEMs). Based on Quaternion Polar Harmonic Transform (QPHT), Yang et al. [42] proposed another watermarking scheme that is robust against geometric distortions and resistant to some image processing operations. Niu et al. [19] proposed an invariant color image watermarking scheme using Quaternion Radial Harmonic Fourier Moments (QRHFMs), which has robustness against various attacks (including common image processing operations and geometric distortions). Hosny et al. [9] based on the Quaternion Radial Substituted Chebyshev Moments (QRSCMs) to build a robustness watermarking scheme against geometric distortions and common signal processing attacks. Tsougenis et al. [31] proposed an adaptive watermarking system based on quaternion radial moments (QRTMs, QRKMs, QRdHMs). In this work, the genetic algorithm is used to adjust the watermark integration strength according to the complexity of the blocks of the original image. The aforementioned schemes seek to optimize a compromise between imperceptibility and robustness, since an improvement in imperceptibility leads to a lowering of robustness and vice versa.

Based on the proposed QCFrHMs, we propose in this section an invisible, robust and secure watermarking scheme for the copyright protection of color images. The proposed scheme ensures high imperceptibility and robustness thanks to the proposed QCFrHMs with the appropriate choice of fractional orders (α, β). In addition, the proposed scheme adopts a multi-level security strategy (3 levels) offering a high level of security. The proposed watermarking scheme includes two essential procedures: the watermark integration procedure and the watermark extraction procedure. The description of these procedures is presented in the following subsections.

4.1 Watermark integration scheme

The purpose of this procedure is to insert an invisible watermark containing a copyright code into an original color image. The watermarked image can then be distributed because it will always contain the mark of its owner.

Let f be the host color image of size \(N \times N\) and \(L \times L\) be the binary watermark of size \(8 \times 8\) . The procedure for inserting the watermark into the host color image is described as follows:

  1. (1)

    The host color image is divided into \(8 \times 8\)-pixel blocks.

  2. (2)

    For each color block, the proposed QCFrHMs are calculated using the following equation:

    $${\varvec{Q}}_{{\varvec{i}}} = H^{\alpha } B_{i} H^{\beta } \, , \, i = 0,1,2,...,(N^{2} /64) - 1$$
    (26)

    where \({\varvec{Q}}_{{\varvec{i}}}\) is the matrix of QCFrHMs of the color block\(B_{i} ,{(}i = 0,1,2,...,(N^{2} /64) - 1)\), α and β are the fractional orders of QCFrHMs. Fractional orders \((\alpha ,\beta )\) and polynomial parameters \((a,b)\) are used as security parameters in the proposed scheme. These values are denoted Key1.

  3. (3)

    To enhance the security of the proposed scheme, the watermark is scrambled before inserting it into the host image. The scrambled watermark noted \(W_{1}\) can be obtained using the following Arnold transformation [33]:

    $$\left[ \begin{gathered} {x^{\prime}} \\ {y^{\prime}} \\ \end{gathered} \right] = \left[ {\begin{array}{*{20}c} 1 & 1 \\ 1 & 2 \\ \end{array} } \right]\left[ \begin{gathered} x \\ y \\ \end{gathered} \right]\bmod (L)$$
    (27)

    where \((x,y)\) and \((x^{\prime},y^{\prime})\) are the pixels of \(W\) and \(W_{1}\), respectively, and L represents the size of watermark image matrix.

    Finally, the scrambled watermark \(W_{1}\) is transformed into a one-dimensional vector \(W_{1}\):

    $$W_{2} = \{ w_{2} (i), \, i = 0,1,...,L^{2} - 1\}$$
    (28)
  4. (4)

    To integrate the scrambled watermark into the host image, we adopt the bits integration strategy. Indeed, we integrate a single bit of the watermark into an matrix \({\varvec{Q}}_{{\varvec{i}}}\) by modifying a single coefficient of the matrix \({\varvec{Q}}_{{\varvec{i}}}\) using the following quantization function [3, 42]:

    $$|\overline{q}_{i} (j,k)| = \left\{ \begin{gathered} 2\Delta \times round\left( {\frac{{|q_{i} (j,k)|}}{2\Delta }} \right) + \frac{\Delta }{2} \, , \, if \, w_{2} (i) = 1 \hfill \\ 2\Delta \times round\left( {\frac{{|q_{i} (j,k)|}}{2\Delta }} \right) - \frac{\Delta }{2} \, , \, if \, w_{2} (i) = 0 \hfill \\ \end{gathered} \right.$$
    (29)

    where \(W_{2} = \{ w_{2} (i), \, i = 0,2,...,L^{2} - 1\}\) is the vector of the scrambled watermark, \(W_{2} = \{ w_{2} (i), \, i = 0,2,...,L^{2} - 1\}\) is the old QCFrHMs matrix of the block\(B_{i} ,{(}i = 0,1,2,...,(N^{2} /64) - 1)\), \(\overline{\user2{Q}}_{{\varvec{i}}} \{ \overline{q}_{i} (j,k), \, 0 \le j,k < 8\}\) is the modified QCFrHMs matrix of this block, \(\Delta\) is the quantization step controlling the embedding strength of the watermark bit, and \(round(.)\) is the round operator.

    The positions of the modified coefficients in the matrices \(\overline{\user2{Q}}_{{\varvec{i}}} ,{ (}i = 0,1,2,...,(N^{2} /64) - 1)\) are reorganized to form the second secret key, denoted Key2.

  5. (5)

    Apply the inverse transformation on each modified matrix \(\overline{\user2{Q}}_{{\varvec{i}}}\) to obtain the color watermarked blocks \(\hat{B}_{i}\) using the following relationship:

    $$\hat{B}_{i} = H^{ - \alpha } \overline{\user2{Q}}_{{\varvec{i}}} H^{ - \beta } \, , \, i = 0,1,2,...,(N^{2} /64) - 1$$
    (30)

    then, cosllect the watermarked blocks \(\hat{B}_{i} ,{(}i = 0,1,2,...,(N^{2} /64) - 1)\) to obtain the color watermarked image \(\hat{f}\).

The proposed watermarking scheme based on QCFrHMs offers robustness against various image processing attacks. However, geometric distortions such as rotation, scaling and change in length–width ratio can affect the watermark extraction process from the watermarked image. To ensure robustness against these geometrical distortions, we adopt in this paper the strategy presented in [14] for estimating the geometrical transformation parameters. The rotation angle and scaling factor of an attacked watermarked image can be directly estimated by taking into account the first three coefficients of the QCFrHMs (\(Q_{0,0} ,Q_{1,0} ,Q_{0,1}\)) of the original image. Therefore, the coefficients\(Q_{0,0} ,Q_{1,0} ,Q_{0,1}\), and the security keys Key1 and Key2 are stored in the Intellectual Property Rights database (IPR).

4.2 Watermark extraction scheme

The watermark extraction procedure is used to validate the copyright of the color watermarked image. The watermark can be easily extracted from the watermarked image by knowing the security information {\(Q_{0,0} ,Q_{1,0} ,Q_{0,1}\), Key1, Key2}, which is obtained from Intellectual Property Rights database (IPR).

Let \(\hat{f}\) be the watermarked color image whose copyright we want to check by extracting the integrated watermark. The watermark extraction procedure is described as follows:

  1. (1)

    In order to precisely extract the digital watermark, we first adopt the strategy presented in [14] to estimate the rotation angle and scale factor of the watermarked color image, using the three coefficients \(Q_{0,0} ,Q_{1,0} ,Q_{0,1}\) of the original image and the three corresponding coefficients of the watermarked image \(\hat{f}\). Then, we correct the watermarked image by transforming it to its original geometric form according to the estimated rotation angle and scaling factor. Note that for the change of the length–width ratio, the watermarked color image was pre-sized to a square size before the estimation of the geometric transformation parameters.

    Finally, the corrected watermarked image is divided into blocks \(\hat{B}_{i} (i = 0,1,2,...,(N^{2} /64) - 1)\) of \(8 \times 8\) pixels.

  2. (2)

    For each block of the watermarked image, the QCFrHMs are calculated using the security key Key1:

    $$\hat{\user2{Q}}_{{\varvec{i}}} = H^{\alpha } \hat{B}_{i} H^{\beta } \, , \, i = 0,1,2,...,(N^{2} /64) - 1$$
    (31)

    Where \(\hat{\user2{Q}}_{{\varvec{i}}}\) is the QCFrHMs matrix of the watermarked block \(\hat{B}_{i} (i = 0,1,2,...,(N^{2} /64) - 1)\), α and β are fractional orders obtained from the security key Key1.

  3. (3)

    The scrambled watermark is extracted from a set of selected QCFrHM coefficients using the following relationship [33]:

    $$\hat{w}_{2} (i) = \left\{ \begin{gathered} 1 \, if \, |\hat{q}_{i} (Key2)| - 2\Delta \times round\left( {\frac{{|\hat{q}_{i} (Key2)|}}{2\Delta }} \right) > 0 \hfill \\ 0 \, if \, |\hat{q}_{i} (Key2)| - 2\Delta \times round\left( {\frac{{|\hat{q}_{i} (Key2)|}}{2\Delta }} \right) \le 0 \hfill \\ \end{gathered} \right.$$
    (32)

    where \(\hat{\user2{Q}}_{{\varvec{i}}} = \{ \hat{q}_{i} (j,k), \, 0 \le j,k < 8\}\) is the QCFrHMs matrix of the block \(\hat{B}_{i} (i = 0,1,2,...,(N^{2} /64) - 1)\), Key2 are the positions of the selected QCFrHM coefficients and \(\hat{W}_{2} = \{ \hat{w}_{2} (i), \, 0 \le i < L^{2} - 1\}\) is the vector of the extracted scrambled watermark.

    Finally, the vector \(\hat{W}_{2}\) is reorganized into a two-dimensional matrix \(\hat{W}_{1}\) of size \(L \times L\) pixels.

  4. (4)

    The extracted watermark can be obtained by descrambling \(\hat{W}_{1}\) to \(\hat{W}\) using the inverse Arnold transform.

Note that, for an color image of size\(N \times N\) , the total number of bits that can be integrated is \(N \times N/64\). Therefore, Therefore, the watermark size should checked the condition\(L \times L \le N \times N/64\).

5 Simulation results

In this section, experimental results are provided to validate the theoretical framework developed in the previous sections. QCFrHMs are evaluated and compared in the context of color image watermarking. In the first test, we study the imperceptibility of the proposed watermarking scheme. Then, we test the robustness of the proposed scheme against various common image processing attacks and against geometric distortions. Next, we study the effect of fractional order variation of QCFrHMs on imperceptibility and robustness of the proposed watermarking scheme. Finally, we perform a test that shows the advantage of QCFrHMs on the security of the proposed watermarking scheme. To conduct these experiments, we use 8 popular color images and 5 binary watermarks. The 8 images (Fig. 1) are color images of size 256 × 256 × 24 bits extracted from the USC-SIPI image database [28], while the 5 watermarks (Fig. 2) are binary images of size 64 × 64 bits extracted from the MPEG-7 CE-shape-1 database [26]. The polynomial parameters a and b are fixed at the value \(a = b = 5\) according to [4].

Fig. 1
figure 1

The host color images used in experiments: a “Peppers”, b “Barbara”, c “House”, d “Splash”, e “Lena”, f “Airplane”, g “Mandrill” and h “Sailboat and lake”

Fig. 2
figure 2

The binary watermarks used in experiments: a “Bat”, b “Deer”, c “Cup”, d “Lizzard” and e “Guitar”

An objective assessment is carried out using the following criteria:

The Peak Signal to Noise Ratio (PSNR) is used to measure the difference between the original color image \(f\) and the watermarked one \(\hat{f}\) [33]:

$${\text{PSNR(}}f,\hat{f}{)} = 10\log_{10} \left( {\frac{{255^{2} \times N \times N}}{{\sum\limits_{x = 1}^{N - 1} {\sum\limits_{y = 1}^{N - 1} {\left[ {f(x,y) - \hat{f}(x,y)} \right]^{2} } } }}} \right)$$
(33)

where \(N \times N\) is the size of the color images.

A high PSNR value means less error between the original image and the watermarked one, this translates to a high imperceptibility.

The Bit Error Rate (BER, \(0 \le {\text{BER}} \le 1\)) is used to measure the similarity between the original watermark \(W\) and the extracted watermark \(\hat{W}\) [33]:

$${\text{BER(}}W,\hat{W}{)} = \frac{1}{L \times L}\sum\limits_{i = 1}^{L} {\sum\limits_{j = 1}^{L} {|W(i,j) - \hat{W}(i,j)|} }$$
(34)

where \(L \times L\) is the size of the watermark.

A lower value for BER means less error between the original watermark and the extracted one, which translates to a high robustness against attacks.

The experiments were conducted in a Matlab R2018a environment on a PC with a 2.4 GHz Intel Core i3 processor and 6 GB RAM.

In the first test, we study the imperceptibility of the proposed watermarking scheme. The test is carried out on the 8 color images (Fig. 1). Each of the 5 watermarks (Fig. 2) has been integrated into the 8 color images by applying the watermark integration procedure presented in subsect. 4.1 to form 40 (8 × 5) watermarked color images. The fractional orders \((\alpha ,\beta )\) of the QCFrHMs are chosen at the value \(\alpha ,\beta = 0.3\). The watermarks are integrated with a quantification step Δ (integration force) ranging from 5 to 60 with a step of 5. Figure 3 shows the average PSNR values obtained from the 40 watermarked images as a function of the quantification step Δ. In addition, experimental results are compared to watermarking schemes based on QCFrHMs with the choices \(\alpha ,\beta = 0.4\), \(\alpha ,\beta = 0.9\), and \(\alpha ,\beta = 1\). We recall that the choice \(\alpha ,\beta = 1\) leads to the classical Hahn moments (QCHMs). Figure 4 shows a set of watermarked images with different quantization steps Δ.

Fig. 3
figure 3

Average PSNR of the 40 watermarked images as a function of the quantization step Δ (i.e. the integration force of the watermark)

Fig. 4
figure 4

Set of watermarked images of “Peppers” using the QCFrHMs-based scheme

Figure 3 shows that average PSNRs decrease as the quantification step Δ increases, which means that the small values Δ lead to watermarked images of high quality close to the original images (high imperceptibility), while high values Δ lead to low quality watermarked images. This is clearly shown in Fig. 4. It is also shown that for the same quantification step, the proposed watermarking scheme with fractional orders \(\alpha ,\beta = 0.3\) gives the best results in terms of imperceptibility, where the average PSNRs are higher than the average PSNRs of the fractional orders \(\alpha ,\beta = 0.4\) and \(\alpha ,\beta = 0.9\). While the scheme based on classical QCHMs (QCFrHMs with \(\alpha ,\beta = 1\)) gives the lowest PSNRs. Therefore, we can conclude that the appropriate choice of fractional orders, improves the imperceptibility of the watermarking scheme.

Generally, a high value of the quantization step Δ improves the robustness of the watermarking scheme. Therefore, the choice of the Δ value must be ensured a compromise between imperceptibility and robustness. To guarantee an acceptable quality of watermarked images, the quantization step Δ is chosen to maintain an acceptable PSNR of approximately 40 dB. It should be noted that for the PSNR = 40 dB, the difference between the watermarked images and the original images is not detectable by the human eye. In the rest of the paper, we will use, Δ = 50 for the proposed QCFrHMs with the fractional orders \(\alpha ,\beta = 0.3\) and Δ = 35 for the classical QCHMs.

In the second test, we evaluate the robustness of the proposed watermarking scheme against various common image processing attacks and geometric distortions. We recall that the proposed watermarking scheme is based on the proposed QCFrHMs, and the performance of this scheme is directly related to the QCFrHMs performance.

The fractional orders are \(\alpha ,\beta = 0.3\) and the quantization step is set to the value Δ = 50. The 8 color images (Fig. 1), and the 5 watermarks (Fig. 2) are used in this test to generate watermarked color images. The watermark “Bat” is integrated into each color image, thus creating 1 × 8 = 8 color watermarked. Then, the 8 color images thus watermarked are degraded by common image processing attacks and geometric distortions of Table 1. Next, we extract watermarks from the attacked watermarked images by applying the watermark extraction scheme (Subsect. 4.2), creating altogether 8 extracted watermarks of “Bat”. Figure 5 shows a set of “Bat” watermarks, which are extracted from the attacked watermarked images of “Peppers”. With this approach, we obtain 8 extracted watermarks of “Deer”, “Cup”, “Lizzard” and “Guitar”, in order to obtain 40 extracted watermarks for each attack of Table 1. Then, we calculate the BER (Eq. 34) of each extracted watermark and we obtain 40 results. Finally, we calculate the average BER for each attack.

Table 1 Information of the applied attacks
Fig. 5
figure 5

Set of watermarks “But” extracted from the watermarked images of “Peppers”

The similar procedure is performed using the proposed scheme based on QCFrHMs with fractional orders \(\alpha ,\beta = 0.4\) and \(\alpha ,\beta = 0.9\) and the proposed scheme based on classical QCHMs (QCFrHMs with \(\alpha ,\beta = 1\)).

For comparison purposes, this test is performed for the Quaternion Radial Tchebichef Moments (QRTMs) method reported in [30], as well as the watermarking using the Quaternion Exponent Moments (QEMs) [34], Quaternion Radial Krawtchouk Moments(QRKMs) [10], Quaternion Radial Harmonic Fourier Moments (QRHFMs) [19], Quaternion Polar Harmonic Transform (QPHT) [42] and Quaternion Radial Substituted Chebyshev Moments (QRSCMs) [9]. The experimental results can be found in Fig. 6.

Fig. 6
figure 6

The watermark extraction results for common image processing attacks and for geometric distortions

The results of Fig. 6 show that: (1) the watermarking scheme based on QCFrHMs with fractional orders \(\alpha ,\beta = 0.3\) gives the best results in terms of robustness against common image processing attacks and against geometric distortions, because the average BERs are very low for different attacks of this test, which means that the extracted watermarks are recognizable and close to the original watermarks as shown by the examples in Fig. 5; (2) the choice of fractional orders directly influences on the proposed watermarking scheme robustness. Indeed, watermarking schemes with fractional orders \(\alpha ,\beta = 0.3\) and \(\alpha ,\beta = 0.4\) are very robust. However, this is not the case for fractional orders \(\alpha ,\beta = 0.9\) and \(\alpha ,\beta = 1\). This shows that the appropriate choice of fractional orders of QCFrHMs improves the performance of the proposed watermarking scheme in terms of robustness against common image processing attacks and against geometric distortions; (3) the average BERs increase as the degradation of the watermarked image increases. Although some watermarked images are much degraded, the average BERs of QCFrHMs with fractional orders \(\alpha ,\beta = 0.3\) are very low, which means that the extracted watermarks are very close to the original watermarks; (4) the proposed QCFrHMs with the fractional orders \(\alpha ,\beta = 0.3\) and \(\alpha ,\beta = 0.4\) work much better than the descriptors of QRTMs [30], QEMs [34], QRKMs [10], QRHFMs [19], QPHT and QRSCMs [9], for various image processing attacks and geometric distortions. The reason for this is that QCFrHMs are defined in the Cartesian system and the images as well, so no coordinate conversion is necessary, which reduces calculation complexity and improves numerical stability. In addition, suitable fractional orders increase the accuracy of these descriptors, which is important for the proposed scheme robustness.

In the third test, we study the effect of fractional order variation of QCFrHMs on the imperceptibility and the robustness of the proposed watermarking scheme. We recall that the proposed QCFrHMs can be considered as a general version of the classical QCHMs. The quantification step is set at Δ = 50 in this test.

Starting with the imperceptibility test, each of the 5 watermarks (Fig. 2) is integrated into the 8 color images (Fig. 1) by applying the watermark integration scheme (Subsect. 4.1) to form 40 (8 × 5) watermarked color images. QCFrHMs are implemented with fractional orders \((\alpha ,\beta )\) ranging from \(\alpha ,\beta = 0.1\) to \(\alpha ,\beta = 1\) with a step of 0.1. Figure 7 shows the average PSNRs obtained from the 40 watermarked images as a function of the fractional orders\((\alpha ,\beta )\).

Fig. 7
figure 7

Effect of fractional order variation of QCFrHMs on the imperceptibility of the proposed watermarking scheme

For the robustness test, the watermark extraction scheme (Subsect. 4.2) is applied to recover the watermarks from the 40 watermarked images. QCFrHMs are implemented with fractional orders ranging from \(\alpha ,\beta = 0.1\) to \(\alpha ,\beta = 1\) with a step of 0.1. Four combined attacks are used in this test, namely Attack 1: Salt & Peppers noise (0.02) + Median filtering (3 × 3) + Scaling (1.1); Attack 2: JPEG compression (30) + Cropping at top left corner (5%) + Average filtering (3 × 3); Attack 3: Gaussian White Noise (0.01) + Average filtering (5 × 5) + Rotation (15°) and Attack 4: JPEG compression (50) + Gaussian blur (1.5) + Length–width ratio change (1.25/0.5) + Cropping at top left corner (15%). The main reason for using combined attacks in this test is that the watermarked image can easily undergo several attacks simultaneously in the transmission process. The average BERs are presented as a function of fractional orders \(\alpha ,\beta = 1\) in Fig. 8.

Fig. 8
figure 8

Effect of fractional order variation of QCFrHMs on the robustness of the proposed watermarking scheme against combined attacks; a Attack 1, b Attack 2, c Attack 3 and d Attack 4

Examining these results, Fig. 7 clearly shows that the average PSNRs with the fractional orders \(\alpha ,\beta = 0.1,0.2,0.3,0.4,0.5,0.8,0.9\) are superior to the average PSNRs of the fractional orders \(\alpha ,\beta = 1\), which means that QCFrHMs with these fractional orders considerably improve the imperceptibility of the proposed watermarking scheme. On the other hand, Fig. 8 shows that most of the fractional orders, in particular the orders \(\alpha ,\beta = 0.1,0.2,0.3,0.4,0.9\), improve the robustness of the proposed watermarking scheme with respect to combined attacks where the average BERs are lower than the average BERs of the fractional orders\(\alpha ,\beta = 1\). Figures 7 and 8 also show that the choice \(\alpha ,\beta = 0.3\) gives the best results in terms of imperceptibility (high PSNR) and robustness (low BER), which explains the effectiveness of the proposed watermarking scheme with this choice in previous tests. This test shows the advantages that can be obtained with the appropriate choice of fractional orders of QCFrHMs.

In the last test, we show the advantage of QCFrHMs on the security of the proposed watermarking scheme. As mentioned in Sect. 4, the fractional orders (Key1) used in the watermark integration procedure are necessary for the correct extraction of the watermark from the watermarked image. In other words, if we do not know these fractional orders we cannot check the copyright of the watermarked image. To show this advantage, the color image “Peppers” and the watermark “But” are used to generate the watermarked image “Peppers” with fractional orders \(\alpha ,\beta = 0.3\). Then, we extract the watermark from the watermarked image “Peppers” with fractional orders ranging from \(\alpha ,\beta = 0.1\) to \(\alpha ,\beta = 1\) with a step of 0.1. In the integration procedure and the watermark extraction procedure, the quantization step (Δ = 50) and the Key2 (positions of the modified QCFrHMs coefficients) are unchanged. With this approach, we repeat this test by integrating the watermark “But” in the color image “Peppers” with fractional orders \(\alpha ,\beta = 0.9\). The BERs of the extracted watermarks are shown as a function of fractional orders \((\alpha ,\beta )\) in Fig. 9. Figure 10 shows the extracted watermarks with different fractional orders.

Fig. 9
figure 9

The extracted watermark BERs according to fractional orders; a Watermark integration using fractional orders \(\alpha ,\beta = 0.3\) and b Watermark integration using fractional orders \(\alpha ,\beta = 0.9\)

Fig. 10
figure 10

The columns from left to right show extracted watermarks using QCFrHMs with fractional orders 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 and 1, respectively

Figure 9 shows that the watermark can be extracted from the watermarked images only when the correct fractional orders are used. Indeed, BERs with correct fractional orders are equal to zero while BERs with wrong fractional orders are greater than 4.5, which means that extracted watermarks are recognizable and close to the original watermarks when the correct fractional orders are used. This is clearly shown in Fig. 10. This test illustrates the advantage of QCFrHMs on the security of the proposed watermarking scheme.

6 Conclusion

In this paper, we have proposed a new type of quaternion moments, which are the Quaternion Cartesian Fractional Hahn Moments. The latter are defined from the quaternion theory and the new fractional Hahn polynomials, which makes it possible to generalize the classical quaternion Hahn moments for the case of fractional order equal to 1. Fractional Hahn polynomials are defined from the eigenvalue decomposition and spectral representation of the classical Hahn polynomials matrix. The proposed QCFrHMs are capable to process the color image in a compact and holistic way where each coefficient of the QCFrHMs simultaneously contains the color information of all three channels of the processed image. In addition, the additional fractional orders α and β \((\alpha ,\beta \in {\mathbb{R}})\) give a wide choice of QCFrHMs for all fields of application of the latter especially for the reconstruction, localization and detection of regions of interest. We have also proposed a new, robust and secure invisible watermarking scheme for color image protection based on the proposed QCFrHMs. Simulation results showed the effectiveness of the proposed moments in terms of representation and watermarking of color images compared to classical Hahn moments and compared to other types of the radial and Cartesian quaternion moments. The important results of the proposed fractional moments can be used for applications such as signal and 3D image watermarking.