Keywords

1 Introduction

Morphological operators are classically defined for real-valued functions supported on Euclidean or Riemannian spaces [1] and are used for nonlinear image processing. More recently, morphological semigroups for functions on length spaces have been studied [3], whose basic ingredients are the convolution in the \((\max ,+)\)-algebra (or supremal convolution), the metric distance and a convex shape function. More precisely, given a length space (Xd), a bounded function \(f : X \mapsto \mathbb {R}\) and an increasing convex one-dimensional (shape) function \(L: \mathbb {R}_{+}\rightarrow \mathbb {R}_{+}\) such that \(L(0)=0\), the multiscale dilation \(D_{L;\, t}f \) and erosion \(E_{L;\, t}f \) operators of f on (Xd) according to L at scale \(t>0\) are defined as

$$\begin{aligned} D_{L;\, t} f(x)= & {} \sup _{y \in X} \left\{ f(y) - t L\left( \frac{d(x,y)}{t} \right) \right\} , \quad \forall x\in X, \\ E_{L;\, t} f(x)= & {} \inf _{y \in X} \left\{ f(y) + t L\left( \frac{d(x,y)}{t} \right) \right\} , \quad \forall x\in X. \end{aligned}$$

A typical example of a shape function is \(L(q)= q^P/P\), \(P>1\), such that the canonical shape function corresponds to the case \(P=2\): \(L(d(x,y)/t)= d(x,y)^2/2t^2\). The corresponding semigroups are just: \(D_{L;\, t}D_{L;\, s}f = D_{L;\, t+s}f\) and \(E_{L;\, t}E_{L;\, s}f = E_{L;\, t+s}f\). These semigroups lead to powerful scale-space properties for multiscale filtering, regularization and feature extraction. The goal of this paper is to consider a similar generalization of morphological semigroups to the case of functions on ultrametric spaces.

An ultrametric space is a special kind of metric space in which the triangle inequality is replaced with the stronger condition \(d(x,z)\le \max \left\{ d(x,y),d(y,z)\right\} \). Several typical properties on the corresponding ultrametric balls are directly derived from this ultrametric triangle inequality, which lead to nested partitions of the space. Related to the latter property, every finite ultrametric space is known to admit a natural hierarchical description called a dendogram, also known as downward tree. Dendrograms represent a tree structure of the data, where the data points are the leaves of the tree and the vertical axis reveals the ordering of the objects into nested clusters of increasing ordering. Datasets endowed with a hierarchical classification structure are nowadays used in many challenging problems; like the case of very high dimensional spaces where the data structure is generally given by cluster-like organization [12]. In the case of morphological image processing, hierarchical representations are ubiquitous [6, 10, 15].

Processing a function whose domain is such hierarchical representation requires the formulation of filters and operators on ultrametric spaces. The counterpart of Heat kernel and Heat semigroups on ultrametric spaces has been widely studied in recent work [4] (for discrete ultrametric spaces) and [5] (for complete ultrametric spaces). Indeed using the theory of [4, 5], diffusion-based signal/image processing techniques can be applied to filter out functions on a hierarchy. A similar counterpart of morphological signal/image processing for such representations is developed in this paper.

Our starting point is the notion convolution of two functions in the \((\max ,\min )\)-algebra. Using this operator, we have recently shown that morphological operators on Euclidean spaces are natural formulated in \((\max ,\min )\)-algebra [2]. We introduce \((\max ,\min )\)-convolution based morphological operators on ultrametric spaces, where the structuring functions are scaled versions of the ultrametric distance (raised to a power \(p\ge 1\)). We study the corresponding semigroups properties and illustrate their interest in filtering and feature extraction.

In the state-of-the-art on mathematical morphology, there are several research lines related to our work. On the one hand, the theory of adjunctions on the lattice of dendrograms [8]. We remark that in our framework, the operators will be defined on the lattice of functions on the ultrametric space and not in the lattice of dendrograms itself. On the other hand, the various adjunctions on edge or node weighted graphs and their interpretations in terms of flooding [7, 9, 13] and their application to construct segmentation algorithms from invariants of processed minimum spanning trees with associated morphological operators [10, 11].

2 Ultrametric Spaces

Let \(\left( X,d\right) \) be a metric space. The metric d is called an ultrametric if it satisfies the ultrametric inequality, i.e., \(d(x,y)\le \max \{d(x,z),d(z,y)\}\), that is obviously stronger than the usual triangle inequality. In this case \(\left( X,d\right) \) is called an ultrametric space. An ultrametric space \(\left( X,d\right) \) is called discrete if the set X is: (i) countable, (ii) all balls \(B_r(x)\) are finite, and (iii) the distance function d takes only integer numbers.

Properties of Ultrametric Balls. Let us consider some well known properties of ultrametric spaces that directly derive from the ultrametric triangle inequality, proofs can be find in any basic reference on the field. The intuition behind such seemingly strange effects is that, due to the strong triangle inequality, distances in ultrametrics do not add up.

  1. (1)

    The strict ball \(B_{<r}(x)\) as well as the non-strict ball \(B_{\le r}(x)\) are both open as well as closed sets for the topology defined by the metric.

  2. (2)

    Every point inside a ball is its center, i.e., if \(d(x,y)<r\) then \(B_{r}(x)=B_{r}(y)\).

  3. (3)

    Given three points \(x,y,z \in X\),

    $$\begin{aligned} y,z \in B_r(x)\Rightarrow & {} d(y,z)<r, \\ y\in B_r(x),\,\, z\notin B_r(x)\Rightarrow & {} d(y,z)\ge r. \end{aligned}$$
  4. (4)

    For two intersecting balls, one contains the other, i.e., if \(B_{r}(x)\cap B_{s}(y) \ne \emptyset \) then either \(B_{r}(x)\subseteq B_{s}(y)\) or \(B_{s}(y)\subseteq B_{r}(x)\).

  5. (5)

    Any two ultrametric balls of the same radius r are either disjoint or identical.

  6. (6)

    The set of all open balls with radius r and center in a closed ball of radius \(r>0\) forms a partition of the latter, and the mutual distance of two distinct open balls is again equal to r.

Consequently, the collection of all distinct balls of the same radius r forms a partition X; for increasing values of r, the balls are also increasing, hence we obtain a family of nested partitions of X which forms a hierarchy.

Examples of Ultrametric Spaces. The p-adic numbers form a complete ultrametric space. The Cantor set, which is a fractal model, is also an ultrametric space. Besides these examples, we are interested for our applications in the duality between discrete ultrametric spaces and downward (or rooted) trees, which are also known as dendrograms.

We can introduce formally a downward tree \(\varGamma \) as follows. Let \(\varGamma \) be a countable connected graph, where the set of vertices of \(\varGamma \) consists of disjoint union of subsets \(\left\{ \varGamma _k \right\} _{k=0}^{\infty }\) with the following properties: (i) from each vertex \(v\in \varGamma _k\) there is exactly one edge to \(\varGamma _{k+1}\); (ii) for each vertex \(v\in \varGamma _k\) the number of edges connecting v to \(\varGamma _{k-1}\) is finite and positive, provided \(k\ge 1\); (iii) if \(|k-l| \ne 1\) then there is no edges between vertices of \(\varGamma _{k}\) and \(\varGamma _{l}\). Let \(d_{\varGamma }(v,w)\) denote the graph distance between the vertices v and w of graph \(\varGamma \), i.e., the smallest number of edges in a path connecting the two vertices. For two vertices, \(x,y\in \varGamma _0\), their nearest common ascestor is the vertex \(a\in \varGamma _k\). Note that a is connected to x and y by downward paths of k edges. Then \(\left( \varGamma _0, d\right) \) is a discrete ultrametric space.

Dually, any discrete ultrametric space \(\left( X,d \right) \) admits a representation as the bottom (i.e., set of leaves) of a downward tree \(\varGamma \). Define the vertices of \(\varGamma \) to be all distinct balls \(\left\{ B_k(x)\right\} \) where \(x\in X\) and \(k\in \mathbb {Z}_{+}\). Two balls \(B_k(x)\) and \(B_l(y)\) are connected by an edge in \(\varGamma \) if \(|k-l| \ne 1\) and one of them is subset of the other. That is \(\varGamma _0\) coincides with the set X, \(\varGamma _1\) consists of balls of radii 1, etc. Clearly, edges exist only between the vertices of \(\varGamma _k\) and \(\varGamma _{k+1}\). All balls of a given radius k provide a partition of \(\varGamma _0\), so that \(\varGamma _k\) consists of the elements of the partition. Each of the balls of radius k is partitioned into finitely many smaller balls of radius \(k-1\) and is contained in exactly one ball of radius \(k+1\). The ultrametric distance can be also defined as \(d(x,y) = \min \left\{ k : y\in B_{k}(x) \right\} \).

3 Dilation and Erosion Semigroups on Ultrametric Spaces

Functions on Ultrametric Spaces. Given a separable and complete ultrametric space \(\left( X,d\right) \), let us consider the family of non-negative bounded functions f on \(\left( X,d\right) \), \(f : X \rightarrow [0,M]\). The complement (or negative) function of f, denoted \(f^c\), is obtained by the involution \(f^c(x) = M - f(x)\). The set of non-negative bounded functions on ultrametric space is a lattice with respect to the pointwise maximum \(\vee \) and minimum \(\wedge \).

3.1 Ultrametric Structuring Functions

Definition 1

A parametric family \(\{b_t\}_{t>0}\) of functions \(b_t : X \times X \rightarrow (-\infty , M]\) is called by us an ultrametric structuring function in the ultrametric space (Xd) if the following conditions are satisfied for all \(x, y \in X\) and for all \(t,s >0\):

  1. (1)

    Total mass inequality: \(\sup _{y\in X} \, b_t(x,y) \le M\)

  2. (2)

    Completeness (or conservative): \(b_t(x,x) = M\)

  3. (3)

    Symmetry: \(b_t(x,y) = b_t(y,x)\)

  4. (4)

    A structuring function is monotonically decreasing in the ultrametric distance.

  5. (5)

    The complement of the structuring function, i.e., \(b_{t}^c(x,y) = M-b_t(x,y)\), is an ultrametric distance in \((X,b_{t}^c)\)

  6. (6)

    Maxmin semigroup property:

    $$\begin{aligned} b_{\max (t,s)}(x,y) = \sup _{z\in X} \left\{ b_t(x,z) \wedge b_s(z,y) \right\} . \end{aligned}$$
    (1)

Let us in particular introduce the so-called natural isotropic structuring function \(b_{P,t}(x,y)=\) \(b_{P,t}\left( d(x,y)\right) \), \(P>0\), in (Xd) as the following strictly monotonically decreasing function whose “shape” depends on power P:

$$\begin{aligned} b_{P,t}(x,y) = M - \left( \frac{d(x,y)}{t}\right) ^P. \end{aligned}$$
(2)

The case \(P=1\) is considered the canonical ultrametric structuring function.

Proposition 1

For any \(P>0\), the isotropic P-power function \(b_{P,t}(x,y)\) is an ultrametric structuring function.

Proof

The properties 1 (total mass inequality), 2 (completeness) and 3 (symmetry) are obvious from the definition of ultrametric distance. For property 4, the P-power function is also clearly monotonically increasing in the ultrametric distance and vanishes at 0.

For property 5, we need to prove that if (Xd) is an ultrametric space, then \((X,b_t^c)\) is an ultrametric space too, with \(b_{P,t}^c (x,y) = t^{-P} d(x,y)^P\), \(t>0\), \(P >0\). Let \(x,y,z \in X\) be given, we have \(d(x,y) \le \max \{d(x,z),d(z,y)\}\). Clearly,

$$\begin{aligned} t^{-P} d(x,y)^P \le t^{-P}\max \{ d(x,z), d(z,y)\}^P = \max \{t^{-P} d(x,z)^P, t^{-P} d(z,y)^P\} \end{aligned}$$

Thus \(t^{-P} d(x,y)^P\) is an ultrametric on X.

For property 6 on \(\max \)-semigroup in the \((\max ,\min )\)-convolution, we will use well-known results from this convolution [2]. First, let write the function f by its strict lower level sets:

$$ f(x) = \inf \left\{ \lambda : x \in Y^{-}_{\lambda }(f) \right\} , $$

where \(Y^{-}_{\lambda }(f) = \left\{ x\in X : f(x) < \lambda \right\} \). In fact, given \(t,s >0\) we will prove the dual semigroup property

$$ b_{P,\max (t,s)}^c(x,y) = \inf _{z\in X} \left\{ b_{P,t}^c(x,z) \vee b_{P,s}^c(z,y) \right\} . $$

which is just equivalent to the one we have since:

$$\begin{aligned} \sup _{z\in X} \left\{ b_{P,t}(x,z)\wedge b_{P,s}(z,y) \right\} = M - \inf _{z\in X} \left\{ t^{-P} d(x,z)^P \vee s^{-P} d(z,y)^P \right\} . \end{aligned}$$

Without the loss of generality, we can fix \(P=1\). By using the classical result from level set representations

$$ Y^{-}_{\lambda }\left( \phi _1 \vee \phi _2 \right) = \left\{ x\in X : \phi _1 (x)<\lambda \, \text {and} \, \phi _2 (x)< \lambda \right\} = Y^{-}_{\lambda }\left( \phi _1\right) \cap Y^{-}_{\lambda }\left( \phi _2\right) , $$

the condition, \(\forall x,y \in X\),

$$ Y^{-}_{\lambda }\left( t^{-1} d(x,z) \vee s^{-1} d(z,y) \right) = \left\{ \exists z \in X : \left[ t^{-1} d(x,z) \vee s^{-1} d(z,y) \right] < \lambda \right\} , $$

becomes \( \left\{ Y^{-}_{\lambda }\left( t^{-1} d(x,z) \right) \cap Y^{-}_{\lambda }\left( s^{-1} d(z,y) \right) \ne \emptyset \right\} , \) or equivalently, \(\forall x,y \in X\), \(\exists z \in X\) such that \( B_{\lambda t}(z) \cap B_{\lambda s}(z) \ne \emptyset \). In addition, \(B_{\lambda t}(x)= B_{\lambda t}(z)\), \(B_{\lambda s}(y) = B_{\lambda s}(z)\). Using the properties of ultrametric balls, the intersection of two balls centered at z means that there is ball which contains the other of radius \(\lambda \max (t,s)\) and that x and y belongs to this ball, i.e.,

$$ \left\{ d(x,y) < \lambda \max (t,s) \right\} \ne \emptyset . $$

In conclusion,

$$ Y^{-}_{\lambda }\left( t^{-1} d(x,z) \vee s^{-1} d(z,y) \right) = Y^{-}_{\lambda }\left( \max \left( t,s\right) ^{-1} d(x,y) \right) , $$

and therefore: \( \inf _{z\in X} \left\{ b_t^c(x,z) \vee b_s^c(z,y) \right\} = b_{\max (t,s)}^c(x,z) . \)

3.2 Ultrametric Dilation and Erosion Multiscale Operators

Definition 2

Given an ultrametric structuring function \(\{b_t\}_{t>0}\) in (Xd), for any non-negative bounded function f the ultrametric dilation \(D_{t}f \) and the ultrametric erosion \(E_{t}f \) of f on (Xd) according to \(b_t\) are defined as

$$\begin{aligned} D_{t} f(x)= & {} \sup _{y \in X} \left\{ f(y) \wedge b_t(x,y) \right\} , \quad \forall x\in X, \end{aligned}$$
(3)
$$\begin{aligned} E_{t} f(x)= & {} \inf _{y \in X} \left\{ f(y) \vee b^c_t(x,y) \right\} , \quad \forall x\in X. \end{aligned}$$
(4)

We can easily identify that the ultrametric dilation is a kind of convolution in \((\max ,\min )\)-algebra of function f by \(b_t\).

Proposition 2

Ultrametric dilation \(D_{t}f \) and erosion \(E_{t}f \) have the following properties.

  1. (1)

    Commutation with supremum and infimum. Given a set of functions \(\left\{ f_i\right\} \), \(i\in I\) and \(\forall x\in X\), \(\forall t >0\), we have

    $$\begin{aligned} D_t \left( \bigvee _{i\in I} f_i(x) \right) = \bigvee _{i\in I} D_t f_i(x) ; \quad E_t\left( \bigwedge _{i\in I} f_i(x) \right) = \bigwedge _{i\in I} E_t f_i(x). \end{aligned}$$
  2. (2)

    Increasingness. If \(f(x)\le g(x)\), \(\forall x \in X\), then

    $$ D_{t}f(x) \le D_{t}g(x); \,\, and \,\, E_{t}f(x) \le E_{t}g(x), \,\, \forall x \in X, \, \forall t >0. $$
  3. (3)

    Extensivity and anti-extensivity

    $$ D_{t}f(x) \ge f(x) ; \,\, and \,\, E_{t}f(x) \le f(x), \,\, \forall x \in X, \, \forall t >0. $$
  4. (4)

    Duality by involution. For any function f and \(\forall x \in X\), one has

    $$ D_{t}f(x) = \left[ E_{t}f^c(x)\right] ^c ; \,\, and \,\, E_{t}f(x) = \left[ D_{t}f^c (x)\right] ^c ,\,\, \forall t >0. $$
  5. (5)

    Ordering property. If \(0< s < t\) then \(\forall x \in X\)

    $$ \inf _{X}f \le E_{t}f(x) \le E_{ s}f(x) \le f(x) \le D_{ s}f(x) \le D_{t} f(x)\le \sup _X f . $$
  6. (6)

    Semigroup. For any function f and \(\forall x \in X\), and for all pair of scales \(s,t>0\),

    $$\begin{aligned} D_{t}D_{s}f= & {} D_{\max (t,s)} f; \\ E_{t}E_{s}f= & {} E_{\max (t,s)} f. \end{aligned}$$

Proof

For property 1, on the distributivity of the operators, we have for all \(x\in X\) and for t:

$$\begin{aligned} D_t \left( \bigvee _{i\in I} f_i(x) \right)= & {} \sup _{y \in X} \left\{ \sup _{i\in I} f_i(y) \wedge b_t(x,y) \right\} \\= & {} \sup _{i\in I} \sup _{y \in X} \left\{ f_i(y) \wedge b_t(x,y) \right\} = \bigvee _{i\in I} D_t f_i(x). \end{aligned}$$

and similarly for the ultrametric erosion.

The properties 2 and 3 of increasingness and extensivity/anti-extensivity are obvious from the properties of supremum/infimum and the property \(b_t(x,y) \le M\), with \(b_t(x,x)=M\).

For property 4, on duality by involution, let us prove the first relationship since the other one is obtained by a similar procedure. For all \(x\in X\) and for t:

$$\begin{aligned} \left[ E_{t}f^c(x)\right] ^c= & {} M - \inf _{y \in X} \left\{ (M - f(y)) \vee b^c_t(x,y) \right\} \\= & {} M - \inf _{y \in X} \left\{ (M - f(y)) \vee (M - b_t(x,y)) \right\} \\= & {} - \inf _{y \in X} \left\{ - f(y) \vee - b_t(x,y) \right\} =\sup _{y \in X} \left\{ f(y) \wedge b_t(x,y) \right\} = D_{t}f(x). \end{aligned}$$

In order to prove the semigroup property 6, let us focus on the ultrametric dilation \(D_t\). For any \(x \in X\) and any pair \(t,s>0\), one has:

$$\begin{aligned} D_t D_s f(x)= & {} \sup _{y \in X} \left[ D_s f(y) \wedge b_t(x,y) \right] \\= & {} \sup _{y \in X} \left[ \sup _{z \in X} \left\{ f(z) \wedge b_s(y,z) \right\} \wedge b_t(x,y) \right] \\= & {} \sup _{z \in X} \left[ f(z) \wedge \sup _{y \in X} \left\{ b_s(y,z) \wedge b_t(x,y) \right\} \right] . \end{aligned}$$

Then using the property (6) of semigroup for ultrametric structuring functions, it is obtained that

$$\begin{aligned} D_t D_s f(x) = \sup _{z \in X} \left\{ f(z) \wedge b_{\max (t,s)}(x,z) \right\} = D_{\max (t,s)} f(x). \end{aligned}$$

The result for the ultrametric erosion is just obtained by duality.

The proof of ordering property 5 for the case \(D_t (f)(x) \ge D_s (f)(x)\), \(\forall x\in X\) is based on the fact for \(t>s > 0\), by the semigroup property on the structuring functions, one has

$$\begin{aligned} b_t(x,y)= \sup _{z\in X}\left\{ b_t(x,z) \wedge b_s(z,y)\right\} \Rightarrow b_t(x,y) \ge b_s(x,y), \end{aligned}$$

and therefore

$$\begin{aligned} D_t f(x) = \sup _{y \in X} \left\{ f(y) \wedge b_{t}(x,y) \right\} \ge \sup _{y \in X} \left\{ f(y) \wedge b_{s}(x,y) \right\} = D_s f(x) . \end{aligned}$$

Considering the classical algebraic definitions of morphological operators [16] for the case of ultrametric semigroups \(\{D_t \}_ {t\ge 0}\), resp. \(\{E_t \}_ {t\ge 0}\), they have the properties of increasingness and commutation with supremum, resp. infimum, which involves that

$$ D_t \,\, \text {is a dilation and}\,\, E_t\,\, \text {is an erosion.} $$

In addition, they are extensive, resp. anti-extensive, operators and, by the supremal semigroups, both are idempotent operators, i.e., \(D_t D_t = D_t\) and \(E_t E_t = E_t\), which implies that

$$ D_t \,\, \text {is a closing and }\,\, E_t\,\, \text {is an opening.} $$

Finally, their semigroups are just the so-called granulometric semigroup [16] and therefore

$$ \{D_t \}_ {t\ge 0} \,\, \text {is an anti-granulometry and}\,\, \{E_t \}_ {t\ge 0} \,\, \text {is a granulometry,} $$

which involve interesting scale-space properties useful for filtering and decomposition.

At first sight, one can be perplexed by this property: ultrametric dilation (resp. ultrametric erosion) is also a closing (resp. opening), since ultrametric dilation commutes with the supremum and the class of invariants of a closing is stable by infimum. However, as these suprema are taken on ultrametric balls of the various partitions, their class is also stable by infimum. The same result was already obtained by Meyer [8] for set operators on partitions.

Note that we do not use the duality by adjunction to link this pair of dilation/erosion since they are already idempotent operators and do not need to compose them to achieve such goal. Reader interested on adjunction in \((\max ,\min )\)-algebra is referred to [2].

3.3 Discrete Ultrametric Dilation and Erosion Semigroups

Let \(\left( X ,d \right) \) be a discrete ultrametric space. Choose a sequence \(\left\{ c_k\right\} _{k=0}^{\infty }\) of positive reals such that \(c_0 = 0\) and \(c_{k+1} > c_k \ge 0\), \(k=0,1,\cdots \). Then, given \(t>0\), ones defines the sequence \(\left\{ b_{k, t}\right\} _{k=0}^{\infty }\), such that

$$\begin{aligned} b_{k,t} = M - t^{-1} c_k. \end{aligned}$$
(5)

Let us define \(\forall k\), \(\forall x\in X\), the ultrametric dilation and erosion of radius k on the associated partition as

$$\begin{aligned} \mathrm {Q}_{k}^{\vee }f(x)= & {} \sup _{y \in B_{k}(x) } f(y),\end{aligned}$$
(6)
$$\begin{aligned} \mathrm {Q}_{k}^{\wedge }f(x)= & {} \inf _{y \in B_{k}(x) } f(y). \end{aligned}$$
(7)

Using now (6) and (7), it is straightforward to see that the ultrametric dilation and ultrametric erosion of f by \(b_{k,t}\) can be written as

$$\begin{aligned} D_t f(x)= & {} \sup _{0 \le k \le \infty } \left\{ \mathrm {Q}_{k}^{\vee }f(x) \wedge b_{k, t} \right\} , \end{aligned}$$
(8)
$$\begin{aligned} E_t f(x)= & {} \inf _{0 \le k \le \infty } \left\{ \mathrm {Q}_{k}^{\wedge }f(x) \vee (M-b_{k, t}) \right\} . \end{aligned}$$
(9)

It is obvious using this formulation that do not need to compute explicitly the ultrametric distance between all-pairs of points x and y and that \( D_t f(x)\) and \( E_t f(x)\) are obtained by working on the supremum and infimum mosaics \( \mathrm {Q}_{k}^{\vee }f(x) \) and \( \mathrm {Q}_{k}^{\wedge }f(x)\) from the set of partitions, which is usually finite, i.e., \(k=0,1,\cdots , K\).

3.4 Ultrametric \(\infty \)-mean and \(\infty \)-Laplacian

Ultrametric \(\infty \) -mean. Given a set of N points \(x_i \in X\subset \mathbb {R}^n\), the \(L^{\infty }\)-barycenter, known as 1-center (minimax center), corresponds to the minimizer of max-of-distances function. From a geometric viewpoint, it corresponds to the center of the minimum enclosing ball of the points \(x_i\). In the case of \(\mathbb {R}\), which can be called the \(\infty \)-mean, the minimax center equals \(m_{\infty } = \frac{1}{2}\left( \max _{1\le i \le N} x_i \right. + \left. \min _{1\le i \le N} x_i \right) \). In our framework, the ultrametric dilation and erosion can be used to introduce the notion of ultrametric \(\infty \)-mean at scale t just as

$$\begin{aligned} M_{t} f (x) = \frac{1}{2}\left( D_t f(x) + E_t f(x) \right) \end{aligned}$$
(10)

This operator is related to the solution of the Tug-of-War stochastic game [14].

Ultrametric \(\infty \) -Laplacian. The infinity Laplace (or \(L^{\infty }\)-Laplace) operator is a 2nd-order partial differential operator. Viscosity solutions to the equation \(\varDelta _{\infty }u=0\) are known as infinity harmonic functions. More recently, viscosity solutions to the infinity Laplace equation have been identified with the payoff functions from randomized tug-of-war games [14]. In the case of a length spaces, there exists a counterpart, i.e.,

$$\begin{aligned} \mathcal {L}^{\infty } u(x) = \max _{y\in \varOmega , y\ne x}\left( \frac{u(y)-u(x)}{d(x,y)}\right) + \min _{y\in \varOmega , y\ne x}\left( \frac{u(y)-u(x)}{d(x,y)}\right) \end{aligned}$$

In the case of ultrametric spaces, we introduce the multi-scale ultrametric \(\infty \)-Laplacian, which mimics the idea of the second-order differential operator, as follows:

$$\begin{aligned} \mathcal {L}^{\infty }_t f(x)= & {} \left( D_t f(x) -f(x) \right) -\left( f(x) - E_t f(x) \right) \nonumber \\= & {} D_t f(x) + E_t f(x) - 2f(x). \end{aligned}$$
(11)

As for the standard laplacian, this operator can be used for enhancement of “edges” of function \(f : f \mapsto \tilde{f}_t (x) = f(x) - \mathcal {L}^{\infty }_t f(x)\).

Fig. 1.
figure 1

Ultrametric scale-spaces: (a) original image f(x), (b) and (c) ultrametric dilation \(D_t f(x)\) with \(t=0.01\) and \(t=0.1\), (d) and (e) ultrametric erosion \(E_t f(x)\) with \(t=0.01\) and \(t=0.1\), (f) \(\infty \)-mean with \(t=0.01\), (g) image enhancement by \(\infty \)-Laplacian \(f(x) -\mathcal {L}^{\infty }_t f(x)\) with \(t=0.01\).

Fig. 2.
figure 2

Ultrametric morphological processing of bimodal image from quantitative phase microscopy: the intensity image in (a) is processed using the ultrametric space derived from the phase image in (b), with scale parameter \(t=0.005\).

4 Applications to Image and Data Processing

For the examples that we consider here the ultrametric space (Xd) is built from a minimum spanning tree (MST). First, let G be an edge-weighted undirected neighbor graph with points \(x\in X\) as vertices and all edge weights as nonnegative values. An MST of G is a spanning tree that connects all the vertices together with the minimal total weighting for its edges, and let d(xy) be the largest edge weight in the path of the MST between x and y. Then the vertices of the graph G, with distance measured by d form an ultrametric space. By thresholding the corresponding MST at k, \(0\le k\le K\), a set of partitions is obtained which produces all balls \(B_k(x)\).

For the case of the discrete images or signals used in the examples, G is 4-connected pixel neighbor graph and the edge weights are the grey-level difference. In addition, a discrete ultrametric structuring function is always considered, i.e., \(b_{k,t} = M - t^{-1} c_k\), with \(c_k = k\).

Fig. 3.
figure 3

Ultrametric dilation \(D_t f(x)\) (in red), erosion \(E_t f(x)\) (in blue) and \(\infty \)-mean \(M_t f(x)\) (in green) of 1D signal f(x). (Color figure online)

The first example in Fig. 1 illustrates scale-space of ultrametric dilation \(D_t f\) and \(E_t f\), for two values of scale t. For \(t= 0.01\), the associated ultrametric \(\infty \)-mean and enhancement by \(\infty \)-Laplacian are also given. One can observe that the operators acting on the ultrametric balls naturally preserve the significant edges. Figure 2 provides a case of a bimodal image from cell microscopy, where the quantitative phase image (b) is used to built the ultrametric space, and then, the intensity image (a) is ultrametrically processed using such space. A 1D signal, intrinsically organized into clusters, captured by the ultrametric point space, is used in Fig. 3. The regularization obtained by these operators can be useful in many applications of data processing.

5 Conclusion and Perspectives

The theory introduced in this paper provides the framework to process images or signals defined on a hierarchical representation associated to an ultrametric distance space. The effect of the operators depends on both the scale parameter and the underlying ultrametric distance. These operators have the fundamental property of acting on the function according to the pyramid of partitions associated to its ultrametric domain and therefore the notion of pixel is replaced by that of class of the partition at a given value of the hierarchy.

Ongoing work will study, on the one hand, the properties of other ultrametric structuring functions inspired from ultrametric heat kernel functions [4, 5] and on the other hand, the existence of a Hamilton–Jacobi PDE on ultrametric spaces using pseudo-differential operators.