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

Mathematical morphology is a nonlinear image processing methodology originally developed for binary and greyscale images [33]. It is based on the computation of maximum \(\bigwedge \) (dilation operator) and minimum \(\bigvee \) (erosion operator) in local neighborhoods called structuring elements [36]. That means that the definition of morphological operators needs a partial ordering relationship \(\le \) between the points to be processed. More precisely, for a real valued image \(f: E \rightarrow \mathbb R \), the flat dilation and erosion of image \(f\) by structuring element \(B\) are defined respectively by

$$\begin{aligned} \delta _{B}(f)(\mathbf x ) = \left\{ f(\mathbf y ) : f(\mathbf y )=\bigwedge _{\mathbf z } [f(\mathbf z )], \mathbf z \in B_{\mathbf x } \right\} . \end{aligned}$$
(1.1)
$$\begin{aligned} \varepsilon _{B}(f)(\mathbf x ) = \left\{ f(\mathbf y ) : f(\mathbf y )=\bigvee _{\mathbf z } [f(\mathbf z )], \mathbf z \in \check{B}_{\mathbf x } \right\} , \end{aligned}$$
(1.2)

where \(B_{\mathbf x }\subset E\) is the structuring element centered at point \(\mathbf x \in E\), and \(\check{B}\) is the reflection of structuring element with respect to the origin. Evolved operators are based on dilations and erosions: openings/closings, residues (gradient, top-hats), alternate sequential filters, geodesic operators (opening/closing by reconstruction, levelings). Morphological operators and filters perform noise suppression, contrast image enhancement, structure extraction and multi-scale decomposition, etc. [36].

Theory of morphological operators has been formulated in the general framework of complete lattices [23]: a complete lattice \(({\mathcal L},\le )\) is a partially ordered set \({\mathcal L}\) with order relation \(\le \), a supremum written \(\bigvee \), and an infimum written \(\bigwedge \), such that every subset of \({\mathcal L}\) has a supremum (smallest upper bound) and an infimum (greatest lower bound). Let \(\mathcal L\) be a complete lattice. A dilation \(\delta : {\mathcal L} \rightarrow {\mathcal L}\) is a mapping commuting with suprema, i.e., \(\delta \left( \bigvee _{i} X_i \right)=\) \(\bigvee _{i} \delta \left( X_i \right)\). An erosion \(\varepsilon : {\mathcal L} \rightarrow {\mathcal L}\) commutes with infima, i.e., \(\delta \left( \bigwedge _{i} X_i \right)=\) \(\bigwedge _{i} \delta \left( X_i \right)\). Then the pair \((\varepsilon ,\delta )\) is called an adjunction on \({\mathcal L}\) if for very \(X, Y\in {\mathcal L}\), it holds: \(\delta (X)\le Y\) \(\Leftrightarrow \) \(X\le \varepsilon (Y)\). Mathematical morphology is also characterized by its domain of invariance in the complete lattice \({\mathcal L})\) of the space of image values. Morphological operators \(\psi (\cdot ): {\mathcal L} \rightarrow {\mathcal L}\) commutate with a group of transformations \(G(\cdot ): {\mathcal L} \rightarrow {\mathcal L}\) of image values, i.e., for any \(f(\mathbf x )\in {\mathcal F}(E,{\mathcal L})\) we have \(\psi (G(f))(\mathbf x ) = G(\psi (f))(\mathbf x )\) or

$$ \begin{array}{ccc} f(\mathbf x )&\longrightarrow&\psi (f)(\mathbf x ) \\ \updownarrow&&\updownarrow \\ G(f)(\mathbf x )&\longrightarrow&\psi (G(f))(\mathbf x ) \\ \end{array} $$

Obviously the commutativity of the product \(G\circ \psi \) is equivalent to the invariance of the ordering \(\le \) under the transformation \(G(\cdot )\). The group of invariant transformations \(G(\cdot )\) depends on the physical properties of each particular \({\mathcal L}\), e.g., in gray level images, morphological operators commute with anamorphosis (i.e., \(G(\cdot )\) is a strictly increasing mapping).

Dilation and erosion can be also computed using an eikonal PDE [2]:

$$\begin{aligned} \partial u_{t} = \pm \parallel \nabla u \parallel , \end{aligned}$$
(1.3)

with initial conditions \(u(x,y,0)=f(x,y)\). The sign \(+\) leads to the dilation and the sign—to an erosion using an isotropic structuring element. Some advantages of the continuous formulation are, on the one hand, the fact that required elements (partial derivatives and Euclidean norm) do not required an ordering and, on the other hand, as other standard methods for numerical solutions of PDEs, the continuous approach allows for sub-pixel accuracy of morphological operators.

In addition, dilation and erosion can be also studied in the framework of convex analysis, as the supremum/infimum convolution in the \({(\max ,+)}\)/\((\min ,+)\) algebras, with the corresponding connection with the Legendre transform [26]. More precisely, the two basic morphological mappings \(\mathcal F (E, \overline{\mathbb R }) \rightarrow \mathcal F (E,\overline{\mathbb R })\) are given respectively by

$$\begin{aligned} \delta _{b}(f)(\mathbf x ) = (f \oplus b) (\mathbf x ) = \sup _{\mathbf h \in E} \left( f(\mathbf x - \mathbf h ) + b(\mathbf h ) \right), \end{aligned}$$
(1.4)

and

$$\begin{aligned} \varepsilon _{b}(f)(\mathbf x ) = (f \ominus b) (\mathbf x ) = \inf _{\mathbf h \in E} \left( f(\mathbf x + \mathbf h ) - b(\mathbf h ) \right). \end{aligned}$$
(1.5)

where the canonical family of structuring functions are the paraboloids \(b_{a}(\mathbf x )=-\frac{\Vert \mathbf x \Vert ^2}{2a}\).

Matrix and tensor valued images appear nowadays in various image processing fields and applications [43]:

  • Structure tensor images representing the local orientation and edge information [19], which are computed by Gaussian smoothing of the dyadic product \(\nabla u \nabla u^{T}\) of an image \(u(x,y)\):

    $$\begin{aligned} G(u)(x,y) = \omega _{\sigma } *\left( \nabla u(x,y) \nabla u(x,y)^{T} \right) = \left( \begin{array}{ccc} g_{xx}(x,y)&\,&g_{xy}(x,y) \\ g_{xy}(x,y)&\,&g_{yy}(x,y) \\ \end{array} \right) \end{aligned}$$

    where \(\nabla u(x,y) =\left( \frac{\partial u(x,y)}{\partial x}, \frac{\partial u(x,y)}{\partial y} \right)^{T}\) is the 2D spatial intensity gradient and \(\omega _{\sigma }\) stands for a Gaussian smoothing with a standard deviation of \(\sigma \). Hence, the components of the matrix are \(g_{xx}(x,y) = \omega _{\sigma } *\left( \frac{\partial u(x,y)}{\partial x} \right)^2\), \(g_{yy}(x,y) = \omega _{\sigma } *\left( \frac{\partial u(x,y)}{\partial y} \right)^2\) and \(g_{xy}(x,y) = \omega _{\sigma } *\left( \frac{\partial u(x,y)}{\partial x} \frac{\partial u(x,y)}{\partial y} \right)\).

  • Diffusion tensor magnetic resonance imaging (DT-MRI) [10] which describes the diffusive property of water molecules using \(3\times 3\) positive semidefinite matrix-field, i.e., image value at each pixel \((x,y)\) is a tensor:

    $$\begin{aligned} D(x,y) = \left( \begin{array}{ccc} d_{xx}(x,y)&d_{xy}(x,y)&d_{xz}(x,y) \\ d_{xy}(x,y)&d_{yy}(x,y)&d_{yz}(x,y) \\ d_{xz}(x,y)&d_{yz}(x,y)&d_{zz}(x,y) \\ \end{array} \right) \end{aligned}$$

    where \(d_{ii}(x,y)\) describes molecular mobility along each direction \(i\) of the space and \(d_{ij}(x,y)\) the correlation between directions \(i\) and \(j\) of the space.

  • Covariance matrices in different modalities of radar imaging [8, 9], including matrices of particular structure as the Toeplitz covariance matrices (from reflection coefficients parametrization) [47].

In this chapter we are interested in matrix-valued images considered as a spatial structured matrix field \(f(\mathbf x )\) such that

$$ f : E\subset \mathbb Z ^2,\, \mathbb Z ^3 \longrightarrow \mathrm {PDS}(n) $$

where \(E\) is the support space of pixels and, in particular, we focuss on (real) positive definite symmetric \(n\times n\) matrices \(\mathrm * {PDS}(n)\). The reader interested in positive definite matrices is referred to the excellent monograph [11], which considers issues on functional analysis, harmonic analysis and differential geometry in the manifold of positive definite matrices, and in particular it is explained recent work on the geometric mean of several matrices which will be used in this study.

In order to visualize the \(\mathrm {PDS}(n)\) matrices, and operations between them, we consider the classical property which said that a matrix \(A\in \mathrm {PDS}(n)\) corresponds to a quadratic form

$$ q_{A}(\mathbf x )= \mathbf x ^{\text{ T}}A^{-1}\mathbf x ,\,\, \mathbf x \in \mathbb R ^{n}. $$

Therefore, the matrix \(A\) can be represented by the isohypersurface \(q_{A}(\mathbf x )\), i.e., the ellipsoid \(\mathbf x ^{T}A^{-1}\mathbf x =1\) centered around \(0\). Figure 1.1 gives an example for \(\mathrm {PDS}(2)\). In the context of DTI, the ellipoids have a natural interpretation: if the matrix \(A \in \mathrm {PDS}(3)\) represents the diffusivity at a particle, then the ellipsoid encloses the smallest volume within which this particle will be found with some required probability after a short time interval.

Fig. 1.1
figure 1

Example of two matrices \(\mathrm {PDS}(2)\) depicted by their ellipses

The application of classical real-valued morphological operators to vector-valued images such as colour or multispectral images is not straightforward [39, 40]. To consider separately each vector component independently does not generally lead to useful operators [34]. In the framework of matrix-valued spaces, the extension of mathematical morphology to images \(f \in {\mathcal F}(E, \mathrm {PDS}(n))\) requires also adapted methods but this extension is neither natural nor unique.

1.1 State-of-the-Art

To the best of our knowledge, extension of mathematical morphology to matrix-valued images has been addressed exclusively by Burgeth et al. [15, 16]. They have considered two different approaches. The first one [16] is based on the Löwner partial ordering \(\le ^{L}\): \(\forall A,B \in \text{ PDS}(n)\), \(A \le ^{L} B\) \(\Leftrightarrow \) \(B-A \in \text{ PDS}(n)\), and where the supremum and infimum of a set of matrices are computed using convex matrix analysis tools (penumbral cones of each matrix, minimal enclosing circle of basis, computation of vertex of associated penumbra matrix). There is a geometrical interpretation viewing the tensors \(\text{ PDS}(n)\) as ellipsoids: the supremum of a set of tensors is the smallest ellipsoid enclosing the ellipsoids associated to all the tensors; the infimum is the largest ellipsoid which is contained in all the ellipsoids. The second approach [15] corresponds to the generalization of the morphological PDE given in Eq. (1.3) to matrix data: the numerical schema of Osher and Sethian for diffusion equation is generalized to matrices. Both approaches were compared in [15] for various basic morphological operators, mainly for regularization (smoother results for PDE framework than for Löwner ordering) and for edge/details extraction in DT-MRI examples.

Besides the Löwner ordering, there exist a theory on ordering of matrices, which is almost limited to Hermitian nonnegative definite matrices; a recent book [27] on the topic studies in depth this topic. There are three well characterized partial orderings [37, 7, 22]: the Löwner ordering \(\le ^{L}\) (defined above); the minus ordering \(A \le ^{-} B\) \(\Leftrightarrow \) \(rank(B-A)=rank(B)-rank(A)\); and the star ordering \(A \le ^{*} B\) \(\Leftrightarrow \) \(A^2 = AB\). They are related between them according to \(A \le ^{*} B\) \(\Rightarrow \) \(A \le ^{-} B\) \(\Rightarrow \) \(A \le ^{L} B\). It is evident that the minus and the star orderings are two restrictive and consequently without interest for matrix-valued image processing.

As we have just mentioned above, finding the unique smallest enclosing ball of a set of points in a particular space (also known as the minimum enclosing ball or the 1-center problem) is related to the Löwner ordering in the case of \(\mathrm {PDS}(n)\) matrices. Some recent works in the topic [29, 1] are therefore appropriate for sup/inf computation. In particular, it was introduced in [4] a generic 1-center iterative algorithm for Riemannian geometries, which can be instantiated for example to the case of the manifold of \(\mathrm {PDS}(n)\) matrices.

From the applications viewpoint, the mean of \(\mathrm {PDS}(n))\) matrices is very important in DTI denoising and analysis [41, 25]. However, to our knowledge, the previous theoretical results of mathematical morphology for \(\mathrm {PDS}(n))\) matrices [15, 16] have not yet proved their interest for real applications, over and above some illustrative examples from small DTI samples.

1.2 Aim of the Study and Chapter Organisation

The goal of this work is to introduce various alternatives ways to extend mathematical morphology to the space \(\mathrm {PDS}(n)\), which are different from those introduced by Burgeth et al [15, 16].

More precisely, let \(\mathfrak A = \{ A_i \}_{i=1}^{N} \) be a finite set of \(N\) matrices, where \(A_i\in \mathrm {PDS}(n)\), we are aiming at computing the supremum \(\sup \left( \mathfrak A \right) = A_{\vee }\) and the infimum \(\inf \left( \mathfrak A \right) = A_{\wedge }\) matrices, such that \(A_{\vee }\), \(A_{\wedge }\in \mathrm {PDS}(n)\). As mentioned above, if the operators \(\sup \left( \mathfrak A \right)\) and \(\inf \left( \mathfrak A \right)\) are defined, dilation and erosion according to Eqs. (1.1) and (1.2) are stated for any image \(f\in {\mathcal F}(E, \mathrm {PDS}(n))\) and any structuring element.

Three different families of approaches are explored in the rest of the document.

  • Section 1.2 deals with total orderings for \(\sup \)-\(\inf \) input-preserving operators. The basic idea consists in defining as supremum of a set of matrices, the matrix which is bigger according to the lexicographic priority of eigenvalues or according to a given priority between some matrix invariants associated to the eigenvalues. This kind of approaches is valid when a total ordering is defined. Consequently, the spectral information should be completed with additional conditions in the lexicographic cascade. In cases where a pair of reference matrix sets is defined (typically, a training set of matrices associated to the foreground and a training set of matrices associated to the background), it is also possible to define a total ordering according to the distances of each matrix to both reference sets. In such a technique, the distance between matrices is the key element for the ordering.

  • Section 1.3 discusses partial spectral ordering and inverse eigenvalue problem. By considering as partial ordering the product ordering of eigenvalues, it is possible to define the sup/inf of a set of matrices as the matrix having as eigenvalues the sup/inf of eigenvalues. However, the definition of the orthogonal basis of corresponding supremum is not straightforward. We propose two alternatives, the most interesting one based on using as orthogonal basis the one obtained from the geometric mean of the matrices.

  • The notion of counter-harmonic mean is introduced in Sect. 1.4 as a nonlinear averaging procedure to calculate pseudo-morphological operators. We have recently shown in [3] how the counter-harmonic mean [14] can be used to introduce nonlinear operators which asymptotically mimic dilation and erosion. It is shown how the extension of counter-harmonic mean to symmetric positive definite matrices is very natural and leads to an efficient operator to robustly estimate the supremum/infimum of a set of matrices.

Application of these supremum/infimum definitions to compute morphological operators on \(\mathrm {PDS}(n)\) matrix-valued images is illustrated in Sect. 1.5. The preliminary comparative results are useful to understand the potential interest of nonlinear filtering on matrix-valued images but also to show that there is no universal ordering strategy for all image processing tasks.

Finally, Sect.1.6 of conclusions and perspectives close the chapter.

2 Total Orderings for Sup-Inf Input-Preserving Sets of PDS Matrices

Before introducing total orderings based on lexicographic cascades of spectral invariants as well as on kernelized distances to reference matrices, we start this section by a discussion on the difference between partial and total ordering.

2.1 Partial Ordering vs. Total Ordering

We remind that \(\le \) is a partial order (or antisymmetric preorder) over the set of \(\mathrm {PDS}(n)\) matrices if for all \(A\), \(B\), and \(C\) in \(\mathrm {PDS}(n)\), we have that: \(A \le A\) (reflexivity); if \(A \le B\) and \(B \le A\) then \(A=B\) (antisymmetry); if \(A \le A\) and \(B \le C\) then \(A \le C\) (transitivity).

For matrices \(A\), \(B\) elements of the partially ordered set \(\mathrm {PDS}(n)\) according to \(\le \), if \(A \le B\) or \(B \le A\), then \(A\) and \(B\) are comparable. Otherwise they are incomparable. That involves that using a partial ordering \(\le \) over \(\mathrm {PDS}(n)\) the computation of supremum (resp. infimum) of a set of matrices \(\mathfrak A \) can produce the situation where two matrices which are incomparable are also bigger (smaller) than any of the other matrices of \(\mathfrak A \).

A typical case of partial ordering for matrices is the one which corresponds to the product order of the matrix components, i.e., the matrix components are taken marginally. For instance for matrices \(A,B\in \mathrm {PDS}(2)\) we have

$$ A = \left( \begin{array}{cc} a_{11}&a_{12} \\ a_{21}&a_{22} \\ \end{array} \right) \le _{marg} B = \left( \begin{array}{cc} b_{11}&b_{12} \\ b_{21}&b_{22} \\ \end{array} \right) \Leftrightarrow \left\{ \begin{array}{l} a_{11} \le b_{11} \text{ and}\,\ a_{12} \le b_{12} \text{ and} \\ a_{21} \le b_{21} \text{ and}\,\ a_{22} \le b_{22} \end{array} \right. $$

The marginal (or componentwise) supremum/infimum associated to the product partial ordering are given respectively by

$$ \sup ^{marg} \left( \mathfrak A \right) = \left( \begin{array}{cc} \bigvee _i a_{11,i}&\bigvee _i a_{12,i} \\ \bigvee _i a_{21,i}&\bigvee _i a_{22,i} \\ \end{array} \right) $$

and

$$ \inf ^{marg} \left( \mathfrak A \right) = \left( \begin{array}{cc} \bigwedge _i a_{11,i}&\bigwedge _i a_{12,i} \\ \bigwedge _i a_{21,i}&\bigwedge _i a_{22,i} \\ \end{array} \right) $$

As we can expect, the obtained supremum/infimum can be a new matrix which may not belong to \(\mathfrak A \): this is known as the “false color” problem in multivariate morphology [35]. Similarly, two different sets of matrices \(\mathfrak A _1\) and \(\mathfrak A _2\) can lead to the same supremum/infimum and consequently these subsets will not be comparable between them.

However, the fundamental drawback of the product order of matrices \(\le _{marg}\) applied to \(\mathrm {PDS}(n)\) is the fact that it is not guaranteed that \(A_{\vee }\) and \(A_{\wedge }\) belongs to \(\mathrm {PDS}(n)\), e.g.,

$$ A_{1} = \left( \begin{array}{cc} 6&3 \\ 3&2 \\ \end{array} \right) \in \mathrm {PDS}(2), \,\, A_{2} = \left( \begin{array}{cc} 10&3 \\ 3&1 \\ \end{array} \right) \in \mathrm {PDS}(2) $$

and the infimum matrix:

$$ A_{1} \bigwedge ^{marg} A_{2} = \left( \begin{array}{cc} 6&3 \\ 3&1 \\ \end{array} \right) $$

is symmetric but not positive definite.

A partial order under which every pair of elements is comparable is called a total order (or linear order). A totally ordered set is also called a chain. Hence, we have a total ordering \(\le \) over the set \(\mathrm {PDS}(n)\) if for any two different matrices \(A \ne B\), we have \(A < B\) or \(B < A\), i.e., all the \(\mathrm {PDS}(n)\) matrices are ordered according to \(\le \).

Besides this practical interest of having comparable elements, the other advantage of total ordering is associated to the following notion.

Definition 1

Given \(\mathfrak A = \{ A_i \}_{i=1}^{N} \), a finite set of \(N\) matrices, where \(A_i\in \mathrm {PDS}(n)\), the supremum and infimum are input-preserving iff \(A_{\vee } \in \mathfrak A \) and \(A_{\wedge } \in \mathfrak A \).

Obviously, any \(\sup \)/\(\inf \) input-preserving operator involves necessarily supremum/infimum matrices belonging to the set \(\mathrm {PDS}(n)\).

We have now this classical result which can be easily proven.

proposition 1

Any total ordering in \(\mathrm {PDS}(n)\) leads to \(\sup \)/\(\inf \) input-preserving operators.

We can now introduce two families of total orderings.

2.2 Lexicographic Total Orderings Based on Tensor Invariants

Let us consider that the \(N\) matrices of \(\mathfrak A = \{ A_i \}_{i=1}^{N} \) have been factorized in their spectral form, i.e.,

$$ A_{i} = V_i \Lambda _i V_i^{\text{ T}} $$

where \(\Lambda _i\) is the diagonal matrix of ordered eigenvalues

$$ \Lambda _i = \text{ diag}\left( \lambda _1(A_i), \cdots , \lambda _n(A_i) \right), $$

with \(\lambda _1(A_i)\ge \cdots \ge \lambda _n(A_i)\), and \(V_i\in SO(n)\) is the orthogonal matrix of eigenvector basis

$$ V_i = \left(\, \overrightarrow{v}_{1}(A_i),\cdots , \overrightarrow{v}_{n}(A_i) \, \right), $$

such that \(\Vert \overrightarrow{v}_{1}(A_i) \Vert = 1\) and \(\langle \overrightarrow{v}_{j}(A_i), \overrightarrow{v}_{k}(A_i)\rangle = 0\), \(\forall j \ne k\). This representation is frequently used in this study.

We introduce the lexicographic spectral partial ordering \(\le _{lex}^{0}\) as follows.

Definition 2

Let \(A\) and \(B\) be two \(\mathrm {PDS}(n)\) matrices. We define that \(A \le _{lex}^{0} B\) if the ordered sequence of the eigenvalues of \(A\) is lexicographically smaller or equal to the corresponding sequence of eigenvalues of \(B\), i.e., if there exists an index \(j\), \(1\le j\le n\) such that \(\lambda _i(A) = \lambda _i(B)\) for all \(i<j\), and \(\lambda _j(A) < \lambda _j(B)\) if \(j\le n\)

To be precise, it is a total ordering for the space of eigenvalues however is only an antisymmetric preorder for \(\mathrm {PDS}(n)\). In fact, using their interpretation as ellipsoids, two unequal matrices \(A\) and \(B\) can have the same shape, given by their eigenvalues but different orientation in the space given by the orthogonal matrix basis. The most natural way to complete the spectral ordering in order to have a total spectral ordering involves fixing a reference orthogonal basis \(R_{0}\), in such a way that for \(A\) and \(B\) having the same eigenvalues the biggest is the matrix having an orthogonal basis closer to \(R_{0}\); this distance should be of course measured in \(SO(n)\). An additional question should be taking into account concerning the choice of \(R_{0}\). If the value of the reference is independent of the image to be morphologically processed involves that a global transformation of the space values will induce a modification of the ordering; for instance a rotation of all the matrix-valued of the image by a change of origin during the acquisition. Consequently, in order to be invariant to the reference \(R_{0}\), its choice should be intrinsically done from the image values. In particular, we can consider that an useful \(R_{0}\) corresponds to the mean value of the matrix basis of the image, where the computation of the mean value is done in \(SO(n)\).

One of the difficulties of the lexicographic ordering \(\le _{lex}^{0}\) is the lack of geometric interpretation of the induced supremum and infimum. A more general strategy to define a spectral-based total orderings lies in associating to each \(\mathrm {PDS}(n)\) matrix a set of (scalar) invariants which have a geometric interpretation. Then, to define a priority between the invariants in order to build a lexicographic ordering according to these invariants. Finally, to complete with additional condition of distance from \(R_{0}\) to ensure the totality of the ordering.

For instance, given \(A \in \mathrm {PDS}(3)\), let \((S_1(A), S_2(A), S_3(A))\) be the set of fundamental symmetric polynomials:

  • \(S_1(A) = \lambda _1(A) + \lambda _2(A) + \lambda _3(A)\) (mean diameter of the ellipsoid),

  • \(S_2(A) = \lambda _1(A) \lambda _2(A) + \lambda _2(A) \lambda _3(A) + \lambda _1(A) \lambda _3(A)\) (second order relation of diameters),

  • \(S_3(A) = \lambda _1(A) \lambda _2(A) \lambda _3(A)\) (volume of ellipsoid).

we can define various other orderings, by changing the priorities between these invariants, e.g.,

(i) Priority is given to the mean diameter of the ellipsoid, then to the main eccentricity finally to the volume:

$$\begin{aligned} A \le _{lex}^1 B \,\, \Leftrightarrow \left\{ \begin{array}{l} S_1(A) < S_1(B) \,\,\text{ or}\,\,\\ S_1(A) = S_1(B) \,\,\text{ and}\,\, \frac{\lambda _1(A)}{S_1(A)} < \frac{\lambda _1(B)}{S_1(B)} \,\,\text{ or}\,\, \\ S_1(A) = S_1(B) \,\,\text{ and}\,\, \frac{\lambda _1(A)}{S_1(A)} = \frac{\lambda _1(B)}{S_1(B)} \,\,\text{ and}\,\, S_3(A) \le S_3(B) \\ \end{array} \right. \end{aligned}$$

(ii) Priority is given to the volume of the ellipsoid, then to the main eccentricity finally to the mean diameter:

$$\begin{aligned} A \le _{lex}^2 B \,\, \Leftrightarrow \left\{ \begin{array}{l} S_3(A) < S_3(B) \,\,\text{ or}\,\,\\ S_3(A) = S_3(B) \,\,\text{ and}\,\, \frac{\lambda _1(A)}{S_1(A)} < \frac{\lambda _1(B)}{S_1(B)} \,\,\text{ or}\,\, \\ S_3(A) = S_3(B) \,\,\text{ and}\,\, \frac{\lambda _1(A)}{S_1(A)} = \frac{\lambda _1(B)}{S_1(B)} \,\,\text{ and}\,\, S_1(A) \le S_1(B) \\ \end{array} \right. \end{aligned}$$

(iii) Priority is given to the “size” of the ellipsoid, then to the global eccentricity then to the main eccentricity:

$$\begin{aligned} A \le _{lex}^3 B \,\, \Leftrightarrow \left\{ \begin{array}{l} \frac{S_3(A)}{S_1(A)} < \frac{S_3(B)}{S_1(B)} \,\,\text{ or}\,\,\\ \frac{S_3(A)}{S_1(A)} = \frac{S_3(B)}{S_1(B)} \,\,\text{ and}\,\, \frac{\lambda _1(A)+ \lambda _2(A)}{S_1(A)} < \frac{\lambda _1(B)+ \lambda _2(B)}{S_1(B)} \,\,\text{ or}\,\, \\ \frac{S_3(A)}{S_1(A)} = \frac{S_3(B)}{S_1(B)} \,\,\text{ and}\,\, \frac{\lambda _1(A)+ \lambda _2(A)}{S_1(A)} = \frac{\lambda _1(B)+ \lambda _2(B)}{S_1(B)} \,\,\text{ and}\,\, \frac{\lambda _1(A)}{S_1(A)} \le \frac{\lambda _1(B)}{S_1(B)} \\ \end{array} \right. \end{aligned}$$

These geometric parameters of the ellipsoids in \(\mathrm {PDS}(n)\) are often used in DT-MRI [45, 31] (bulk mean diffusivity, isotropy, fractional anisotropy, etc.), therefore the lexicographic orderings yields easy understanding dilation/erosion operators. Other orthogonal tensor invariant as the proposed in [18] can be also considered for the construction of total orderings.

Figure 1.2 provides an example of supremum and infimum computation for a set of 10 \(\mathrm {PDS}(2)\) matrices using the lexicographic ordering \(\le _{lex}^{0}\). This result can be compared with the sumpremum and infimum obtained by the product order of matrices \(\le _{marg}\).

From the previous example, we see that, for instance, according to \(\le _{lex}^{0}\), the matrices are ordered mostly by the first priority in the lexicographic cascade. Generally, it is possible to reduce the “contribution” to the ordering schema of the first considered invariant by a simple quantization of this invariant. Therefore, we can introduce the \(\alpha \)-modulus lexicographic ordering \(\le _{lex,\alpha }^3\) as

$$\begin{aligned} A \le _{lex,\alpha }^3 B \,\, \Leftrightarrow \left\{ \begin{array}{l} \lfloor \frac{S_3(A)}{\alpha } \rfloor < \lfloor \frac{S_3(B)}{\alpha } \rfloor \,\,\text{ or}\,\,\\ \lfloor \frac{S_3(A)}{\alpha } \rfloor = \lfloor \frac{S_3(B)}{\alpha } \rfloor \,\,\text{ and}\,\, \lambda _1(A)/S_1(A) < \lambda _1(B)/S_1(B) \,\,\text{ or}\,\, \\ \lfloor \frac{S_3(A)}{\alpha } \rfloor = \lfloor \frac{S_3(B)}{\alpha } \rfloor \,\,\text{ and}\,\, \lambda _1(A)/S_1(A) = \lambda _1(B)/S_1(B) \,\,\text{ and}\,\, S_1(A) \le S_1(B) \\ \end{array} \right. \end{aligned}$$

where \(\lfloor x \rfloor \) maps to the largest integer not greater than \(x\) and where the value of parameter \(\alpha \) allows controlling the degree of quantization of the first condition. For this example, the ellipsoids are roughly compared by their volume, and ellipsoid of similar volume are then compared according to their main eccentricities.

Fig. 1.2
figure 2

a Set \(\mathfrak A \) of \(N=10\)\(\mathrm {PDS}(2)\) matrices. b Supremum (in red) and infimum (in magenta) using the product order of matrices \(\le _{marg}\) (componentwise processing); the marginal mean of the matrices is also given in green. c Supremum (in red) and infimum (in magenta) using the lexicographic total ordering \(\le _{lex}^{0}\), which is input-preserving

We can consider the main properties of the lexicographic-based total orderings.

proposition 2

Lexicographic total orderings based on tensor invariants, completed with distance to a reference \(R_{0}\), have the following properties.

  • The associated supremum and infimum involve dilation and erosion operators in the sense that the dilation (erosion) commutes with the supremum (infimum) and that the dilation/erosion forms an adjunction.

  • Since the sumpremum and infimum are input preserving, the dilation and erosion produce symmetric positive definite matrices.

  • Dilation and erosion are rotationally invariant if the reference \(R_{0}\) follows the same rotation as the image values.

  • More generally, dilation and erosion are invariant to any contrast mapping of the matrix image, that is, to any transformation which modifies the eigenvalues values in such a way that ordering is preserved.

The proofs are relatively straightforward. We can said as conclusion that these orderings yield a totally ordered complete lattice over \(\mathrm {PDS}(n)\) which is compatible with the general formulation of dilation/erosion and which have good properties of invariance.

2.3 Lexicographic Total Orderings Based on Prior Sets \((\mathfrak B , \mathfrak F )\)

In scalar morphology, the “foreground” is associated to the maximal intensity value \(\top \) (i.e., white) and the “background” to the minimal intensity value \(\bot \) (i.e., black). The supremum brings towards \(\top \) and the infimum towards \(\bot \). Using this viewpoint we have recently formulated a general notion of ordering in vector spaces [39] by fixing the references \(\top \), \(\bot \) and using a supervised learning algorithm. This approach can be naturally extended to non Euclidean spaces such as \(\mathrm {PDS}(n)\).

Let us consider a training set of \(I\) matrices associated to the “foreground” \(\mathfrak F = \{ F_i \}_{i=1}^{I} \) and a training set of \(J\) matrices associated to the “background” \(\mathfrak B = \{ B_i \}_{i=1}^{J}\). Let

$$\begin{aligned} h_{(\mathfrak B , \mathfrak F )} : \mathrm {PDS}(n) \rightarrow \mathbb R \end{aligned}$$

be a surjective mapping, such that for any \(A \in \mathrm {PDS}(n)\) we have

$$\begin{aligned} h_{(\mathfrak B , \mathfrak F )} (A) = \left(\sum _{i=1}^{I}K(F_i,A) \right) - \left(\sum _{j=1}^{J}K(B_i,A) \right), \end{aligned}$$
(1.6)

where the kernel function \(K(\cdot ,\cdot )\) is a mapping

$$\begin{aligned} K(R,A) : \mathrm {PDS}(n)\times \mathrm {PDS}(n) \rightarrow \mathbb R ^{+}\cup \{ 0 \} \end{aligned}$$

Typically, we can consider for instance a radial basis function as kernel

$$\begin{aligned} K_{\alpha }(R,A) = e^{- \frac{d(R,A)^2}{\alpha }}, \end{aligned}$$
(1.7)

where \(d(R,A)\) is a distance between the \(\mathrm {PDS}(n)\) matrices \(R\) and \(A\).

Once again, the mapping \(h_{(\mathfrak B , \mathfrak F )} (\cdot )\) only involves a preorder on the space \(\mathrm {PDS}(n)\) since two unequal matrices can be mapped on the same real value. The idea to have a complete totally ordered set, i.e., a chain from \(\top \) to \(\bot \), consists in associating any lexicographic cascade after the computation of the \(h\)-mapping.

Definition 3

The lexicographic-completed \(( \mathfrak B , \mathfrak F )\)-supervised ordering for any pair of matrices \(A\) and \(C\) is given by

$$\begin{aligned} \begin{array}{c} A \le _{sup}^{( \mathfrak B , \mathfrak F )} C \Leftrightarrow \\ \left\{ \begin{array}{l} h_{(\mathfrak B , \mathfrak F )} (A) \le h_{(\mathfrak B , \mathfrak F )} (C) \,\,\text{ or}\,\,\\ h_{(\mathfrak B , \mathfrak F )} (A) = h_{(\mathfrak B , \mathfrak F )} (C) \,\,\text{ and}\,\, \left\{ \text{ Lexicographic} \text{ cascade} \text{ of} \text{ tensor} \text{ invariants} \right\} \\ \end{array} \right. \\ \end{array} \end{aligned}$$

In practice, we remark that the main ingredient of this kind of approach is the distance between the pair of matrices \(d(R,A)\). Many distance and dissimilarity measures have proposed in the literature for the case of DT-MR [31]. We consider that the most useful distances are those which are intrinsically adapted to the geometry of the space \(\mathrm {PDS}(n)\):

  • Riemannian distance. The set of \(n\times n\) positive matrices is a differentiable manifold with a natural Riemannian structure (see [11] for a deeper understanding). By integration of its metric over their shortest path on the manifold, given in next section, it is obtained the Riemannian distance for two square positive matrices:

    $$\begin{aligned} d_{Rie}(R,A)= \left| \log \left( R^{-1/2}AR^{-1/2} \right) \right| _{F} = \left( \sum _{i=1}^{N} \log ^2 \lambda _i(R^{-1}A) \right)^{1/2}. \end{aligned}$$
    (1.8)

    This distance is also known as affine-invariant since it is invariant to affine transformation [28].

  • Log-Euclidean distance. This notion proposed by [6] coincides with the usual Euclidean (arithmetic) mean in the domain of matrix logarithms:

    $$\begin{aligned} d_{LE}(R,A)= \sqrt{ \text{ tr}\left( \log (R) - \log (A) \right)^2 }. \end{aligned}$$
    (1.9)

    We remind that the matrix logarithm \(\log (M)\) is defined as the inverse of the matrix exponential \(\exp (M) = \sum _{k=0}^{+\infty } M^{k}/k!\). One should note that for general matrices, neither the uniqueness nor the existence of a logarithm is guaranteed for a given invertible matrix [17]. However, the logarithm of a \(\mathrm {PDS}(n)\) matrix is well defined and is a symmetric matrix. Distance \(d_{LE}(R,A)\) is defined by a Riemannian point of view of a particular vector space structure. Log-Euclidean distance satisfies a number of invariance properties [6]: distance is not changed by inversion (since the inverse of matrices only results in the multiplication by \(-1\) of their logarithms); distance are by construction invariant with respect to any logarithm multiplication (i.e., invariance to any translation in the domain of logarithms); distance is invariant to orthogonal transformation and scaling (but not to any general affine transformation).

Finally, concerning the properties of these total orderings, besides the ones which hold for any total ordering, the invariance properties will depend on the invariance of the chosen distance metric as well as how the training set of matrices \((\mathfrak B , \mathfrak F )\) are selected.

3 Partial Spectral Ordering for PDS Matrices and Inverse Eigenvalue Problem

In this section, we continue to use the spectral decomposition of \(\mathrm {PDS}(n)\) matrices. We start by introducing the spectral product partial ordering \(\le _{sp}\) as follows.

Definition 4

Let \(A\) and \(B\) be two \(\mathrm {PDS}(n)\) matrices. We say that \(A \le _{sp} B\) if the ordered sequence of the eigenvalues of \(A\) (\(\lambda _1(A)\ge \) \(\cdots \) \(\ge \lambda _n(A)\ge 0\)) is lexicographically smaller or equal to the corresponding sequence of eigenvalues of \(B\), (\(\lambda _1(B)\ge \) \(\cdots \) \(\ge \lambda _n(B)\ge 0\)), i.e., \(\lambda _j(A) \le \lambda _j(B)\), \(\forall j=1,\cdots ,n\).

The product ordering \(\le _{sp}\) of eigenvalues does not be confused with their lexicographic ordering \(\le _{lex}^{0}\). In any case, as we have previously discussed, it is easy to see that \(\le _{sp}\) is only a preorder over \(\mathrm {PDS}(n)\): the orientation information represented by the eigenvectors is totally ignored (i.e., it does not allow to distinguish between a matrix and rotated version of it).

By using the spectral partial ordering \(\le _{sp}\), the spectral supremum and infimum of a family of matrices \(\mathfrak A = \{ A_i \}_{i=1}^{N}\) are respectively the matrices

$$\begin{aligned} A_{\vee }^{sp} = \sup _{sp}\left( \mathfrak A \right) = V_{\vee } \Lambda _{\vee } V_{\vee }^{\text{ T}}, \end{aligned}$$
(1.10)
$$\begin{aligned} A_{\wedge }^{sp} = \inf _{sp}\left( \mathfrak A \right) = V_{\wedge } \Lambda _{\wedge } V_{\wedge }^{\text{ T}}, \end{aligned}$$
(1.11)

where the diagonal matrices of the supremum and the infimum are

$$\begin{aligned} \Lambda _{\vee } = \text{ diag}\left( \bigvee _{i} \lambda _1(A_i), \cdots , \bigvee _{i} \lambda _n(A_i) \right), \end{aligned}$$
(1.12)

and

$$\begin{aligned} \Lambda _{\wedge } = \text{ diag}\left( \bigwedge _{i} \lambda _1(A_i), \cdots , \bigwedge _{i} \lambda _n(A_i) \right), \end{aligned}$$
(1.13)

that is, they are obtained as the marginal supremum and infimum of eigenvalues.

Obviously, the question is how to define now supremum/infimum orthogonal basis \(V_{\vee }\) and \(V_{\wedge }\), which can be interpreted as solving an “inverse eigenvalue problem”. In fact, this way of decoupling the shape of the ellipsoids and its orientation have used for instance in [12, 13] for the computation of the distances or geometric means of (fixed) low rank matrices. More precisely, it can be view as a mapping from \(\mathrm {PDS}(n)\) onto the product space \(\mathbb R ^n \times SO(n)\), where the supremum/infimum on \(\mathrm {PDS}(n)\) is obtained by an operation on \(\mathbb R ^n\) (the vector space of the eigenvalues) which is simply the marginal vector supremum/infimum and an operation on the space of the eigenvectors \(SO(n)\).

We can already remark that in such a case, the supremum/infimum on \(\mathrm {PDS}(n)\) are not induced by a partial ordering on this space and consequently the operators obtained will not be strictly morphological dilation/erosion.

3.1 Spectral Sup/Inf on Geometric Mean Basis

A first alternative is to associate to both \(V_{\vee }\) and \(V_{\wedge }\) the orthogonal basis of \(A_{\mu }\), the matrix mean of \(\mathfrak A \).

There are different alternatives which have been considered in the literature for computing means of symmetric positive definite matrices [6, 12, 28]. The geometric mean obtained from the Riemannian framework is without any doubt the most interesting. Let us recall the basic elements which can be found in [11]. The Riemannian metric for a matrix \(A\) in the manifold \(\mathrm {PDS}(n)\) is given by the differential

$$\begin{aligned} ds = \left( \mathrm {tr}(A^{-1}dA \right)^{1/2}. \end{aligned}$$
(1.14)

The (unique) geodesic between two matrices \(A, B \in \mathrm{PDS}(n)\) has a parametrization:

$$\begin{aligned} \gamma (t) = A^{1/2}e^{t \log \left( A^{-1/2} B A^{-1/2} \right)}A^{1/2} = A^{1/2}\left( A^{-1/2} B A^{-1/2} \right)^{t} A^{1/2}, \end{aligned}$$
(1.15)

with \(t\in [0,1]\), where \(\gamma (0)= A\) and \(\gamma (1)=B\). The Riemannian mean between \(A\) and \(B\) is defined as

$$\begin{aligned} A \circ B = \gamma (1/2) = A^{1/2}\left( A^{-1/2} B A^{-1/2} \right)^{1/2} A^{1/2}, \end{aligned}$$
(1.16)

which corresponds to the geometric mean of the matrices, i.e., a symmetrized version of \((A B)^{1/2}\).

The extension of the geometric mean computation of more than two matrices is solved using the notion of Riemannian center, known as Karcher-Frechet barycenter [20, 24]. A fast and efficient algorithm proposed by F. Barbaresco [39, 40] is summarized as follows.

Definition 5

For a set of matrices \(\mathfrak A = \{ A_i \}_{i=1}^{N}\), the Karcher-Frechet barycenter is computed as \(A_{\mu }(\mathfrak A ) = X_{k+1}\) such that

$$\begin{aligned} X_{k+1} = X_{k}^{1/2} e^{\epsilon \sum _{i=1}^{N} \log \left( X_{k}^{-1/2} A_{i} X_{k}^{-1/2} \right)} X_{k}^{1/2}, \end{aligned}$$
(1.17)

where \(\epsilon > 0\) is the step parameter of the gradient descent.

For robustness purposes, it is probably more appropriate to consider the notion of Riemannian median [46, 5].

In summary, the algorithm for supremum matrix \(A_{\vee }^{sp}\):

  1. 1.

    Compute marginal supremum of eigenvalues: \(\Lambda _{\vee } = \text{ diag}\left( \bigvee _{i} \lambda _1(A_i), \cdots , \bigvee _{i}\right.\) \(\left. \lambda _n (A_i) \right)\)

  2. 2.

    Compute Karcher-Frechet barycenter: \(A_{\mu } = V_{\mu } \Lambda _{\mu } V_{\mu }^{\text{ T}}\)

  3. 3.

    Compute inverse spectral matrix: \(A_{\vee }^{sp} = V_{\mu } \Lambda _{\vee } V_{\mu }^{\text{ T}}\)

Mutatis mutandis \(\vee \) by \(\wedge \), a similar algorithm is defined for the matrix infimum \(A_{\wedge }^{sp}\).

In Fig. 1.3 is given an example of the supremum/infimum obtained for a set of \(10\) \(\mathrm {PDS}(2)\) matrices: the geometric mean, the supremum and the infimum are ellipsoids with same orientation.

\(A_{\vee }^{sp}\) and \(A_{\wedge }^{sp}\) inherit the properties of the Karcher-Frechet barycenter. This question will be considered in ongoing work. In any case, we insist again that \(A_{\vee }^{sp}\) and \(A_{\wedge }^{sp}\) do not produce dilation/erosion operators since they do not commute with supremum/infimum, i.e., given two sets of \(\mathrm {PDS}(n)\) matrices \(\mathfrak A = \{ A_i \}_{i=1}^{N} \) and \(\mathfrak B = \{ B_j \}_{j=1}^{M}\) and let \(\mathfrak C = \mathfrak A \cup \mathfrak B =\)\(\{ A_i \}_{i=1}^{N} \cup \{ B_j \}_{j=1}^{M}\), we have

$$ A_{\vee }^{sp} \bigvee ^{sp} B_{\vee }^{sp} \ne C_{\vee }^{sp} $$

This is due to the fact that Karcher-Frechet barycenter is not associative, i.e., \(A_{\mu }\circ B_{\mu } \ne C_{\mu }\).

Fig. 1.3
figure 3

a Set \(\mathfrak A \) of \(N=10\)\(\mathrm {PDS}(2)\) matrices. b spectral sup/inf on geometric mean basis (Karcher-Frechet barycenter computed with parameters \(k=20\) and \(\epsilon = 0.1\)). c spectral sup/inf on optimized basis. The supremum appears in red, the infimum in magenta and the Karcher-Frechet in green

3.2 Spectral Sup/Inf on Optimized Basis

To complete this section, let us to mention briefly an alternative to tackle the problem of defining the orthogonal basis of the supremum/infimum.

This approach relies on the idea that the largest eigenvalue and corresponding eigenvector should naturally adopted for the matrix \(A_{\vee }^{sp}\). Clearly, in the case of \(\mathrm {PDS}(2)\), the eigenvector basis \(V_{\vee }\) is already determined. For general \(\mathrm {PDS}(n)\), the second eigenvector of \(A_{\vee }^{sp}\) can be computed from the given set of matrices by finding the vector lying in the subspace orthogonal to the first eigenvector which is as closer as possible to eigenvector of largest second eigenvalue; and then similarly for the other eigenvectors. Formally, the algorithm to compute the orthogonal basis of supremum: \(V_{\vee } = \left( \overrightarrow{v}_{1}^{\vee }, \cdots , \overrightarrow{v}_{n}^{\vee } \right)\) is given as follows.

  1. 1.

    \(\overrightarrow{v}_{1}^{\vee } = \overrightarrow{v}_{1}(A_k)\) such that \(\lambda _1(A_k) = \bigvee _{i} \lambda _1(A_i)\);

  2. 2.

    \(\overrightarrow{v}_{2}^{\vee } = \overrightarrow{v}\), where \(\overrightarrow{v}\) minimizes \(\Vert \overrightarrow{v}_{2}(A_k) - \overrightarrow{v} \Vert _{2}\) subject to \(\overrightarrow{v}_{1}^{\vee } \bot \overrightarrow{v}\), such that \(\lambda _2(A_k) = \bigvee _{i} \lambda _2(A_i)\);

  3. 3.

    \(\overrightarrow{v}_{n-1}^{\vee } = \overrightarrow{v}\), where \(\overrightarrow{v}\) minimizes \(\Vert \overrightarrow{v}_{3}(A_k) - \overrightarrow{v} \Vert _{2}\) subject to \(\overrightarrow{v}_{1}^{\vee } \bot \overrightarrow{v}_{2}^{\vee } \bot \overrightarrow{v}\), such that \(\lambda _{n-1}(A_k) = \bigvee _{i} \lambda _{n-1}(A_i)\).

  4. 4.

    \(\overrightarrow{v}_{n}^{\vee } = \overrightarrow{v}\) such that \(\overrightarrow{v}_{1}^{\vee } \bot \overrightarrow{v}_{2}^{\vee }\bot \cdots \)\(\bot \overrightarrow{v}_{n-1} \bot \overrightarrow{v}\)

Mutatis mutandis \(\vee \) by \(\wedge \), a similar algorithm is defined for the matrix infimum \(A_{\wedge }^{sp}\).

An efficient implementation of this algorithm is still an open question, and more important, the properties (existence and uniqueness) of a such orthogonal basis should be also studied in ongoing work.

4 Asymptotic Nonlinear Averaging Using Counter-Harmonic Mean for PDS Matrices

We change now our framework and we propose to explore the definition of the supremum/infimum as the asymptotic values of a particular mean which is extended to \(\mathrm {PDS}(n)\) matrices.

4.1 Counter-Harmonic Mean

The counter-harmonic mean (CHM) belongs to the family of the power means [14]. More precisely, the CHM is defined as follows.

Definition 6

Let \(\mathbf a = (a_1,a_2,\cdots , a_n)\) and \(\mathbf w = (w_1,w_2,\cdots , w_n)\) be real \(n-\)tuples, i.e., \(\mathbf a ,\mathbf w \in \mathbb R ^n\). If \(P\in \overline{\mathbb R }\) then the \(P-\)th counter-harmonic mean of \(\mathbf a \) with weight \(\mathbf w \) is given by [14]

$$\begin{aligned} \kappa ^{P}(\mathbf a ;\mathbf w ) = \left\{ \begin{array}{lll} \frac{\sum _{i=1}^{n}w_{i} a_{i}^{P+1}}{\sum _{i=1}^{n}w_{i} a_{i}^{P}}&\text{ if}&P\in \mathbb R \\ \\ \max (a_{i})&\text{ if}&P=+\infty \\ \min (a_{i})&\text{ if}&P=-\infty \end{array} \right. \end{aligned}$$
(1.18)

It will be denoted \(\kappa ^{P}(\mathbf a )\) the equal weight case. We notice that \(\kappa ^{0}(\mathbf a ;\mathbf w )\) is the weighted arithmetic mean and \(\kappa ^{-1}(\mathbf a ;\mathbf w )\) is the weighted harmonic mean.

Used in image processing as a filter, CHM is well suited for reducing the effect of pepper noise for \(P>0\) and of salt noise for \(P<0\) [21]. It is easy to see that for \(P \gg 0\) (\(P \ll 0\)) the pixels with largest (smallest) values in the local neighborhood will dominate the result of the weighted sum. Of course, in practice, the range of \(P\) is limited due to the precision in the computation of the floating point operations. In the pioneering paper [38], starting from the natural observation that morphological dilation and erosion are the limit cases of the CHM, it was proposed to use the CHM to calculate robust nonlinear operators which approach the morphological ones but without using \(\max \) and \(\min \) operators. In addition, these operators are more robust to outliers (i.e., to noise) and consequently it can be considered as an alternative to rank-based filters in the implementation of pseudo-morphological operators. In our recent study [3] we have also considered empirically how both means converge to the supremum (resp. infimum) when positive \(P\) increases (negative \(P\) decreases). But let us examine also two properties which are useful to understand the practical interest of the CHM filter.

proposition 3

If \(0\le P \le +\infty \) then \(\kappa ^{P}(\mathbf a ) \ge \nu ^{P}(\mathbf a )\); and if \(-\infty \le P \le 0\) then the following stronger results holds: \(\kappa ^{P}(\mathbf a ) \le \nu ^{P-1}(\mathbf a )\); where \(\nu ^{P}(\mathbf a ) = \left( \sum _{i=1}^{n} a_i^{P} \right)^{1/P}\) is the \(P-\)th power-mean filter, or Minkowski mean of order \(P\), defined for \(P\in \mathbb R ^{*}\). Inequalities are strict unless \(P=0\), \(+\infty \), \(-\infty \) or if \(\mathbf a \) is constant.

proposition 4

If \(-\infty \le P \le Q \le +\infty \) then \(\kappa ^{P}(f) \le \kappa ^{Q}(f) \), with equality if and only if \(\mathbf a \) is constant.

Proofs of Propositions 3 and 4 as well as other properties can be found in [14]. Proposition 3 justifies theoretically the suitability of CHM with respect to the alternative approach by high-order Minkowski mean, as considered by Welk [44], in order to propose a nonlinearization of averaging-based filters. We notice that according to Proposition 3, the convergence to the erosion with \(P \ll 0\) is faster than to the dilation with equivalent \(P \gg 0\), i.e., for \(P>0\)

$$\begin{aligned} | \kappa ^{P}({\mathbf a }) - \bigvee _{i} a_i | \ge | \kappa ^{-P}({\mathbf a }) - \bigwedge _{i} a_i | \end{aligned}$$

This asymmetry involves that \(\kappa ^{P}(\mathbf a )\) and \(\kappa _{B}^{-P}(\mathbf a )\) are not dual operators with respect to the complement, i.e., for \(P>0\)

$$\begin{aligned} \kappa ^{P}(\mathbf a ) \ne \kappa ^{-P}(\complement \mathbf a ) \end{aligned}$$

with \(\complement \mathbf a = - \mathbf a =\) \((-a_1,-a_2,\cdots , -a_n)\).

4.2 Counter-Harmonic Mean for PDS Matrices

We propose a straightforward generalization of CHM for \(\mathrm {PDS}(n)\) matrices.

Definition 7

Given \(\mathfrak A = \{ A_i \}_{i=1}^{N} \), a finite set of \(N\) matrices, where \(A_i\in \mathrm {PDS}(n)\), the counter-harmonic matrix mean (CHMM) of order P is defined by

$$\begin{aligned} \kappa ^{P}\left( \mathfrak A \right) = \left( \sum _{i=1}^{N} A_{i}^{P} \right)^{-1/2} \left( \sum _{i=1}^{N} A_{i}^{P+1} \right) \left( \sum _{i=1}^{N} A_{i}^{P} \right)^{-1/2} \end{aligned}$$
(1.19)

In order to understand the interest of the CHMM, we can study its behavior with respect to \(P\) for a numerical example. Let us consider two \(\mathrm {PDS}(2)\) matrices:

$$\begin{aligned} A_{1} = \left( \begin{array}{cc} 3&2 \\ 2&3 \\ \end{array} \right), \, \Lambda (A_{1}) = \text{ diag}\left( 5, 1 \right) \,\,\, ; \,\,\, A_{2} = \left( \begin{array}{cc} 2&-1 \\ -1&2 \\ \end{array} \right), \, \Lambda (A_{2}) = \text{ diag}\left( 3, 1 \right). \end{aligned}$$

We calculate the value of their CHMM for different positive/negative values of \(P\), i.e., \(\kappa ^{P}\left( A_1, A_2 \right)\), and the diagonal matrix of the corresponding matrix, i.e., \(\Lambda \left( \kappa ^{P}( A_1, A_2 ) \right)\), to obtain the results given in Table 1.1.

Table 1.1 Values of CHMM for different positive/negative values of \(P\): \(\kappa ^{P}\left( A_1, A_2 \right)\) and \(\Lambda \left( \kappa ^{P}( A_1, A_2 ) \right)\), from two matrices (see text)

We observe that for both positive and negative values of \(P\) a monotonous convergence to a pair of matrices is achieved. In particular, we remark that for this example, the limit in both cases is reached for \(P=10\), i.e.,

$$\begin{aligned} \kappa ^{10}\left( A_1, A_2 \right) = \left( \begin{array}{cc} 4&1 \\ 1&4 \\ \end{array} \right), \,\,\, \text{ and} \,\,\, \kappa ^{-10}\left( A_1, A_2 \right) = \left( \begin{array}{cc} 1&0 \\ 0&1 \\ \end{array} \right), \end{aligned}$$

which is a reasonable value from a numerical viewpoint for the order \(P\) of the CHMM. In fact, we can compare these estimations with those obtained by the Minkowski matrix mean of order \(P\), which can be naturally defined as

$$\begin{aligned} \nu ^{P}\left( \mathfrak A \right) =\left( \sum _{i=1}^{N} A_{i}^{P} \right)^{1/P}. \end{aligned}$$

For the current example, it is obtained

$$\begin{aligned} \nu ^{10}\left( A_1, A_2 \right) = \left( \begin{array}{cc} 4.70&1.17 \\ 1.17&4.70 \\ \end{array} \right), \,\,\, \text{ and} \,\,\, \nu ^{-10}\left( A_1, A_2 \right) = \left( \begin{array}{cc} 0.85&0.00 \\ 0.00&0.85 \\ \end{array} \right), \end{aligned}$$

which is coherent with the theoretical results known for scalar values (see Proposition 3), in the sense that the convergence to the maximum/minimum with respect to \(P\) is faster (and numerically more stable) for the CHMM than for the Minkowski power mean extended to matrices.

Consequently, we can use the asymptotic values of the CHMM with \(P\rightarrow +\infty \) and \(P\rightarrow -\infty \) to define approximations to the supremum and infimum of a set of matrices.

Definition 8

The supremum and the infimum of a set \(\mathfrak A = \{ A_i \}_{i=1}^{N} \) of \(\mathrm {PDS}(n)\) matrices are defined respectively as

$$\begin{aligned} A_{\vee }^{chmm}= \sup ^{chmm}\left( \mathfrak A \right) = \lim _{P\rightarrow +\infty } \kappa ^{P}\left( \mathfrak A \right), \end{aligned}$$
(1.20)

and

$$\begin{aligned} A_{\wedge }^{chmm}= \inf ^{chmm}\left( \mathfrak A \right) = \lim _{P\rightarrow -\infty } \kappa ^{P}\left( \mathfrak A \right).\end{aligned}$$
(1.21)

Figure 1.4 depicts an example of the supremum/infimum obtained for a set \(\mathfrak A \) of 3 \(\mathrm {PDS}(2)\) matrices using the CHMM paradigm. More precisely, the values of \(\kappa ^{P}\left( \mathfrak A \right)\) for six different orders are given (\(P=5\),\(P=10\),\(P=20\),\(P=-5\),\(P=-10\),\(P=-20\)); which can be compared again with the results obtained using Minkowski matrix mean. It is evident the matrices \(A_{\vee }^{chmm}\) and \(A_{\wedge }^{chmm}\) can be interpreted geometrically similarly to the supremum/infimum associated to the Löwner ordering: \(A_{\vee }^{chmm}\) “tends to be” the smallest ellipsoid enclosing the ellipsoids of \(\mathfrak A \) and \(A_{\wedge }^{chmm}\) “tends to be” the largest ellipsoid which is contained in all the ellipsoids. If we observe an additional example given in Fig. 1.6a is clear that when the number of matrices is larger, and their orthogonal basis are very different, the CHMM produces only a rough approximation to the max/min Löwner ellipsoids.

A more deeper study is required to better characterize the behavior of the CHMM for matrices of higher order than \(n>2\) as well as the numerical stability with respect to matrices which become ill-conditioned with the power \(P\) (note that matrix inversion is involved in \(\left( \sum _{i=1}^{N} A_{i}^{P} \right)^{-1/2}\)). In any case, there is already some interesting properties to be stated.

Fig. 1.4
figure 4

a Set \(\mathfrak A \) of \(N=3\)\(\mathrm {PDS}(2)\) matrices. b Counter-harmonic matrix mean for various values of \(P\) (red color for positive value of \(P\), magenta color for negative values of \(P\)). c Minkowski matrix mean of order \(P\) (red color for positive value of \(P\), magenta color for negative values of \(P\))

proposition 5

Given a set \(\mathfrak A \) of \(PDS(n)\) matrices, the following properties hold.

(i) CHMM of \(\mathfrak A \) is a rotationally invariant operation for any value of \(P\) (including \(P\rightarrow \pm \infty \)).

(ii) CHMM of \(\mathfrak A \) is for any value of \(P\) (including \(P\rightarrow \pm \infty \)) invariant to scaling transformations, i.e., multiplication by a real constant \(\alpha \in \mathbb R \).

(iii) CHMM of \(\mathfrak A \) produces a symmetric positive definite matrix for any value of \(P\) (including \(P\rightarrow \pm \infty \)).

(iv) The operators \(\sup ^{chmm} (\mathfrak A )\) and \(\inf ^{chmm} (\mathfrak A )\) do not yield dilation and erosion operators over \(PDS(n)\).

Proof

(i) Let us consider that the rotation is given by the matrix \(O \in SO(n)\). We know from linear algebra that the \(P-\)th power \(A^P\) of a diagonalized matrix is achieved by taking the \(P-\)th power of the eigenvalues:

$$\begin{aligned} A^P = V \text{ diag}\left( (\lambda _1(A_i))^P, \cdots , (\lambda _n(A_i))^P \right) V^{\text{ T}}. \end{aligned}$$

On the other hand, since \(\sum _{i=1}^{N} A_{i}^{P}\) is positive definite, there exists an orthogonal matrix \(V_P\) and a diagonal matrix \(\Lambda _P\) such that \(\sum _{i=1}^{N} A_{i}^{P}=\) \(V_P \Lambda _P V_{P}^{\text{ T}}\). Hence, if we apply the rotation, we have

$$\begin{aligned} \left( \sum _{i=1}^{N} (O A_{i} O^{\text{ T}})^{P} \right)^{-1/2} \left( \sum _{i=1}^{N} (O A_{i} O^{\text{ T}})^{P+1} \right) \left( \sum _{i=1}^{N} (O A_{i} O^{\text{ T}})^{P} \right)^{-1/2}= \end{aligned}$$
$$\begin{aligned} \left( \sum _{i=1}^{N} O A_{i}^{P} O^{\text{ T}} \right)^{-1/2} \left( \sum _{i=1}^{N} O A_{i}^{P+1} O^{\text{ T}} \right) \left( \sum _{i=1}^{N} O A_{i}^{P} O^{\text{ T}} \right)^{-1/2}= \end{aligned}$$
$$\begin{aligned} \left( O \left( \sum _{i=1}^{N} A_{i}^{P} \right) O^{\text{ T}} \right)^{-1/2} \left( O \left( \sum _{i=1}^{N} A_{i}^{P+1} \right) O^{\text{ T}} \right) \left( O \left(\sum _{i=1}^{N} \right) A_{i}^{P} O^{\text{ T}} \right)^{-1/2}= \end{aligned}$$
$$\begin{aligned} \left( O V_P \Lambda _P V_{P}^{\text{ T}} O^{\text{ T}} \right)^{-1/2} \left( O V_{P+1} \Lambda _{P+1} V_{P+1}^{\text{ T}} O^{\text{ T}} \right) \left( O V_P \Lambda _P V_{P}^{\text{ T}} O^{\text{ T}} \right)^{-1/2} \end{aligned}$$

Considering the fact that \(O O^{\text{ T}}= I\) and that \(O V_P \in SO(3)\), we can write

$$\begin{aligned} O \left( \sum _{i=1}^{N} A_{i}^{P} \right)^{-1/2} \left( \sum _{i=1}^{N} A_{i}^{P+1} \right) \left( \sum _{i=1}^{N} A_{i}^{P} \right)^{-1/2} O^{\text{ T}} \end{aligned}$$

and consequently

$$\begin{aligned} \kappa ^{P}\left( \{ O A_i \}_{i=1}^{N} O^{\text{ T}} \right) = O \kappa ^{P}\left( \{ A_i \}_{i=1}^{N} \right) O^{\text{ T}} \end{aligned}$$

(ii) By considering scaling by parameter \(\alpha \in \mathbb R \), \(\alpha \ne 0\), we have

$$\begin{aligned} \kappa ^{P}\left( \{ \alpha A_i \}_{i=1}^{N} \right) = \left( \sum _{i=1}^{N} (\alpha A_{i})^{P} \right)^{-1/2} \left( \sum _{i=1}^{N} (\alpha A_{i})^{P+1} \right) \left( \sum _{i=1}^{N} (\alpha A_{i})^{P} \right)^{-1/2}= \end{aligned}$$
$$\begin{aligned} \alpha ^{-P/2} \left( \sum _{i=1}^{N} A_{i}^{P} \right)^{-1/2} \alpha ^{P+1} \left( \sum _{i=1}^{N} A_{i}^{P+1} \right) \alpha ^{-P/2} \left( \sum _{i=1}^{N} A_{i}^{P} \right)^{-1/2}= \end{aligned}$$
$$\begin{aligned} \alpha ^{-P/2}\alpha ^{P+1}\alpha ^{-P/2} \left( \sum _{i=1}^{N} A_{i}^{P} \right)^{-1/2} \left( \sum _{i=1}^{N} A_{i}^{P+1} \right) \left( \sum _{i=1}^{N} A_{i}^{P} \right)^{-1/2}= \alpha \kappa ^{P}\left( \{ A_i \}_{i=1}^{N} \right) \end{aligned}$$

(iii) By construction, the \(P-\)th power \(A^P\) and the inverse square root \(A^{-1/2}\) have positive eigenvalues whenever \(A\) has. Similarly, the sum and the product of positive definite matrices preserves also the positiveness.

(iv) Let consider two sets of \(\mathrm {PDS}(n)\) matrices \(\mathfrak A = \{ A_i \}_{i=1}^{N} \) and \(\mathfrak A ^{\prime } = \{ A_j \}_{j=N+1}^{M}\).

Due to the fact that the counter-harmonic matrix mean is not associative, it cannot be ensured that there exist always a value of \(P\) such that

$$\begin{aligned} \lim _{P\rightarrow +\infty } \kappa ^{P}\left( \{ A_k \}_{k=1}^{M} \right) \end{aligned}$$

is equal to

$$\begin{aligned} \lim _{P\rightarrow +\infty } \kappa ^{P}\left( \lim _{P\rightarrow +\infty } \kappa ^{P}\left( \{ A_i \}_{i=1}^{N} \right), \lim _{P\rightarrow +\infty } \kappa ^{P}\left( \{ A_j \}_{j=N+1}^{M} \right) \right) \end{aligned}$$

and consequently the operators \(\sup ^{chmm} (\mathfrak A )\) do not commute with “supremum”. A similar result is observed for the erosion.

Finally, the counter-harmonic mean is only one of the possible nonlinear averaging procedures which can be used over \(\mathrm {PDS}(n)\).

We can, for instance, consider also the case of Log-Euclidean Fréchet mean for \(\mathrm {PDS}(n)\) matrices, introduced by [6] in the same Riemannian framework that the Log-Euclidean distance, see Sect. 1.2.2. Given a set of matrices \(\mathfrak A = \{ A_i \}_{i=1}^{N}\), it is defined as a direct generalization of the geometric mean of positive numbers and it is given explicitly by

$$\begin{aligned} \mathbb E _{LE}\left( \mathfrak A \right) = \exp \left( \frac{1}{N} \sum _{i=1}^{N} \log \left( A_{i} \right) \right) \end{aligned}$$
(1.22)

It should be noted that the logarithm for \(\mathrm {PDS}(n)\) is easily obtained as the logarithm of the diagonal matrix, i.e.,

$$\begin{aligned} \log \left(A \right) = V \text{ diag}\left( \log \left(\lambda _1(A)\right), \cdots , \log \left( \lambda _n(A_i)\right) \right) V^{\text{ T}}. \end{aligned}$$

This matrix mean can be used as inspiration to define the counter-harmonic Matrix Log-Euclidean Mean.

Definition 9

Given \(\mathfrak A = \{ A_i \}_{i=1}^{N} \), a finite set of \(N\) matrices, where \(A_i\in \mathrm {PDS}(n)\), the counter-harmonic matrix Log-Euclidean mean (CHMLogM) of order P is defined by

$$\begin{aligned} \kappa _{\log }^{P}\left( \mathfrak A \right) = \exp \left( \left(\sum _{i=1}^{N} \left( \log (A_i) \right)^{P}\right)^{-1/2} \left(\sum _{i=1}^{N} \left( \log (A_i) \right)^{P+1}\right) \left(\sum _{i=1}^{N} \left( \log (A_i) \right)^{P}\right)^{-1/2} \right) \end{aligned}$$
(1.23)

In Figs. 1.5 and 1.6b are given examples of \(\kappa _{\log }^{P}\left( \mathfrak A \right)\) for different values of \(P>0\). We observe that estimated values to the supremum for large values of \(P\) are relatively similar to the ones obtained from the CHMM. However, many open questions should studied in ongoing work about the counter-harmonic matrix Log-Euclidean mean, for instance, the operator for \(P<0\) does not produce useful results. In addition, it must explored if CHMLogM inherits the powerful invariance properties of Log-Euclidean mean.

Fig. 1.5
figure 5

a Set \(\mathfrak A \) of \(N=3\)\(\mathrm {PDS}(2)\) matrices. b Counter-harmonic matrix Log-Euclidean mean for various positive values of \(P\)

Fig. 1.6
figure 6

Given a set \(\mathfrak A \) of \(N=10\) \(\mathrm {PDS}(2)\) matrices: a counter-harmonic matrix mean for various values of \(P\) (red color for positive value of \(P\), magenta color for negative values of \(P\)); b counter-harmonic matrix Log-Euclidean mean for various positive values of \(P\)

5 Application to Nonlinear Filtering of Matrix-Valued Images

The different strategies of supremum and infimum of a set \(\mathfrak A = \{ A_i \}_{i=1}^{N} \) discussed in this study can straightforward be used to compute morphological operators on matrix-valued images. Hence, let \(f(\mathbf x )\in {\mathcal F}(E, \mathrm {PDS}(n))\) be a matrix-valued image to be processed. Figure 1.7a gives an example of such image for \(n=2\). This visualization of \(\mathrm {PDS}(2)\) images uses the functions developed by G. Peyré [32]. We notice that, in order to make easier the representation of their “shape”, all the ellipses have a normalized “size”; in fact, the original size given roughly by \(\lambda _1+\lambda _2\) is coded by their color using the cooper color map (which varies smoothly from black to bright copper). Figure 1.7b, c depicts precisely the images of \(S_1 = \lambda _1+\lambda _2\) and \(\lambda _1/ \lambda _2\). This image will be used to compare the various alternatives of morphological operators and to illustrate the interest of such operators.

The dilation and erosion of an image \(f(\mathbf x )\in {\mathcal F}(E, \mathrm {PDS}(n))\) by structuring element \(B\) according to supremum \(\vee ^{\Omega }\) and infimum \(\wedge ^{\Omega }\) are respectively given by

$$\begin{aligned} \delta _{B,\Omega }(f)(\mathbf x ) = \left\{ A_{\vee }: A_{\vee } = \bigvee ^{\Omega }_{\mathbf z } [f(\mathbf z )], \mathbf z \in B_{\mathbf x } \right\} . \end{aligned}$$
(1.24)
$$\begin{aligned} \varepsilon _{B,\Omega }(f)(\mathbf x ) = \left\{ A_{\wedge } : A_{\wedge } = \bigwedge ^{\Omega }_{\mathbf z } [f(\mathbf z )], \mathbf z \in \check{B}_{\mathbf x } \right\} . \end{aligned}$$
(1.25)

Considering for instance \(B\) equal to a square of \(3 \times 3\) pixels, four examples of the dilation \(\delta _{B,\Omega }(f)\) and the erosion \(\delta _{B,\Omega }(f)\) of the image test are given in Fig. 1.7d, e. It is compared in particular the supremum and the infimum defined by the lexicographic total ordering \(\le _{lex}^1\) (priority given to the energy then to the eccentricity), the lexicographic total ordering \(\le _{lex}^2\) (inverted priorities), the spectral sup/inf on geometric mean basis, and the asymptotic sup/inf using the counter-harmonic mean (with \(P= \pm 10\)). Effects of dilation/erosion operators are easily interpreted according to the underlying supremum/infimum. Dilation and erosion are the basic operators to define useful morphological filters. The two basic morphological filters, as products of adjunction \(\left(\delta _{B, \Omega }, \varepsilon _{B, \Omega } \right)\), are the opening \(\gamma _{B,\Omega }(f)=\delta _{B, \Omega }\left( \varepsilon _{B, \Omega }(f) \right)\) and the closing \(\varphi _{B, \Omega }(f)=\varepsilon _{B, \Omega }\left( \delta _{B, \Omega }(f) \right)\). Opening and closing and idempotent operators (stable under the iteration), i.e., \(\gamma _{B,\Omega }\left( \gamma _{B, \Omega }(f) \right) = \gamma _{B,\Omega }(f)\), the opening (closing) is an anti-extensive (extensive) operator; i.e., \(f \ge _{\Omega } \gamma _{B, \Omega }(f)\) and \(f\le _{\Omega } \varphi _{B, \Omega }(f)\). We will not insist again on the fact that these algebraic properties are only valid in case where the pair of dilation/erosion forms an adjunction. The geometrical meaning of the opening (closing) is to remove image structures of high (low) value, according to the ordering, which are thinner than the structuring element \(B\), the image structures larger than \(B\) preserve their values. Figure 1.7f, g give respectively the results of closings and openings of the test image.

Fig. 1.7
figure 7

Comparison of morphological operators for processing a \(\mathrm {PDS}(2)\) matrix-valued image: a original image \(f\) (\(16 \times 16\) pixels), b image of spectral energy \(S_1 = \lambda _1+\lambda _2\), c image of spectral eccentricity \(\lambda _1/ \lambda _2\), d- images of dilation \(\delta _{B,\Omega }(f)\), e- images of erosion \(\delta _{B,\Omega }(f-)\), f images of closing \(\varphi _{B,\Omega }(f)\), g- images of opening \(\gamma _{B,\Omega }(f)\). The supremum \(\bigvee _{\Omega }\) and infimum \(\bigwedge _{\Omega }\) for each column are: (-1) lexicographic total ordering \(\le _{lex}^1\) (priority given to the energy then to the eccentricity), (-2) lexicographic total ordering \(\le _{lex}^2\) (inverted priorities), (-3) spectral sup/inf on geometric mean basis, (-4) asymptotic sup/inf using the counter-harmonic mean (with \(P= \pm 10\)). The structuring element \(B\) is a square of \(3 \times 3\) pixels

Fig. 1.8
figure 8

Comparison of morphological filtering a \(\mathrm {PDS}(2)\) matrix-valued image: a original image \(f\) (\(16 \times 16\) pixels), b image of spectral energy \(S_1 = \lambda _1+\lambda _2\), c image of spectral eccentricity \(\lambda _1/ \lambda _2\), d- images of norm of morphological gradient \(\varrho _{B,\Omega }(f)\), e- images of morphological contrast \(\kappa _{B,\Omega }(f-)\), f images of positive top-hat \(\rho ^{+}_{B,\Omega }(f)\), g- images of closing followed by opening \(\gamma _{B,\Omega }(\varphi _{B,\Omega }(f))\). The supremum \(\bigvee _{\Omega }\) and infimum \(\bigwedge _{\Omega }\) for each column are: (-1) lexicographic total ordering \(\le _{lex}^1\) (priority given to the energy then to the eccentricity), (-2) lexicographic total ordering \(\le _{lex}^2\) (inverted priorities), (-3) spectral sup/inf on geometric mean basis, (-4) asymptotic sup/inf using the counter-harmonic mean (with \(P= \pm 10\)). The structuring element \(B\) is a square of \(3 \times 3\) pixels

The obtained results produce quite different \(\mathrm {PDS}(n)\) matrix-valued images, but at first sight we cannot say which one is better or which one is more robust since that will depend on the application. In order to complete this comparison, we propose to compute other morphological filters based on dilation/erosion. For instance, using the Riemannian distance for \(\mathrm {PDS}(n)\) matrices, as defined in Eq. (1.8), we can easily evaluates the norm of the morphological gradient as the image

$$\begin{aligned} \varrho _{B,\Omega }(f)(\mathbf x ) = d_{Rie}\left(\delta _{B,\Omega }(f) (\mathbf x ) , \varepsilon _{B,\Omega }(f) (\mathbf x ) \right). \end{aligned}$$

Figure 1.8d depicts the results for the four strategies of dilation/erosion, which can be interpreted with the help of the images (b) and (c) of spectral energy and spectral eccentricity. Obviously, the lexicographic approaches are more selective in terms of the contours detected in comparison with the spectral or the counter-harmonic cases which simultaneously deal with size/shape of ellipses. Using also the distance between the original pixel value and the result after the transformation, we can define the positive top-hat transformation as the residue between \(f\) and its opening, i.e.,

$$\begin{aligned} \rho ^{+}_{B,\Omega }(f)(\mathbf x ) = d_{Rie}\left( f (\mathbf x ) , \gamma _{B,\Omega }(f) (\mathbf x ) \right). \end{aligned}$$

A dual negative top-hat is defined by the residue between \(f\) and its closing. Positive top-hat yields greyscale images and is used to extract contrasted components of high with respect to the “background”, see the examples given in Fig. 1.8f.

The contrast mapping (also known as toggle mapping [36]) is a discrete shock filter [30] used to enhance the local contrast of an image by sharpening its edges. It is based on selecting at each pixel \(\mathbf x \) the output of the erosion or the dilation according to which is closer to the input value of the image at \(\mathbf x \). More precisely is defined as follows:

$$\begin{aligned} \begin{array}{l} \kappa _{B,\Omega }(f) (\mathbf x )= \left\{ \begin{array}{lll} \delta _{B,\Omega }(f) (\mathbf x )&\text{ if}&d_{Rie}\left( f(\mathbf x ), \delta _{B,\Omega }(f) (\mathbf x ) \right) < d_{Rie}\left( f(\mathbf x ), \varepsilon _{B,\Omega }(f) (\mathbf x ) \right) \\ \varepsilon _{B,\Omega }(f) (\mathbf x )&\text{ if}&d_{Rie}\left( f(\mathbf x ), \delta _{B,\Omega }(f) (\mathbf x ) \right) > d_{Rie}\left( f(\mathbf x ), \varepsilon _{B,\Omega }(f) (\mathbf x ) \right) \\ f (\mathbf x )&\text{ if}&d_{Rie}\left( f(\mathbf x ), \delta _{B,\Omega }(f) (\mathbf x ) \right) = d_{Rie}\left( f(\mathbf x ), \varepsilon _{B,\Omega }(f) (\mathbf x ) \right) \\ \end{array} \right. \\ \end{array} \end{aligned}$$

where the structuring element of the dilation/erosion is a unitary ball (i.e., a square of size \(3\times 3\) pixels). We observe from the examples of Fig. 1.8e that the transitions of the original image are enhanced in the four cases.

The last example of morphological filter that we provide in Fig. 1.8g is the results obtained as the combination of a closing followed by an opening, i.e.,

$$\begin{aligned} f \mapsto \gamma _{B,\Omega }(\varphi _{B,\Omega }(f)) \end{aligned}$$

which typically regularizes the image \(f\) and produce a simpler image where the main high structures are preserved. In a certain way, this operator is a kind of morphological denoising filter, obviously, according to the sup/inf proposed.

6 Conclusions and Perspectives

In this study we have extended fundamental concepts of supremum/infimum-based operators to the case \(\mathrm {PDS}(n)\) matrices. The goal was to explore various alternatives for the application mathematical morphology to case \(\mathrm {PDS}(n)\) matrix-valued image. We have illustrated with some comparative examples the interest of supremum/infimum operators for nonlinear filtering of these images.

We have shown that there is not a unique definition for the notion of supremum/infimum and the appropriateness of the one or the other approach depends on the required theoretical properties as well as the nature of the image data to be processed. In this respect, we can draw the following conclusions.

  • \(\mathrm {PDS}(n)\) endowed with total orderings using lexicographic cascades verifies all the algebraic properties of dilation and erosion and consequently match perfectly the theoretical framework of mathematical morphology. However, the input-preserving obtained operators are very sensitive to outliers and therefore, their application to noisy data will produce unstable results.

  • The principle of spectrally decoupling the shape and the orientation of the ellipsoid associated to each PDS matrix, with the computation of a marginal supremum/infimum for the eigenvalues and a geometric matrix mean for the orthogonal basis, seems particularly adapted to noisy data as well as to the computation of supremum/infimum with a large number of matrices: to choose only one of the them as result is a poor operation and to calculate the Löwner ellipsoids is of limited interest since it produces mainly quasi-spheres where the orientation information is loss. But of course, the theoretical properties of these operators are more limited.

  • Estimates of supremum/infimum using the CHMM is an efficient tool to approach the natural ordering over \(\mathrm {PDS}(n)\) (Löwner partial ordering) without using convex analysis-based algorithms for the computation of quasi- Löwner ellipsoids. By the way, the robustness against noise of CHMM involves that this approach is an interesting trade-off between the input-preserving total orderings and the strict Löwner partial ordering.

We have mentioned above in the document several points of our research which will be studied in deeper in ongoing work. Indeed, we would like to consolidate the study of the counter-harmonic paradigm: to use this paradigm for a nonlinearization of matrix PDE diffusion equations [42]; to introduce an appropriate stochastic algorithm for the computation of the counter-harmonic Karcher-Frechet barycenter. We would like to explore alternative ordering invariance properties in Riemannian manifold of \(\mathrm {PDS}(n)\) matrices which can be useful to be taken into account in the construction of supremum/infimum operators.

From a practical viewpoint, we consider to apply the methods and algorithms presented in this manuscript to matrix-valued images, in particular to process covariance matrices in radar applications.