Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

The Reed-Muller-Fourier transform (RMF), defined in the ring \((Z_{p}, \oplus , \cdot )\), p an integer larger than 2, was introduced in [1] aiming to unify relevant characteristics of the Reed-Muller transform (RM) and the Discrete Fourier transform (DFT), to be applied in the non-binary integer domain allowing to obtain polynomial expressions for multiple-valued functions. In the binary case, the RM transform has a self inverse matrix representation, which is lower triangular, and exhibits a Kronecker product structure [2,3,4]. When the RM transform was extended to the non-binary domain [5], it retained the property of realizing a bijection in the set of functions for a given valuedness and arity, but it lost the lower triangular structure and its self inversion. The DFT, however is lower triangular in all integer domains. To obtain the desired combination of properties for the RMF transform, the Gibbs algebra defined in terms of the Gibbs multiplication for the Instant Fourier Transform [6] was selected and extended to the non-binary domain in [1].

In the context of patterns, let \(\varGamma \) be a finite ordered set of colors with cardinality p, and let \(\beta : \varGamma \rightarrow Z_{p}\) be a bijection assigning an element of \(Z_{p}\) to each color in such a way that the ordering of the colors is preserved. Pixels are atoms of a picture and carry a single color. (The size of a pixel is defined according to requirements of geometric and chromatic resolution for a pattern under consideration.) A pattern is an array of pixels. In this paper, a pattern is also represented as a matrix with entries from \(Z_{p}\) obtained by applying \(\beta \) to every pixel of a picture. Operations among patterns are conducted on the corresponding numerical matrices in the ring \((Z_{p}, \oplus , \cdot )\). Pattern attributes associated to a matrix are understood as attributes of the pattern represented by such a matrix.

2 Formalisms

In what follows, some properties of patterns will be studied in a transform domain. In this paper, we select the Reed-Muller-Fourier (RMF) transform [1, 2, 7]. It is known that this transform matrix is lower triangular, self-inverse and has a Kronecker product structure [8]. Moreover, this transform is based on the Gibbs convolutional product [4]. Figure 1 shows the basic transform matrices for \(p = 4,5\), and 6 as will be used in this paper.

Fig. 1.
figure 1

Basic RMF transform matrices for and \(p = 4, 5\), and 6.

The following notation will be used in the rest of the paper: \(\mathbf{A}(n)\) will denote a \((p^{n}\times p^{n})\) matrix (and pattern). \(\mathbf{A}(n,m)\) will denote a \((p^{n} \times p^{m})\) matrix (and pattern). For the RMF-transform matrix, the notation \(\mathbf{R}_{p}(n)\) will be used. (If a related statement is valid for all p, the index p may be omitted.)

For a given p and n, the RMF-transform matrix is defined as the n-th Kronecker power of the basic RMF-transform matrix \(\mathbf{R}_{p}(1)\). Therefore,

$$\begin{aligned} \mathbf{R}_{p}(n) = \bigotimes _{i=1}^{n} \mathbf{R}_{p}(1). \end{aligned}$$

H(n) will represent a matrix with all entries equal to 1 (H for “high”) and L(n) will denote a matrix with all entries equal to 0 (L for “low”). Finally, C(n) will represent a matrix with all entries equal to 0, except for the element at the left upper corner, where the entry equals 1 (leading to the name “corner”). For the analysis of patterns, a two-sided RMF-transform will be used (see definition below), a transformed pattern will be called “spectrum” and will be identified by \(\varSigma \). Unless otherwise specified, all operations will be done in the ring \((Z_{p}, \oplus , \cdot )\).

3 Analysis of Patterns by Using the RMF-Transform

In this section, we will present some considerations related to the application of the RMF-transform to analysis of patterns.

Definition 1

Given a pattern A(nm), its spectrum \(\varSigma _{A}(n,m)\), is calculated as follows

$$\begin{aligned} \varSigma _{A}(n,m) = \mathbf{R}_{p}(n) \cdot \mathbf{A}(n,m) \cdot (\mathbf{R}_{p}(m))^{T}, \end{aligned}$$
(1)

where the superindex T denotes the transposition of a matrix.

Lemma 1

The inverse RMF transform recovers a pattern from its spectrum as follows

$$\begin{aligned} \mathbf{A}(n,m) = \mathbf{R}_{p}(n) \cdot \varSigma _{A}(n,m) \cdot (\mathbf{R}_{p}(m))^{T}, \end{aligned}$$
(2)

Proof:

Since \(R_{p}(n)\) is its own inverse, the assertion follows by applying \(R_{p}(n)\) and \((R_{p}(m))^{T}\) at both sides of Eq. (1).

Lemma 2

For all p the RMF spectrum of a square symmetric pattern is symmetric.

Proof:

If A(n) is symmetric, it holds that \(A(n) = (A(n))^{T}\). Then,

$$\begin{aligned} \varSigma _{A}(n)= & {} \mathbf{R}(n) \cdot \mathbf{A}(n) \cdot (\mathbf{R}(n))^{T} = \mathbf{R}(n) \cdot (\mathbf{A}(n))^{T} \cdot (\mathbf{R}(n))^{T} \\= & {} \langle \mathbf{R}(n) \cdot \mathbf{A}(n) \cdot (\mathbf{R}(n))^{T} \rangle ^{T} = (\varSigma _{A}(n))^{T}. \end{aligned}$$

Lemma 3

If \(\mathbf{Q}(n,m) = \mathbf{A}(n,m) \oplus \mathbf{B}(n,m)\) then \(\varSigma _{Q}(n,m) = \varSigma _{A}(n,m) \oplus \varSigma _{B}(n,m)\).

Proof:

$$\begin{aligned} \varSigma _{Q}(n,m)= & {} \mathbf{R}(n) \cdot \mathbf{Q}(n,m) \cdot (\mathbf{R}(m))^{T} \\= & {} \mathbf{R}(n)\cdot (\mathbf{A}(n,m) \oplus \mathbf{B}(n,m))\cdot (\mathbf{R}(m))^{T} \\= & {} \mathbf{R}(n) \cdot \mathbf{A}(n,m)\cdot (\mathbf{R}(m))^{T} \oplus \mathbf{R}(n)\cdot \mathbf{B}(n,m) \cdot (\mathbf{R}(m))^{T} \\= & {} \varSigma _{A}(n,m) \oplus \varSigma _{B}(n,m). \end{aligned}$$

See examples in Fig. 2.

Fig. 2.
figure 2

Example of Lemmas 2 and 3 with \(p = 4\) and \(n = 1\). (a) The spectrum of a symmetric pattern is symmetric, (b) the spectrum of the sum of two patterns equals the sum of their spectra.

Lemma 4

The spectrum of the Kronecker product [3, 4] of two patterns equals the Kronecker product of the respective spectra. If \(\mathbf{Q}(n+r, m+s) = \mathbf{A}(n,m) \otimes \mathbf{B}(r,s)\) then \(\varSigma _{Q}(n+r, m+s) = \varSigma _{A}(n,m) \otimes \varSigma _{B}(r,s)\).

Proof:

$$\begin{aligned} \varSigma _{Q}(n+r, m+s)= & {} \mathbf{R}(n+r ) \mathbf{Q}(n+r , m+s) (\mathbf{R}(m+s) )^{T} \\= & {} (\mathbf{R}(n) \otimes \mathbf{R}(r))(\mathbf{A}(n,m) \otimes \mathbf{B}(r,s))(\mathbf{R}(m) \otimes \mathbf{R}(s))^{T}. \end{aligned}$$

With the compatibility theorem between Kronecker and matrix products [3],

$$\begin{aligned} \varSigma _{Q}(n+r , m+s)= & {} (\mathbf{R}(n) \mathbf{A}(n,m) \mathbf{R}(m)^{T}) \otimes (\mathbf{R}(r)\mathbf{B}(r,s)(\mathbf{R}(s)^{T}) \nonumber \\= & {} \varSigma _{A}(n,m) \otimes \varSigma _{B}(r,s). \end{aligned}$$
(3)

Notice that Eq. (3) may also be written as

$$\begin{aligned} \varSigma _{Q}(n+r, m+s)= & {} (\mathbf{I}(n) \varSigma _{A}(n,m) \mathbf{I}(m)) \otimes (\mathbf{R}(r) \mathbf{B}(r,s)(\mathbf{R}(s)^{T}) \nonumber \\= & {} (\mathbf{I}(n) \otimes \mathbf{R}(r))(\varSigma _{A}(n,m) \otimes \mathbf{B}(r,s))(\mathbf{I}(m) \otimes (\mathbf{R}(s)^{T}) \nonumber \\= & {} (\mathbf{I}(n) \otimes \mathbf{R}(r))(\varSigma _{A}(n,m) \otimes \mathbf{B}(r,s))(\mathbf{I}(m) \otimes (\mathbf{R}(s))^{T}. \end{aligned}$$
(4)

Since \((\mathbf{I}(n) \otimes \mathbf{R}(r)) = Diag(\mathbf{R}(r), \mathbf{R}(r), \ldots , \mathbf{R}(r))\) let it be called “the n-Block RMF transform”. Then the following is obtained:

Corollary 1

The RMF spectrum of the Kronecker product of two patterns \(\mathbf{A}(n,m)\) and \(\mathbf{B}(r,s)\), equals the n-Block RMF transform based spectrum of the Kronecker product of the (simple) RMF spectrum of the first pattern and the second pattern.

Lemma 5

$$\begin{aligned} \varSigma _{C}(m, n) = \mathbf{H}(m,n). \end{aligned}$$

Proof:

\(\mathbf{C}(0,n) = [1, 0, \ldots , 0]\). \(\varSigma _{C}(0,n) = \mathbf{R}(0) \mathbf{C}(0,n) \mathbf{R}^{T}(n) = [1, 0, \ldots , 0]{} \mathbf{R}^{T}(n)\).

Since \([1, 0, \ldots , 0]\mathbf{R}^{T} (n)\) returns the first row of \(\mathbf{R}t (n)\), which equals \(\mathbf{H}(0,n)\) -(see Fig. 2)- then \(\mathbf{C}(0,n) = \mathbf{H}(0, n)\). Similarly, \(\mathbf{C}(m,0) = \mathbf{H}(m,0)\). Considering that \(\mathbf{C}(m,n) = \mathbf{C}(m,0) \otimes \mathbf{C}(0,n)\), with Lemma 4 follows that:

$$\begin{aligned} \varSigma _{C}(m,n) = \varSigma _{C}(m,0) \otimes \varSigma _{C}(0,n) = \mathbf{H}(m,0) \otimes \mathbf{H}(0,n) = \mathbf{H}(m,n). \end{aligned}$$
(5)

Remark 1

Lemma 5 is a two-dimensional discrete extension of the Fourier transform of an impulse.

Corollary 2

$$\begin{aligned} \varSigma _{H}(m,n) = \varSigma _{H}(m,0) \otimes \varSigma _{H}(0,n) = \mathbf{C}(m,0) \otimes \mathbf{C}(0,n) = \mathbf{C}(m,n). \end{aligned}$$

Definition 2

For a given pair \((i, j ), i \in Z_{p^{m}}\) and \(j\in Z_{p^{n}}\), let \(\mathbf{P}(m,n)\) denote a “perturbation” matrix with a single 1 entry at the position (ij), otherwise having 0 entries. Then, \(\mathbf{P}(m,n) = [0,0, \ldots , 0,1, 0, \ldots ,0] \otimes [0, 0, \ldots , 0, 1, 0, \ldots , 0]^{T}\), where the vectors are of length \(p^{m}\) and \(p^{n}\) respectively, the first 1 is at the j-th position and the second, at the i-th position.

Lemma 6

For a given pair (ij) as in Definition 2, in the RMF spectrum \(\varSigma _{P}(m,n)\) the first i rows are 0-rows and the first j columns are 0-columns. The entry at the position (ij) has the absolute value 1 and the remaining entries are mostly non-zero entries.

Proof:

Let \(\mathbf{P}(0,n) = [0,0, \ldots , 0,1, 0, \ldots ,0]\), with the 1 at the j-th position. Then,

$$\begin{aligned} \varSigma _{P}(0,n)= & {} \mathbf{R}(0) \cdot [0,0, \ldots , 0,1, 0, \ldots ,0] \cdot \mathbf{R}^{T}(n) \\= & {} [1] \cdot [0,0, \ldots , 0,1, 0,\ldots ,0] \cdot \mathbf{R}^{T}(n) \\= & {} [0,0, \ldots , 0,1, 0, \ldots ,0] \mathbf{R}^{T}(n). \end{aligned}$$

It may be seen that the product \([0,0, \ldots , 0,1, 0, \ldots ,0]\cdot \mathbf{R}^{T}(n)\) extracts the j-th row of \(\mathbf{R}^{T}(n)\). Since \(\mathbf{R}^{T}(n)\) is upper triangular -(recall Fig. 2)- the j-th row has a prefix of j 0s and the first non-zero entry equals \((-1)^{j-1} \bmod p\).

Similarly, \(\mathbf{P}(m,0) = [0, 0, \ldots , 0, 1, 0, \ldots , 0]^{T}\), with the 1 at the i-th position. Then,

$$\begin{aligned} \mathbf{P}(m,0)= & {} \mathbf{R}(m) \cdot [0, 0, \ldots , 0, 1, 0, \ldots , 0]^{T} \cdot \mathbf{R}^{T}(0) \\= & {} \mathbf{R}(m)\cdot [0, 0, \ldots , 0, 1, 0, \ldots , 0]^{T}. \end{aligned}$$

The product \(\mathbf{R}(m) [0, 0, \ldots , 0, 1, 0, \ldots , 0]^{T}\) extracts the i-th column of \(\mathbf{R}(m)\). Since \(\mathbf{R}(m)\) is lower triangular, its i-th column has a prefix of i 0s and the first non-zero entry equals \((-1)^{i-1} \bmod p\).

It may be seen that \(\mathbf{P}(0,n) \otimes \mathbf{P}(m,0)\) will have the first i rows and the first j columns with 0 entries. Moreover, at (ij) the entry has magnitude \(1 \bmod p\).

Example 1

For \(p = 6\), Fig. 3 shows \(\mathbf{P}(1)\) with \((i,j) = (4,2)\).

Fig. 3.
figure 3

Example of the effect of a perturbation matrix.

It may be seen that the “left upper non-zero” pixel in the spectrum indicates the position of the perturbing pixel. This property may be used to detect and localize a noise pixel.

Definition 3

A mosaic is the Kronecker product of \(\mathbf{H}(n,m)\) and a basic pattern \(\mathbf{B}(r,s)\).

Example 2

Let \(p = 4\) and (for space limitations) let \(n = 1\) for \(\mathbf{H}\). Then define \(\mathbf{M}(1+r, 1+s) = \mathbf{H}(1) \otimes \mathbf{B}(r, s)\). From Lemma 4 and Corollary 2 follows that \(\varSigma _{M}(1+r, 1+s) = \varSigma _{H}(1) \otimes \varSigma _{B}(r, s) = C(1) \otimes \varSigma _{B}(r, s)\).

$$\begin{aligned} \mathbf{M}(1+r,1+s)=\left[ \begin{array}{c|c|c|c} \mathbf{B}(r, s) &{} \mathbf{B}(r, s) &{} \mathbf{B}(r, s) &{} \mathbf{B}(r, s) \\ \hline \mathbf{B}(r, s) &{} \mathbf{B}(r, s) &{} \mathbf{B}(r, s) &{} \mathbf{B}(r, s) \\ \hline \mathbf{B}(r, s) &{} \mathbf{B}(r, s) &{} \mathbf{B}(r, s) &{} \mathbf{B}(r, s) \\ \hline \mathbf{B}(r, s) &{} \mathbf{B}(r, s) &{} \mathbf{B}(r, s) &{} \mathbf{B}(r, s) \end{array} \right] , \end{aligned}$$
$$\begin{aligned} \varSigma _{M}(1+r,1+s)=\left[ \begin{array}{c|c|c|c} \mathbf{\varSigma _{B}(r, s)} &{} \mathbf{L}(r, s) &{} \mathbf{L}(r, s) &{} \mathbf{L}(r, s) \\ \hline \mathbf{L}(r, s) &{} \mathbf{L}(r, s) &{} \mathbf{L}(r, s) &{} \mathbf{L}(r, s) \\ \hline \mathbf{L}(r, s) &{} \mathbf{L}(r, s) &{} \mathbf{L}(r, s) &{} \mathbf{L}(r, s) \\ \hline \mathbf{L}(r, s) &{} \mathbf{L}(r, s) &{} \mathbf{L}(r, s) &{} \mathbf{L}(r, s) \end{array} \right] . \end{aligned}$$

It becomes apparent that if a random noise pixel is added to the mosaic during the building process, with Lemma 3, the 0-region of the spectrum will be clearly “contaminated”, thus detecting the presence of a noise pixel. Moreover the position of the upper left corner of the non-zero contaminating region clearly localizes the noise pixel.

Remark 2

The matrix which has a 1-entry at the right lower corner being otherwise 0 is a fixpoint of the two-sided RMF transform. Notice that this may be interpreted as a consequence of Lemma 6 and, therefore, is valid for all p. Additional examples of fixed points are shown in Fig. 4. Recall that with Lemmas 3 and 4 new (and larger) fixed points may be generated.

Fig. 4.
figure 4

Examples of some fixed points for \(p = 4\) and \(n = 1\).

4 Conclusions

For the first time the RMF transform has been applied to analyze properties of patterns. Possibly the most relevant result refers to the possibility of both detecting and localizing noise pixels in patterns.