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 [38, 45, 46] has developed since the 1960s as a powerful theoretical framework from which versatile instruments for shape analysis in images can be derived, such as for structure-preserving denoising or shape simplification [23]. The fundamental building blocks of classical mathematical morphology are non-linear local image filters like dilation, erosion, and median filters. They rely on aggregating intensities within a neighbourhood of any given pixel by e.g. maximum, minimum, and median operations. The selection of neighbourhoods for processing is classically done by shifting a sliding window of fixed size and shape across the image. In the context of morphology, this sliding window is known as structuring element.

More recently, concepts for adaptivity have been developed generally in image filtering and also specifically in morphology [5, 51]. One recent concept for adaptive morphology are morphological amoebas introduced by Lerallut et al. [32]. These are space-variant structuring elements constructed from a combination of spatial distance measurement with local contrast measurement via an amoeba metric.

In earlier work by the author of the present chapter and his coauthors, properties of amoeba filters and their relations to image filters based on partial differential equations (PDEs) were investigated [54, 57, 58]. As an application to image segmentation, an amoeba-based active contour method was designed [53, 54, 56]. Recently, a combination of edge-weighted graphs generated in the computation of amoebas with graph indices was used to introduce a new class of texture descriptors [55] which are currently under further investigation. This chapter reviews and summarises the results from these works. Directions of ongoing research on this topic are sketched.

With focus on giving a comprehensive overview of the theory that has been developed in various earlier publications, the (mostly lengthy) proofs of the results are omitted here and referred to the respective original sources. Nevertheless, the main principles underlying the proofs are shortly outlined. Although amoeba filtering of multi-channel images has been addressed to some extent in [57], this aspect of the topic presents itself in a stage too early for a summarised presentation, and is therefore not included in the present chapter.

In the following the structure of the chapter is detailed, highlighting contributions that are novel in this presentation.

Section 4.2 introduces the concept of morphological amoebas as image-adaptive structuring elements in the space-discrete as well as the space-continuous setting. To ease bridging to the graph techniques discussed later in Sect. 4.6, the presentation in the discrete case emphasises the modelling of discrete images by neighbourhood graphs and uses standard terminology from graph theory, thereby following [55]. The presentation of the space-continuous case is similar to that e.g. in [57].

The application of amoebas in image filtering is the topic of Sect. 4.3. Median filters, morphological dilation and erosion are presented together with their relationship to PDE image filters, reproducing herein results from [54, 5658]. Regarding the association between amoeba metrics on the discrete filtering side and edge-stopping functions occurring in the corresponding PDEs, the current work adds to the previously considered exemplary L 1 and L 2 (Euclidean) amoeba metrics as a third simple case the L (maximum) amoeba metric and states explicitly the corresponding edge-stopping function. Moreover, the amoeba variants of morphological opening and closing are included in the description for the first time. For dilation, erosion, opening and closing filters, the presentation here emphasises the algebraic background including max-plus/min-plus convolution and conjugacy of structure elements.

Section 4.4 considers the application of amoeba techniques to devise basic algorithms for unsupervised segmentation of grey-value images, namely the amoeba active contours (AAC) first introduced in [53] and further investigated in [54, 56]. Results from [56] on the relation between AAC and geodesic active contours are reported.

In image filtering by nonlinear PDEs, one often computes the nonlinearities not from the input images themselves but from Gaussian pre-smoothed versions of these, in order to reduce noise sensitivity of filters and to improve numerical stability. This is also the case with self-snakes and active contour PDEs; note that the self-snakes PDE is even ill-posed without such pre-smoothing. Section 4.5 investigates the effect of pre-smoothing in the self-snakes PDE using perturbation analysis on a synthetic example; furthermore, it discusses how a comparable stabilisation can be achieved in the amoeba median filter framework. The analysis presented in this section relies on previous work in [54, 57] in which oscillatory perturbations aligned with the gradient direction were studied, and extends it by including also perturbations aligned with the level line direction.

Section 4.6 is devoted to a different direction of application of amoeba ideas. Noticing that the computation of discrete amoeba structuring elements is intimately related with graph structures – a weighted neighbourhood graph, weighted and unweighted Dijkstra search trees – in the neighbourhood of each pixel, one can try to extract local texture information from these graphs. Quantitative graph theory [13] offers a variety of graph indices for generating quantitative information from graph structures. The presentation of the construction of texture descriptors from amoebas and graph indices in this section follows [55]. Compared to the large set of descriptors covered in [55], only a few representatives are shown here, complementing their mathematical description by a visualised example. Extending the previous work on texture discrimination in [55], the present chapter also shows a first example of the new texture descriptors in texture segmentation by using the descriptors as components of an input image for multi-channel GAC segmentation.

2 Morphological Amoebas

Well-known local image filters such as the mean filter, median filter, morphological dilation or erosion consist of two steps: a sliding-window selection step, and the aggregation of selected input values by taking e.g. the arithmetic mean, median, maximum or minimum. A strategy to improve the sensitivity of such filters to important image structures is to modify the selection step by using spatially adaptive neighbourhoods instead of a fixed sliding window. The general idea is to give preference in the selection to neighbouring image locations with similar intensities, and thus to reduce the flow of grey-value information across high contrast steps or slopes in the filter process.

First introduced by Lerallut et al. [32, 33] as structuring elements for adaptive morphology, morphological amoebas are a specific type of such spatially adaptive neighbourhoods. Their construction relies on the combination of spatial distance in the image domain with grey-value contrast into a modified metric on the image.

2.1 Edge-Weighted Neighbourhood Graph

To define morphological amoebas on discrete images, we start by considering edge-weighted graphs based on the image grid.

Definition 4.1

Let f be a discrete image. Construct an edge-weighted graph G w ( f): = (V, E, w) with vertex set V, edge set E and weights w as follows. The vertex set V is formed by all pixels of f. Two vertices i, j are connected, {i, j} ∈ E, if and only if pixels i, j are neighbours under a suitably chosen neighbourhood notion. To define the edge weights w i, j for an edge {i, j} ∈ E, consider the corresponding pixel locations \(\boldsymbol{p}_{i}\) and \(\boldsymbol{p}_{j}\) as well as the intensities f i and f j , and set w i, j to

$$\displaystyle{ w_{ij}:=\varphi {\bigl (\Vert \boldsymbol{ p}_{i} -\boldsymbol{ p}_{j}\Vert _{2},\beta \,\vert \,f_{i} - f_{j}\vert \bigr )} }$$
(4.1)

where \(\Vert \boldsymbol{p}_{i} -\boldsymbol{ p}_{j}\Vert _{2}\) denotes Euclidean distance in the image plane, β > 0 is a contrast scale parameter weighting between spatial and tonal distances, and φ is a norm on \(\mathbb{R}^{2}\) which can be rewritten as

$$\displaystyle\begin{array}{rcl} \varphi (s,t)& = \left \{\begin{array}{@{}l@{\quad }l@{}} \vert t\vert \cdot \nu (\vert s/t\vert )\;,\quad &t> 0\;,\\ \vert s\vert \;, \quad &t = 0 \end{array} \right.&{}\end{array}$$
(4.2)

with a monotonically increasing function \(\nu: \mathbb{R}_{0}^{+} \rightarrow \mathbb{R}^{+}\) (by continuity, ν(0) = 1).

The edge-weighted graph G w ( f) is called neighbourhood graph of f.

In this definition, neighbourhood can be understood as a 4-neighbourhood, as done in [32], or as an 8-neighbourhood as in [55, 57, 58]. The latter choice gets somewhat closer to a Euclidean measurement of spatial distances in the image plane and is therefore also considered the default in the present work.

As to the norm function ν, the setting ν(z) ≡ ν 1(z) = 1 + z corresponds to the L 1 metric also used in [32] that gives

$$\displaystyle{ w_{ij} =\Vert \boldsymbol{ p}_{i} -\boldsymbol{ p}_{j}\Vert _{2} +\beta \,\vert \, f_{i} - f_{j}\vert \;, }$$
(4.3)

whereas \(\nu (z) \equiv \nu _{2}(z) = \sqrt{1 + z^{2}}\) entails a Euclidean (L 2) metric in which the edge weights are obtained by the Pythagorean sum

$$\displaystyle{ w_{ij} = \sqrt{\Vert \boldsymbol{p}_{i } -\boldsymbol{ p}_{j } \Vert _{2 }^{2 } +\beta ^{2 } \vert \,f_{i } - f_{j } \vert ^{2}} }$$
(4.4)

A straightforward generalisation is

$$\displaystyle{ \nu _{p}(z) = (1 + z^{p})^{1/p}\quad \text{for}\ p \geq 1\;, }$$
(4.5)

which in the limit p → + also includes ν (z) = max{1, z} and the corresponding edge weight

$$\displaystyle{ w_{ij} =\max \left \{\Vert \boldsymbol{p}_{i} -\boldsymbol{ p}_{j}\Vert _{2},\beta \,\vert \,f_{i} - f_{j}\vert \right \}\;. }$$
(4.6)

2.2 Discrete Amoeba Metric

We use the edge-weighted neighbourhood graph to define the discrete amoeba metric on image f.

Definition 4.2

Let a discrete image f be given. Let G w ( f) be its neighbourhood graph with edge weights given by (4.1). Define for two pixels i and j their distance d(i, j) as the minimal total weight (length) among all paths between i and j in G w ( f). Then d is called (discrete) amoeba metric on f.

The metric d is called L p amoeba metric, 1 ≤ p < , if it is derived from (4.5), or L amoeba metric if it is obtained from ν(z) = max{1, z}. The L 2 amoeba metric is also called Euclidean amoeba metric.

Definition 4.3

In a discrete image f with amoeba metric d, an amoeba structuring element (short: amoeba) \(\mathcal{A}_{\varrho }(i) \equiv \mathcal{A}_{\varrho }(\,f;i)\) with amoeba radius ϱ and reference point at pixel i is a discrete ϱ-ball around pixel i in the amoeba metric, i.e. the set of all vertices within a distance ϱ from i,

$$\displaystyle{ \mathcal{A}_{\varrho }(i):=\{\, j\ \vert \ d(i,j) \leq \varrho \}\;. }$$
(4.7)

The derivation of amoebas from a metric with a global radius parameter ϱ has an interesting consequence: for two pixels i, j, one has

$$\displaystyle{ i \in \mathcal{A}_{\varrho }(j)\quad \Leftrightarrow \quad j \in \mathcal{A}_{\varrho }(i)\;, }$$
(4.8)

which is helpful in the design of some morphological filters.

2.3 Computation of Discrete Amoebas

To compute amoebas in a discrete image, one has to search the neighbourhood of each given reference pixel i in order to identify the pixels j with amoeba distance d(i, j) ≤ ϱ. Given that the edge weights w i, j in G w ( f) are nonnegative, this can be achieved by running Dijkstra’s shortest path algorithm [16] on G w ( f) starting at pixel i. As this algorithm enumerates neighbour pixels in order of increasing path weight, it can be stopped as soon as a pixel j with d(i, j) > ϱ is visited.

Moreover, by the construction of the amoeba distance it is clear that the Euclidean distance in the image domain is a lower bound for the amoeba distance between pixels. Therefore the Dijkstra algorithm for the start vertex i can be run on the subgraph of G f (w) that contains just the pixels from the Euclidean ϱ-neighbourhood of i.

2.4 Amoebas on Continuous Domains

Even superficial inspection of results obtained by some amoeba filters indicates that they have striking similarities to image processing methods based on partial differential equations (PDEs). This observation has been substantiated in [5658] by studying space-continuous versions of amoeba filters; the results proven there allow to interpret amoeba filters as time steps of explicit discretisations for suitable PDEs.

To devise space-continuous versions of amoeba filters, one has to translate first the notion of amoeba metric to the space-continuous setting. Once this is done, the definition of an amoeba as a ϱ-ball around a reference point is straightforward.

The amoeba metric for a space-continuous greyvalue image – a real-valued function f over a connected compact image domain \(\Omega \subset \mathbb{R}^{n}\) – can be stated by assigning to each two given points \(\boldsymbol{p},\boldsymbol{q} \in \Omega\) as their distance the minimum of a path integral between \(\boldsymbol{p}\) and \(\boldsymbol{q}\). Just like the edge weights in the discrete amoeba construction, the integrand of the path integral is obtained by applying a suitable norm φ to the spatial metric (the Euclidean curve element of the path) and the greyvalue metric (the standard metric on the real domain), such that the amoeba distance reads as

$$\displaystyle\begin{array}{rcl} d(\,\boldsymbol{p},\boldsymbol{q})& =& \min \limits _{\boldsymbol{c}}\int \limits _{0}^{1}\varphi {\bigl (\Vert \boldsymbol{c}'(t)\Vert _{ 2},\beta \,\vert (\,f \circ \boldsymbol{ c})'(t)\vert \bigr )}\,\mathrm{d}t \\ & =& \min \limits _{\boldsymbol{c}}\int \limits _{0}^{1}\varphi {\bigl (\Vert \boldsymbol{c}'(t)\Vert _{ 2},\beta \,\vert \boldsymbol{\nabla }f^{\mathrm{T}}\boldsymbol{c}'(t)\vert \bigr )}\,\mathrm{d}t{}\end{array}$$
(4.9)

where \(\boldsymbol{c}\) runs over all regular curves \(\boldsymbol{c}: [0,1] \rightarrow \Omega\) with \(\boldsymbol{c}(0) =\boldsymbol{ p}\), \(\boldsymbol{c}(1) =\boldsymbol{ q}\), and φ can be chosen as in the discrete case.

Fig. 4.1
figure 1

Amoeba as projection of the unit disk on the image graph to the image plane

Let us associate to the function \(f: \mathbb{R}^{2} \supset \Omega \rightarrow \mathbb{R}\) its (vertically rescaled) graph, the manifold \(\Gamma:=\{ (x,y,\beta \,f(x,y))\ \vert \ (x,y) \in \Omega \} \subset \mathbb{R}^{3}\). Then we see that the amoeba distance dp, ±q) between two points ± p, ± q in the image domain \(\Omega\) can be interpreted as a distance \(\hat{d}(\,\boldsymbol{p}',\boldsymbol{q}')\) on \(\Gamma\). The points \(\boldsymbol{p}',\boldsymbol{q}' \in \Gamma\) herein are given by \(\boldsymbol{p}':= (\,\boldsymbol{p},f(\,\boldsymbol{p}))\), \(\boldsymbol{q}':= (\boldsymbol{q},f(\boldsymbol{q}))\). To define the metric \(\hat{d}\) on \(\Gamma\), consider a metric \(\tilde{d}\) in the surrounding space \(\mathbb{R}^{3}\) that combines Euclidean metric in the x-y-plane with the standard metric in z-direction via the function φ from (4.2) that appeared already in the original construction of the amoeba metric. Using \(\tilde{d}\) in \(\mathbb{R}^{3}\), the metric \(\hat{d}\) is obtained as its induced metric on the submanifold \(\Gamma \subset \mathbb{R}^{3}\). Figure 4.1 illustrates that the amoeba structuring element is then the projection of a unit disk on \(\Gamma\) back to the image plane.

Fig. 4.2
figure 2

Typical shapes of amoebas in the continuous domain for different amoeba metrics. Top row shows amoebas on an image with equidistant straight level lines, bottom row shows amoebas on curved level lines (schematic). Left column shows L 1 amoeba metric, middle column Euclidean amoeba metric, and the right column shows the maximum (L ) amoeba metric. Each amoeba is shown with its reference point (bold) and level line through the reference point (dashed)

Figure 4.2 shows typical amoeba shapes in smooth image regions for the three exemplary amoeba metrics exposed in Sect. 4.2.2.

3 Amoeba-Based Image Filters

To obtain applicable image filters, the amoeba procedure described above is used as a selection step and needs to be complemented by some aggregation step. We consider here standard choices of aggregation operators from classical local filters; introducing also modifications into this part of the filtering procedure is left as a possible direction for future research. Moreover, keeping close to the original context in which amoebas were developed, we focus on morphological operators. Here, morphological operators are characterised by their invariance under arbitrary monotonically increasing transformations of the intensities, see e.g. [37], which means that also median and quantiles belong to this class.

3.1 Median

A median filter aggregates the intensity values of the selected pixels by taking their median. In the non-adaptive, sliding-window setting this filter can be traced back to Tukey [50], and since then it has gained high popularity as a simple denoising filter that preserves discontinuities (edges) and its robustness with respect to some types of noise. Median filtering can be iterated. Unlike average filters, the median filter on a discrete image possesses non-trivial steady states, so-called root signals [17], that depend on the filter window. The smaller the filter window, the faster the iterated median filtering process locks in at a root signal.

Despite the nice preservation of edges, the non-adaptive median filter involves a displacement of curved edges in inward direction and rounding of corners that is often undesired. Amoeba median filtering greatly reduces this effect. Figure 4.3 demonstrates this by an example.

Fig. 4.3
figure 3

Non-adaptive and amoeba median filtering. (a ) Original image. (b ) Filtered by 5 iterations of standard median filtering with a discrete disk of radius 2 as structuring element. (c ) Filtered by 5 iterations of amoeba median filtering with Euclidean amoeba metric, β = 0. 2, ϱ = 7

3.1.1 PDE Approximation

As noticed already in 1997 by Guichard and Morel [20], the overall robust denoising effect and the characteristic corner-rounding behaviour of standard median filtering resemble the properties of the well-known (mean) curvature motion PDE [1]. Further analysis confirmed this observation by proving an asymptotic relationship between the two filters, as set forth in the following proposition.

Proposition 4.1 (Guichard and Morel [20])

For a smooth function \(u: \Omega \rightarrow \mathbb{R}\) , one iteration of median filtering with a ϱ-ball as structuring element approximates for ϱ → 0 a time step of size τ = ϱ 2 ∕6 of the curvature motion PDE [1]

$$\displaystyle{ u_{t} =\vert \boldsymbol{ \nabla }u\vert \,\mathrm{div}\left (\frac{\boldsymbol{\nabla }u} {\vert \boldsymbol{\nabla }u\vert }\right )\;. }$$
(4.10)

This seminal result motivates the investigation of relations between amoeba and PDE filters whose results are reviewed in the further course of the present paper.

Just like amoeba median filtering differs from standard median filtering by an adaptation procedure that suppresses smoothing across edges, the curvature motion equation (4.10) has a counterpart in which also the flow across edges is suppressed. This so-called self-snakes filter [44] allows curvature-based image smoothing and simplification, preserves and even enhances edges, while at the same time avoiding to shift them, as curvature motion does. It turns out that indeed amoeba median filtering is connected to self-snakes by a similar asymptotic relationship as that of Proposition 4.1, as follows.

Theorem 4.1 ([57, 58])

For a smooth function \(u: \Omega \rightarrow \mathbb{R}\) , one iteration of amoeba median filtering with amoeba radius ϱ approximates for ϱ → 0 a time step of size τ = ϱ 2 ∕6 of the self-snakes PDE [44]

$$\displaystyle{ u_{t} =\vert \boldsymbol{ \nabla }u\vert \,\mathrm{div}\left (g{\bigl (\vert \boldsymbol{\nabla }u\vert \bigr )}\,\frac{\boldsymbol{\nabla }u} {\vert \boldsymbol{\nabla }u\vert }\right ) }$$
(4.11)

where \(g: \mathbb{R}_{0}^{+} \rightarrow \mathbb{R}_{0}^{+}\) is a decreasing edge-stopping function that depends on the amoeba metric being used.

Proofs for Theorem 4.1 have been given in [57, 58]. While these proofs are not reproduced in detail here, it is of interest to describe the two different strategies that are used in these proofs. These approaches form also the basis for the further amoeba–PDE asymptotics results presented in Sect. 4.3.2.

3.1.2 Proof Strategies

The crucial observation for all median filter–PDE equivalence results since Guichard and Morel’s proof of Proposition 4.1 in [20] is that the median of a smooth function u within a given compact structuring element \(\mathcal{A}\) is the function value whose corresponding level line divides the structuring element into two parts of equal area. Herein it is assumed that each value of u within the structuring element is associated with a unique level line segment inside \(\mathcal{A}\), which is satisfied for sufficiently small fixed or amoeba structuring elements whose reference point \(\boldsymbol{x}_{0}\) is not an extremum of u, and therefore acceptable when studying the limit ϱ → 0.

The amount by which a single median filtering step changes the function value at the reference point \(\boldsymbol{x}_{0}\) of the structuring element then corresponds, up to multiplication with \(\vert \boldsymbol{\nabla }u\vert\), to the distance between the area-bisecting level line and the level line through \(\boldsymbol{x}_{0}\), see the illustration in Fig. 4.4a. The two approaches discussed in the following differ in the way how they measure the area of the structuring elements and parts thereof.

Fig. 4.4
figure 4

(a ) Amoeba with reference point \(\boldsymbol{x}_{0}\), level line through \(\boldsymbol{x}_{0}\) (dot-dashed) and bisecting level line (dashed), schematic. (b ) Amoeba with curvilinear coordinate system formed by level lines (dashed) and gradient flow lines (solid)

3.1.2.1 Proof Strategy I

The first strategy has been followed in [58] to prove Theorem 4.1 for the entire class of amoeba metrics discussed in Sect. 4.2 above, see also the more detailed version in [57, Section 4.1.1]. It is close to the approach from [20] in that it develops the smooth function u around the reference point \(\boldsymbol{x}_{0}\) into a Taylor expansion up to second order. The Taylor expansion is then used to approximate, for an amoeba \(\mathcal{A} = \mathcal{A}_{\varrho }(\boldsymbol{x}_{0})\), three items: first, the range of function values occurring within \(\mathcal{A}\), i.e. the minimum \(\min _{\mathcal{A}}u\) and maximum \(\max \nolimits _{\mathcal{A}}u\), second, the length L(z) of the level line segment for each \(z \in [\min \nolimits _{\mathcal{A}}u,\max \nolimits _{\mathcal{A}}u]\), and third, the density δ(z) of level lines around each z, which equals the steepness of the slope of u near the level line of z.

Integrating the lengths of level lines over function values, weighted with their reciprocal densities, yields the area of \(\mathcal{A}\), i.e. 

$$\displaystyle{ \mathrm{Area}(\mathcal{A}) =\int \limits _{ \min _{\mathcal{A}}u}^{\max _{\mathcal{A}}u}\frac{L(z)} {\delta (z)} \,\mathrm{d}z\;. }$$
(4.12)

As this integral effectively runs over level lines, splitting the integration interval exactly corresponds to cutting \(\mathcal{A}\) at some level line. The calculation of the desired median of u within \(\mathcal{A}\) is then achieved by determining a suitable splitting point in the integration interval so that the integrals on both sub-intervals become equal.

Summarising, this strategy describes the amoeba shape in terms of a curvilinear coordinate system aligned with the gradient and level line directions at \(\boldsymbol{x}_{0}\), in which the level lines take the role of coordinate lines, compare Fig. 4.4b.

3.1.2.2 Proof Strategy II

The second strategy abandons the consideration of the individual level lines within \(\mathcal{A}\); the only level line that is explicitly studied is the one through \(\boldsymbol{x}_{0}\) itself. Instead of the distorted Cartesian coordinate system one uses polar coordinates to describe the shape of the amoeba. This approach has first been used in [54] in the context of amoeba active contours (see Sect. 4.4.1), and again in [57, Section 4.1.2], both times restricted to the Euclidean amoeba metric. It has been extended to cover the full generality of amoeba metrics under consideration in [56], again for amoeba active contours.

Writing the outline of \(\mathcal{A}\) as a function a(α) of the polar angle α ∈ [0, 2π], the amoeba’s area is stated by the standard integral for areas enclosed by function graphs in polar coordinates as

$$\displaystyle{ \mathrm{Area}(\mathcal{A}) = \frac{1} {2}\int \limits _{0}^{2\pi }a(\alpha )^{2}\,\mathrm{d}\alpha \;. }$$
(4.13)

Unlike for (4.12), splitting this integral yields areas of sectors instead of segments; however, if the level line through \(\boldsymbol{x}_{0}\) happens to be a straight line, splitting up the integral (4.13) at the pair of opposite angles corresponding to the level line direction yields the areas of two segments into which \(\mathcal{A}\) is cut by that level line, compare Fig. 4.5a.

Fig. 4.5
figure 5

(a ) Amoeba with straight level line (dot-dashed) through its reference point \(\boldsymbol{x}_{0}\) and further radial lines (dashed) of a polar coordinate system centred at \(\boldsymbol{x}_{0}\). (b ) Area difference \(\Delta _{1}\) in an asymmetric amoeba with straight level lines. The hashed region is enclosed between the right arc of the amoeba contour and the point-mirrored copy of its left arc. (c ) Area difference \(\Delta _{2}\) in a symmetric amoeba with curved level lines. (b ), (c ) from [54]

Provided that \(\mathcal{A}\) is symmetric (w.r.t. point reflection at the reference point), the two segments are of equal area, making in this case the median equal to \(u(\boldsymbol{x}_{0})\). Deviations from this situation that make the median differ from \(u(\boldsymbol{x}_{0})\) can be separated into two contributions: first, the asymmetry of the amoeba; second, the curvature of the level lines. Cross-effects of the two contributions influence only higher order terms that can be neglected in the asymptotic analysis; thus the two sources can be studied independently. In approximating the area difference \(\Delta _{1}\) caused by the asymmetric amoeba shape, one can assume that the level lines are straight, see Fig. 4.5b, while the level line curvature effect \(\Delta _{2}\) can be studied under the assumption that \(\mathcal{A}\) has symmetric shape, see Fig. 4.5c.

Finally, the combined effect \(\Delta _{1} + \Delta _{2}\) must be compensated by a parallel shift of the level line through \(\boldsymbol{x}_{0}\), compare again Fig. 4.4a. From the shift the median, and thus the right-hand side of the PDE approximated by the amoeba filter, can be derived.

3.1.3 Amoeba Metrics and Edge-Stopping Functions

It remains to specify the relation between amoeba metric and edge-stopping function mentioned in Theorem 4.1. In [57, 58], the following representation of g in terms of the function ν defining the amoeba metric has been proven.

$$\displaystyle{ g(z) = \frac{3} {\beta ^{2}s^{2}\nu ^{3}(1/(\beta z))}\int \limits _{0}^{1}\xi ^{2}\sqrt{\nu ^{-2 } \left (\frac{1} {\xi } \,\nu \left (\frac{1} {\beta z}\right )\right ) - \frac{1} {\beta ^{2}z^{2}}\,}\,\mathrm{d}\xi \;, }$$
(4.14)

where ν −2(z) is short for (ν −1(z))2, i.e. the square of the inverse of ν, and ν 3(z) for the cube (ν(z))3.

In the case of the Euclidean amoeba metric, \(\nu (z) = \sqrt{1 + z^{2}}\), the expression (4.14) simplifies to

$$\displaystyle{ g(z) \equiv g_{2}(z) = \frac{1} {1 +\beta ^{2}z^{2}}\;, }$$
(4.15)

which is, up to the substitution λ = 1∕β, the Perona-Malik diffusivity [39] that is also one of the common choices for g in the self-snakes equation.

When using the L 1 amoeba metric, ν(z) = 1 + z, the integral in (4.14) can be numerically evaluated, and one obtains an edge-stopping function g(s) ≡ g 1(s) that differs from (4.15) in that it decreases away from g(0) = 1 already with nonvanishing negative slope, thus reacting more sensitive to even small image contrasts.

Finally, for the L amoeba metric, ν(z) = max{1, z}, it is again possible to state g in closed form,

$$\displaystyle{ g(z) \equiv g_{\infty }(z) = \left \{\begin{array}{@{}l@{\quad }l@{}} 1\;, \quad &\beta z \leq 1\;, \\ 1 -\left (1 - \frac{1} {\beta ^{2}z^{2}} \right )^{3/2}\;,\quad &\beta z> 1 \end{array} \right. }$$
(4.16)

which shows that g is completely insensitive to image contrasts up to z = 1∕β and then starts decreasing with a kink. All three edge-stopping functions are depicted in Fig. 4.6.

Fig. 4.6
figure 6

Edge-stopping functions g 1, g 2 and g associated to L 1, Euclidean and L amoeba metrics, respectively. Throughout these metrics, the contrast scale β has been set to 1

Fig. 4.7
figure 7

Grey-scale image (256 × 256 pixels) used to demonstrate non-adaptive and amoeba-based morphological filters

3.2 Dilation and Erosion

The two most fundamental operations of mathematical morphology, dilation and erosion, use as aggregation step the maximum and minimum of intensities, respectively. This can naturally be done also in combination with an amoeba-based pixel selection step (Fig. 4.7).

We point out that the standard dilation of an image u with fixed structuring element S can be written as

$$\displaystyle{ (u \oplus S)(i) =\max \limits _{j\in i+S}u(j) =\max \limits _{j\in \Omega }{\bigl (u(j) +\omega _{ S}^{-}(i - j)\bigr )}\;, }$$
(4.17)

where ω S denotes the function

$$\displaystyle{ \omega _{S}^{-}(k) = \left \{\begin{array}{@{}l@{\quad }l@{}} 0\;, \quad &-k \in S\;, \\ -\infty \;,\quad &\text{else.} \end{array} \right. }$$
(4.18)

The last term in (4.17) allows an interesting interpretation in terms of the max-plus algebra [3, 42], an algebraic structure on \(\mathbb{R} \cup \{ +\infty,-\infty \}\) in which the maximum operation takes the role of addition in the usual algebra of real numbers, while addition takes the role of multiplication. It is evident that (4.17) is nothing else but a convolution of u and ω S in the max-plus algebra, see [36].

In writing erosion in an analogous way, we follow a convention frequently used in the literature by using instead of the structuring element S the conjugate structuring element S , which comes down geometrically to a point reflection on the origin, S  = −S. The advantage of this convention is that subsequent definitions like those for opening and closing become simpler [24], compare Sect. 4.3.3.

Defining then \(\omega _{S^{{\ast}}}^{+}\) as zero on S, but + outside, erosion is stated as

$$\displaystyle{ (u \ominus S)(i) =\min \limits _{j\in j+S^{{\ast}}}u(j) =\min \limits _{j\in \Omega }{\bigl (u(j) +\omega _{ S^{{\ast}}}^{+}(i - j)\bigr )} =\min \limits _{ j\in \Omega }{\bigl (u(j) +\omega _{ S}^{+}(j - i)\bigr )}\;, }$$
(4.19)

which can be interpreted again as a convolution of u and \(\omega _{S^{{\ast}}}^{+}\) in the min-plus algebra [36].

Abandoning the fixed window and using a family \(\mathcal{S}:=\{ i\mapsto S(i)\ \vert \ i \in \Omega \}\) of structuring elements S(i) located at pixel i, one can write amoeba dilation as

$$\displaystyle\begin{array}{rcl} (u \oplus \mathcal{S})(i) =\max \limits _{j\in \Omega }{\bigl (u(j) +\omega _{ \mathcal{S}}^{-}(i,j)\bigr )}\;,& &{}\end{array}$$
(4.20)
$$\displaystyle\begin{array}{rcl} \omega _{\mathcal{S}}^{-}(i,j) = \left \{\begin{array}{@{}l@{\quad }l@{}} 0\;, \quad &j \in S(i)\;, \\ -\infty \;,\quad &\text{else.} \end{array} \right.& &{}\end{array}$$
(4.21)

Just as the last term in (4.17) is a max-plus convolution, the right-hand side (4.20) is the max-plus analogon of a (discretised) integral operator. Herein, \(\omega _{\mathcal{S}}^{-}(i,j)\) acts as the max-plus counterpart of just the same type of integral kernel that appears as point-spread function in space-variant image deconvolution models.

Similarly, amoeba erosion becomes a min-plus integral operator with a min-plus kernel \(\omega _{\mathcal{S}^{{\ast}}}^{+}(i,j) \equiv \omega _{\mathcal{S}}^{+}(j,i)\). Generally, conjugate structuring elements in the space-variant case are given by

$$\displaystyle{ S^{{\ast}}(i) =\{ j \in \Omega \ \vert \ i \in S(j)\}\;. }$$
(4.22)

Interestingly, if \(\mathcal{S}\) is made up by amoebas \(S(i) \equiv \mathcal{A}_{\varrho }(i)\), there is no difference whether the conjugate structuring elements \(\mathcal{S}^{{\ast}}\) or standard structuring elements \(\mathcal{S}\) are used in erosion: property (4.8) of the amoebas entails \(\omega _{\mathcal{S}}^{\pm }(j,i) =\omega _{ \mathcal{S}}^{\pm }(i,j)\) for all \(i,j \in \Omega\), or equivalently

$$\displaystyle{ \mathcal{A}_{\varrho }^{{\ast}}(i) \equiv \mathcal{A}_{\varrho }(i)\;. }$$
(4.23)

We will denote this property as self-conjugacy of amoebas.

Figure 4.7 shows the results of non-adaptive and amoeba dilation and erosion of an example image depicted in Fig. 4.8. Non-adaptive as well as amoeba-based dilation extend bright image details, but it can be seen that the spreading of bright image parts is stopped at strong edges; similarly for the propagation of dark details by erosion.

Fig. 4.8
figure 8

Morphological dilation and erosion, non-adaptive and amoeba-based, of the test image from Fig. 4.7. (a ) Non-adaptive morphological dilation with disk of radius ϱ = 5 as structuring element. (b ) Amoeba dilation with Euclidean amoeba metric, β = 0. 1, ϱ = 10. (c ) Non-adaptive morphological erosion with structuring element as in (a ). (d ) Amoeba erosion with amoeba parameters as in (b )

3.2.1 PDE Approximation

It is a well-known fact that Hamilton-Jacobi PDEs

$$\displaystyle{ u_{t} = \pm \vert \boldsymbol{\nabla }u\vert }$$
(4.24)

describe dilation (“+” case) and erosion (“−”) of continuous-scale images or level-set functions u in the sense that evolution of an initial image u(t = 0) = f by (4.24) up to time T = ϱ yields the dilation or erosion of f with a Euclidean ball-shaped structuring element of radius ϱ. It can therefore be expected that amoeba dilation and erosion, too, should be related to hyperbolic PDEs resembling (4.24). The following result from [57] confirms this intuition.

Theorem 4.2 ([57])

For a smooth function \(u: \Omega \rightarrow \mathbb{R}\) , one step of amoeba dilation or amoeba erosion with amoeba radius ϱ and Euclidean amoeba metric approximates for ϱ → 0 a time step of size τ = ϱ of an explicit time discretisation of the Hamilton-Jacobi-type PDE

$$\displaystyle{ u_{t} = \pm \frac{\vert \boldsymbol{\nabla }u\vert } {\sqrt{1 +\beta ^{2 } \,\vert \boldsymbol{\nabla }u\vert ^{2}}}\;, }$$
(4.25)

where the “+” sign applies for dilation, and “−” for erosion.

The proof of this result can be found in [57]; it is based on Proof Strategy I from Sect. 4.3.1.2.

Note that unlike in Theorem 4.1 the time step size here depends linearly, not quadratically, on ϱ. In [57] the theorem is formulated slightly more general to cover also amoeba α-quantile filters that interpolate in a natural way between median filtering (α = 1∕2), dilation (α = 1) and erosion (α = 0). As a result of the different order of decay of τ for ϱ → 0, it comes as no surprise that for α ≠ 1∕2 always the advection behaviour of the Hamilton-Jacobi equation (4.25) dominates over the parabolic equation (4.10), thus turning quantile filters into “slower” approximations to the same PDE.

3.3 Opening and Closing

In mathematical morphology, the opening of an image f with (fixed) structuring element S is defined as the concatenation of an erosion followed by a dilation with S. In case S is not point-symmetric it is essential that, as mentioned in Sect. 4.3.2, the conjugate structuring element S is used in the erosion step. Opening therefore reads as

$$\displaystyle{ (\,f \circ S)(i) ={\bigl ( (\,f \ominus S) \oplus S\bigr )}(i) =\max \limits _{j\in \Omega }\ \min \limits _{k\in \Omega }\ {\bigl (\,f(k) +\omega _{ S^{{\ast}}}^{+}(j - k) +\omega _{ S}^{-}(i - j)\bigr )}\;. }$$
(4.26)

Analogously, closing is defined as dilation followed by erosion,

$$\displaystyle{ (\,f\bullet S)(i) ={\bigl ( (\,f \oplus S) \ominus S\bigr )}(i) =\min \limits _{j\in \Omega }\ \max \limits _{k\in \Omega }\ {\bigl (\,f(k) +\omega _{ S}^{-}(j - k) +\omega _{ S^{{\ast}}}^{+}(i - j)\bigr )}\;. }$$
(4.27)

Again, it is straightforward to turn these operations into adaptive variants by using amoeba structuring elements. Amoeba opening and closing of image f with amoebas of radius ϱ are given as

$$\displaystyle\begin{array}{rcl} f \circ \mathcal{S}_{\varrho }(\,f)& ={\bigl (\, f \ominus \mathcal{S}_{\varrho }(\,f)\bigr )} \oplus \mathcal{S}_{\varrho }(\,f)\;,&{}\end{array}$$
(4.28)
$$\displaystyle\begin{array}{rcl} f\bullet \mathcal{S}_{\varrho }(\,f)& ={\bigl (\, f \oplus \mathcal{S}_{\varrho }(\,f)\bigr )} \ominus \mathcal{S}_{\varrho }(\,f)&{}\end{array}$$
(4.29)

where \(\mathcal{S}_{\varrho }(\,f) =\{ i\mapsto \mathcal{A}_{\varrho }(\,f;i)\ \vert \ i \in \Omega \}\).

It is worth noticing that the difficulty about using the conjugate set of structuring elements for erosion disappears here due to the self-conjugacy (4.23) of the amoeba structuring element set.

As it is essential to use the same set of structuring elements in the dilation and erosion step, both steps must be carried out with the amoebas obtained from the original image. The underlying principle is that in the second step (dilation for opening or erosion for closing) each pixel should influence exactly those pixels which have influenced it in the first step before. As a consequence, e.g. amoeba opening is not exactly the same as amoeba erosion followed by amoeba dilation – this sequence would be understood by default as recalculating amoebas after the erosion step, i.e. 

$$\displaystyle\begin{array}{rcl} {\bigl (\,f \ominus \mathcal{S}_{\varrho }(\,f)\bigr )} \oplus \mathcal{S}_{\varrho }{\bigl (\,f \ominus \mathcal{S}_{\varrho }(\,f)\bigr )}\;,& &{}\end{array}$$
(4.30)

which is inappropriate for an opening operation.

Fig. 4.9
figure 9

Non-adaptive and amoeba-based morphological closing and opening applied to the test image from Fig. 4.8. (a ) Non-adaptive closing with disk-shaped structuring element of radius ϱ = 5. (b ) Amoeba closing with Euclidean amoeba metric, β = 0. 1, ϱ = 10. (c ) Non-adaptive opening with structuring element as in (a ). (d ) Amoeba opening with amoeba parameters as in (b )

In Fig. 4.9 exemplary results of non-adaptive and amoeba-based closing and opening of the test image from Fig. 4.7 are shown. Like its non-adaptive counterparts, amoeba-based closing and opening remove small-scale dark or bright details, respectively. However, the amoeba versions do this in a less aggressive way. Extended narrow structures that are often removed partially by the non-adaptive filters are more often preserved as a whole, with reduced contrast, or removed completely by the amoeba filters, see e.g. the roof front edge descending to the right from the chimney, and the acute roof corner separating it from the sky.

3.3.1 Opening and Closing Scale Spaces and PDEs

The association between median, dilation and erosion filters and PDEs is inherently related to the scale space structures of these filters, compare [25]. All of these filters form an additive semi-group in the sense that iterative application of the same filter yields an increasing filter effect that naturally adds up over iteration numbers. In the case of dilation and erosion iteration numbers are also in linear relation with increasing structuring element size, as dilating an initial image n times with (non-adaptive) structuring element radius ϱ is equivalent to dilating once with radius n ϱ. Such an additive semi-group structure perfectly matches initial value problems for PDEs in which, too, evolution times add up.

While opening and closing, too, have a scale space structure, their semi-group operation is not additive but supremal as it is based on taking the maximum of parameters. For example, repeating the same opening or closing operation on a given image just reproduces the result of the first application of the filter (i.e., opening and closing operators are idempotent); and concatenating two openings or two closings with structuring element radii ϱ 1, ϱ 2 gives an opening or closing with radius max{ϱ 1, ϱ 2}.

For this reason, also amoeba opening and closing are not associated with PDE evolutions in the same way as the previous filters. Possible relations to PDE-based filters may be considered in future research.

4 Grey-Scale Segmentation

Following established terminology, image segmentation denotes the task to decompose a given image into regions that are in the one or other way homogeneous in themselves but different from each other, with the intention that these regions are meaningful in that they are associated to objects being depicted. Intensity-based segmentation uses intensity as the main criterion of homogeneity within and dissimilarity between segments. Specialising to the case of two segments (foreground and background) with the additional geometric hypothesis that segments are separated by sharp and smooth contours, contour-based segmentation approaches based on curve or level set evolutions lend themselves as tools for segmentation, with active contours as an important representative. In this section we show how amoeba algorithms can be made useful in this context.

Despite the fact that experiments on magnetic resonance data are used to illustrate the concepts in this section, this is not meant to make a claim that neither active contour nor the related active region methods (which are not discussed further here) in their pure form could serve as a state-of-the-art segmentation method for medical images. In fact, competitive results in medical image segmentation are nowadays achieved by complex frameworks that often include active contours and/or active regions as a component but in combination with additional techniques that allow to bring in anatomical knowledge such as shape and appearance models [11]. An early representative of these frameworks is [34], which has been followed by many more since then. Like classical geodesic active contours, the amoeba active contours presented in the following could be integrated into this type of framework but this has not been done so far.

4.1 Amoeba Active Contours

The standard procedure of an active contour, or snake, method starts with some initial contour which may be obtained automatically from some previous knowledge or heuristics regarding the position of a sought structure, or from human operator input. Representing this contour either by a sampled curve or by a level-set function, it is then evolved up to a given evolution time or up to a steady state by the action of some parabolic PDE, which is often derived as a gradient descent of a segmentation energy in the image plane. An important representative are geodesic active contours (GAC) [9, 30]. Their segmentation energy is essentially a curve length measure of the contour in a modified metric on the image plane that favours placing the contour in high-contrast locations. The PDE for GAC in level-set representation reads

$$\displaystyle{ u_{t} =\vert \boldsymbol{ \nabla }u\vert \,\mathrm{div}\left (g{\bigl (\vert \boldsymbol{\nabla }f\vert \bigr )}\,\frac{\boldsymbol{\nabla }u} {\vert \boldsymbol{\nabla }u\vert }\right )\;. }$$
(4.31)

Herein, u is the evolving level-set function in the plane that represents the actual evolving contour as one of its level sets (by default, the zero-level set), and f is the invariable image being segmented. The similarity of (4.31) to self-snakes (4.11) (which were actually inspired from active contours, thus the name) together with the link between amoeba median filtering and self snakes established by Theorem 4.1 suggest that an amoeba median approach could be used to evolve the level set function u instead of equation (4.31).

Introduced in [53], the resulting amoeba active contour (AAC) algorithm proceeds as follows:

  1. 1.

    Compute amoeba structuring elements based on the input image f.

  2. 2.

    Initialise the evolving level-set function u to represent the initial contour.

  3. 3.

    Evolve the image u by median filtering with the amoebas from Step 1 as structuring elements.

Results from this algorithm look qualitatively fairly similar to those from GAC, as will also be demonstrated later in this section.

4.2 PDE Approximation

In order to study the relation between AAC and GAC, it makes sense again to consider a space-continuous model and to investigate the PDE approximated by AAC in the case of vanishing amoeba radius. The following result was proven in [56]. Note that in this theorem the contrast scale parameter β is fixed to 1 for simplicity, which, however, is no restriction of the result because in the active contour setting in question, the case β ≠ 1 is easily mapped to β = 1 by just scaling the intensities of image f by β.

Theorem 4.3 ([56])

Let a smooth level-set function u be filtered by amoeba median filtering, where the amoebas are generated from a smooth image f. Assume that the amoeba metric is given by (4.9), (4.2) with β = 1. One step of this filter for u then approximates for ϱ → 0 a time step of size τ = ϱ 2 ∕6 of an explicit time discretisation of the PDE

$$\displaystyle\begin{array}{rcl} u_{t} = G\,u_{\boldsymbol{\xi \xi }} -\vert \boldsymbol{\nabla }u\vert \cdot {\bigl ( H_{1}\,f_{\boldsymbol{\chi \chi }} + 2H_{2}\,f_{\boldsymbol{\chi \eta }} + H_{3}\,f_{\boldsymbol{\eta \eta }}\bigr )}& &{}\end{array}$$
(4.32)

with the coefficients given by

$$\displaystyle\begin{array}{rcl} G \equiv G\bigl (\vert \boldsymbol{\nabla }f\vert,\alpha ) = \frac{1} {\nu \bigl (\vert \boldsymbol{\nabla }f\vert \sin \alpha \bigr )^{2}}\;,& &{}\end{array}$$
(4.33)
$$\displaystyle\begin{array}{rcl} & & \!\!\left (\begin{array}{*{10}c} H_{1} & H_{2} \\ H_{2} & H_{3} \end{array} \right ) \equiv \left (\begin{array}{*{10}c} H_{1}\bigl (\vert \boldsymbol{\nabla }f\vert,\alpha )\ \ &H_{2}\bigl (\vert \boldsymbol{\nabla }f\vert,\alpha ) \\ H_{2}\bigl (\vert \boldsymbol{\nabla }f\vert,\alpha )\ \ &H_{3}\bigl (\vert \boldsymbol{\nabla }f\vert,\alpha ) \end{array} \right ) \\ & & = \frac{3} {2}\,\nu \bigl (\vert \boldsymbol{\nabla }f\vert \sin \alpha \bigr )\int \limits _{\alpha -\pi /2}^{\alpha +\pi /2} \frac{\nu '\bigl (\vert \boldsymbol{\nabla }f\vert \sin \vartheta \bigr )} {\nu \bigl (\vert \boldsymbol{\nabla }f\vert \sin \vartheta \bigr )^{4}}\left (\begin{array}{*{10}c} \cos ^{2}\vartheta & \sin \vartheta \cos \vartheta \\ \sin \vartheta \cos \vartheta & \cos ^{2}\vartheta \end{array} \right )\,\mathrm{d}\vartheta \;. {}\end{array}$$
(4.34)

Here, \(\boldsymbol{\eta }=\boldsymbol{ \nabla }u/\vert \boldsymbol{\nabla }u\vert\) and \(\boldsymbol{\xi }\perp \boldsymbol{\eta }\) are unit vectors in gradient and level line direction, respectively, for u, whereas \(\boldsymbol{\chi }=\boldsymbol{ \nabla }f/\vert \boldsymbol{\nabla }f\vert\) and \(\boldsymbol{\zeta }\perp \boldsymbol{\chi }\) are the corresponding unit vectors for f, and \(\alpha = \angle (\boldsymbol{\eta },\boldsymbol{\chi })\) is the angle between both gradient directions.

The proof of this result is found for the case of the Euclidean amoeba metric in [54], and for general amoeba metric in [56]. It relies on Proof Strategy II from Sect. 4.3.1.2.

Fig. 4.10
figure 10

Amoeba and geodesic active contour segmentation. (a ) Detail (70 × 70 pixels) from an MR slice of a human brain with initial contour enclosing the cerebellum. (b ) Amoeba active contours with Euclidean amoeba metric, β = 0. 1, ϱ = 12, 10 iterations. (c ) Amoeba active contours with L 1 amoeba metric, β = 0. 1, ϱ = 12, 60 iterations. (d ) Geodesic active contours with Perona-Malik edge-stopping function, λ = 10, 960 iterations of explicit scheme with time step size τ = 0. 25 (From [53, 56])

An attempt to analyse AAC using Proof Strategy I had been made in [53], where, however, only a special case was successfully treated: The theorem proven in [53] states that AAC approximates the GAC equation (4.31) if image f and level set function u are rotationally symmetric about the same centre.

In fact, the rotational symmetry hypothesis can be weakened; what is needed for (4.32), (4.33) and (4.34) to reduce to the exact GAC equation is actually, whenever α = 0 (thus, η = χ, ξ = ζ), \(u_{\boldsymbol{\xi \eta }} = f_{\boldsymbol{\xi \eta }} = 0\) and \(u_{\boldsymbol{\xi \xi }}/\vert \boldsymbol{\nabla }u\vert = f_{\boldsymbol{\xi \xi }}/\vert \boldsymbol{\nabla }f\vert\) hold, (4.32), (4.33) and (4.34) boil down to the GAC equation (4.31).

At first glance, this is still a very artificial choice; however, looking at the geometrical implications of this setting, one sees that it means that the level lines of u are aligned to those of f, have the same curvature, and the image contrast in both f and u does not change along these level lines. Thereby the hypothesis of this special case is well approximated in the near-convergence stage of a segmentation process when the object–background contrast is more or less uniform along the contour.

As a consequence, the coincidence of AAC and GAC in this case justifies that both approaches can expected to yield very similar types of segmentations. The convergence behaviour towards these segmentations may differ more; a closer comparison of both PDEs in [54, 56] based on typical geometric configurations indicates that the amoeba active contour PDE drives contours toward image contours in a more pronounced way.

Figure 4.10 presents an example that confirms the overall similarity between amoeba and geodesic active contours but also the tendency of AAC to adapt more precise to very small-scaled edge details. Frame (a) shows the original image with an initial contour roughly enclosing the cerebellum. Frames (b) and (c) demonstrate segmentation by AAC with Euclidean and L 1 amoeba metrics, respectively, while Frame (d) shows a GAC result for comparison.

4.3 Force Terms

Geodesic active contours in their basic form (4.31) suffer from some limitations. First of all, when initialised with a contour enclosing a large area with one or several small objects inside, the active contour process spends plenty of evolution time to slowly move the contour inwards until it hits an object boundary, due to the initially small curvature of the contour. Secondly, for pronounced concave object geometries, the process tends to lock in at undesired local minima that detect well some convex contour parts but short-cut concave parts via straight line segments. Similar problems can occur when segmenting multiple objects within one initial contour, see the examples in [31]. Thirdly, as the basic curvature motion process involves only inward movement of contours, it is generally not possible with (4.31) to segment objects from initial contours inside the object, which is sometimes desirable in applications. Due to their similarity to GAC, amoeba active contours share these problems.

A common remedy for these problems in the literature on active contour segmentation is the introduction of a force term. Its typical form is \(\pm \gamma \vert \boldsymbol{\nabla }u\vert\), i.e. essentially the right-hand side of a Hamilton-Jacobi PDE for dilation or erosion, compare (4.24). An erosion force accelerates the inward motion of the contour; it allows to get past homogeneous areas faster, and helps the contour to find concave object boundaries and to separate multiple objects. By a dilation force it is possible to push the contour evolution in outward direction, which makes it possible to use initial contours inside objects.

In both cases, however, the force strength needs careful adjustment because dilation or erosion may also push the contour evolution across object boundaries, thereby preventing their detection.

In [10] where this modification was proposed first (by the name of “balloon force”), γ was chosen as constant, but the possibility to steer it contrast-dependent, was mentioned. This has been done in [9, 31, 35] by modulating the force term in a geodesic active contour model with the same edge-stopping function g, such that the entire force term reads as \(\pm \gamma \,g(\vert \boldsymbol{\nabla }f\vert )\,\vert \boldsymbol{\nabla }u\vert\) with constant γ.

The relation between amoeba quantile filters and Hamilton-Jacobi PDEs mentioned in Sect. 4.3.2 indicates how to achieve a similar modification in the amoeba active contour algorithm: the median filter step should be biased, basically by replacing the median with some quantile. The most obvious way to do this is to use the α-quantile with a fixed α ≠ 1∕2. Within a discrete amoeba containing p pixels, this means to choose the value ranked α p in the ordered sequence of intensities. However, taking into account that the amoeba size p (or the amoeba area in the continuous setting) varies even for fixed ϱ with local image contrast, it is not less natural to think of α as varying with the amoeba size. If one chooses α − 1∕2 inversely proportional to the amoeba size, this comes down to modify the median with a fixed rank offset b, such that in an amoeba of p pixels one would choose the intensity value with rank p∕2 + b. These two variants of the AAC algorithm have been proposed in [53]. In [56] a third variant (“quadratic bias”) was introduced which chooses from the rank order the element with index p∕2 + rp 2 with fixed r. For these three scenarios, further analysis was provided in [56], based on the Euclidean amoeba metric. We summarise the results here.

4.3.1 Fixed Offset Bias

Choosing the entry at position p∕2 + b from the rank order approximates a force term \(+\gamma _{b}\,\vert \boldsymbol{\nabla }u\vert \,\nu (\vert \boldsymbol{\nabla }f\vert \,\sin \alpha )\) with γ b  ∼ b. Note that in the symmetric case in which the PDE approximated by AAC coincides with the GAC equation this becomes exactly the “balloon force” term with constant dilation/erosion weight from [10].

4.3.2 Quantile Bias

Choosing the element with index p∕2 + qp from the rank order within each amoeba approximates a force term \(+\gamma _{q}\,\vert \boldsymbol{\nabla }u\vert \,\sqrt{(1 +\vert \boldsymbol{ \nabla }f\vert ^{2 } \sin ^{2 } \alpha )/(1 +\vert \boldsymbol{ \nabla }f\vert ^{2 } )}\) with γ q  ∼ q. In the rotationally symmetric case this term lies between the constant weight of [10] and the g-weight from [31].

4.3.3 Quadratic Bias

Choosing the entry at index p∕2 + rp 2 from the rank order of intensities yields an approximated force term \(+\gamma _{r}\,\vert \boldsymbol{\nabla }u\vert \,\nu (\vert \boldsymbol{\nabla }f\vert )/\nu (\vert \boldsymbol{\nabla }f\vert )^{2}\). In the rotationally symmetric case this corresponds to the g-weight from [31].

To illustrate amoeba active contours with bias, Fig. 4.11 presents an example (shortened from [56]). Frame (a) is a test image with initial contour inside a mostly homogeneous object (the corpus callosum). Figure 4.11b, c then show contours computed by amoeba active contours with fixed offset bias for two different evolution times, one intermediate, one displaying the final segmentation. For comparison, a segmentation with geodesic active contours is shown in (d).

We remark that in the AAC examples, a few pixels within the corpus callosum region are excluded from the segment, see the small isolated contour loops there. This is not a numerical artifact but a result from the precise adaption of amoebas to image structures even up to the resolution limit (pixel precision) of the image – the pixels not included in the segment are noise pixels with intensities significantly deviating from the neighbourhood, which are simply not included in any amoeba of outside pixels. Modifications like presmoothing input images can be applied to avoid this. On the contrary, the absence of such difficulties in the GAC example is a beneficial effect of the otherwise often undesirable numerical blurring effect of the finite-difference scheme.

Fig. 4.11
figure 11

Segmentation with initialisation inside the sought object by amoeba and geodesic active contours with dilation force. (a ) Detail (164 × 114 pixels) from an MR slice of human brain with initial contour placed inside the corpus callosum. (b ) Amoeba active contour evolution with Euclidean amoeba metric, β = 2, ϱ = 20, fixed offset bias b = 10, and 20 iterations. (c ) Same as in (b ) but 35 iterations. (d ) Geodesic active contours with Perona-Malik edge-stopping function, λ = 0. 5, dilation force γ = −0. 16 (multiplied with the edge-stopping function) and erosion force γ c = 5 × 10−4 (independent of the edge-stopping function), explicit scheme with time step size τ = 0. 25, 18,960,000 iterations (From [56])

5 Pre-smoothing in Self-Snakes and Amoeba Filters

The approximation result of Theorem 4.1 associates iterated amoeba median filtering with the self-snakes equation (4.11). Unlike (mean) curvature motion (4.10), self-snakes possess edge-enhancing properties. Rewriting (4.11) by the product rule, one can state the self-snakes process as

$$\displaystyle{ u_{t} = g{\bigl (\vert \boldsymbol{\nabla }u\vert \bigr )}\,\vert \boldsymbol{\nabla }u\vert \,\mathrm{div}\left (\frac{\boldsymbol{\nabla }u} {\vert \boldsymbol{\nabla }u\vert }\right ) +\langle \boldsymbol{ \nabla }g,\boldsymbol{\nabla }u\rangle }$$
(4.35)

in which the first summand is just a curvature motion process modulated by g, whereas the second, advective, term is responsible for the edge-enhancing behaviour. Unfortunately, this term has a shock-filter property which makes not only its numerical treatment difficult – in finite difference schemes usually an upwind discretisation will be required to approximate it – but even entails ill-posedness of the PDE itself that is reflected in a noticeable staircasing behaviour. Indeed, as demonstrated by an experiment in [58], the result of a numerical computation of a self-snakes evolution differs significantly if the underlying grid resolution is changed.

A common remedy to this ill-posed behaviour is to use pre-smoothing in the argument of the edge-stopping function, i.e. to replace \(g(\vert \boldsymbol{\nabla }u\vert )\) in (4.11) or (4.35) by \(g(\vert \boldsymbol{\nabla }u_{\sigma }\vert )\) where u σ is the result of convolving u with a Gaussian of standard deviation σ. Thereby, the ill-posedness of self-snakes is removed, and a stable filtering achieved, at the cost of the additional smoothing-scale parameter σ.

In this section, we deal with the question whether this staircasing phenomenon has also an analogue in the amoeba median filtering context, and what is an appropriate counterpart for the pre-smoothing modification on the amoeba side. This is done by quantitative analysis of a synthetic example, the first part of which has been published before in [54, 57].

5.1 Pre-smoothing in Amoeba Median Filtering, and Amoeba Radius

First of all, notice that a straightforward translation of the pre-smoothing procedure to the amoeba median filtering context is to use u σ in place of u when computing the structuring elements in an amoeba median filtering step. This is actually an instance of the generalised amoeba median filtering procedure of the amoeba active contour setting, Sects. 4.4.1 and 4.4.2, such that the PDE approximation result from Theorem 4.3 can be applied to see that it would approximate a PDE which is not identical to the standard self-snakes with pre-smoothing, but closely related to it.

At second glance, however, it can be questioned whether the introduction of the smoothing-scale parameter σ into the amoeba median filter is necessary. Unlike finite-difference schemes for self-snakes, amoeba filtering by construction already involves a very similar smoothing-scale parameter, namely, the amoeba radius ϱ. One can conjecture that the positive ϱ necessarily used in any amoeba computation could already provide a pre-smoothing effect similar to the Gaussian convolution in the PDE setting. This conjecture will be investigated in the following.

Fig. 4.12
figure 12

Schematic representation of example functions used in the perturbation analysis, Sect. 4.5.2. (a ) Graph \(\Gamma _{0}\) of unperturbed function u 0 = x, with a Euclidean ϱ-disk whose projection to the x-y plane yields an amoeba. (b ) Graph \(\Gamma\) of a function u of type (4.36) including a gradient-aligned perturbation. (c ) Graph \(\Gamma\) of a function u of type (4.39) including a level-line-aligned perturbation. (d ) Cut in x direction through the graph \(\Gamma\) from (c ) and the unperturbed graph \(\Gamma _{0}\) from (a ). The sketch includes further the amoeba \(\mathcal{A}\) around (x 0, y 0), the corresponding Euclidean disk \(\mathcal{A}^{{\ast}}\) on \(\Gamma\) and the projection \(\mathcal{A}'\) of \(\mathcal{A}^{{\ast}}\) to \(\Gamma _{0}\) which is centred at (x 0′, y 0)

5.2 Perturbation Analysis of Test Cases

The starting point for constructing the test cases is a simple slope function that would be stationary under both self-snakes and amoeba median filter evolutions, see Fig. 4.12a. From this slope, described by the function \(u_{0}: \mathbb{R}^{2} \rightarrow \mathbb{R}\), u 0(x, y) = x, test cases are derived by adding small single-frequency oscillations such as \(\varepsilon \cos \langle \boldsymbol{k},\boldsymbol{x}\rangle\) with frequency vectors \(\boldsymbol{k}\).

Given the nonlinear nature of the filters under investigation, there is no superposition property for the effects of different perturbations of u 0. Nevertheless, interactions between u 0 and the perturbations are always of higher order \(\mathcal{O}(\varepsilon ^{2})\), such that the analysis of the first-order effects of perturbations still gives a useful intuition about the behaviour of the filters.

5.2.1 Test Case 1: Gradient-Aligned Oscillation

For the first test case, see [54, 57], the perturbation frequency is aligned with the gradient direction, \(\boldsymbol{k} = (k,0)\), yielding the input signal schematically depicted in Fig. 4.12b,

$$\displaystyle{ u(x,y) = x +\varepsilon \cos (kx)\;,\quad \varepsilon <\!\!<1\;. }$$
(4.36)
5.2.1.1 Self-Snakes Analysis

To determine the response of the self-snakes evolution (4.35) to the perturbed signal (4.36), notice first that level lines of (4.36) are straight and parallel, such that one has \(\mathrm{div}(\boldsymbol{\nabla }u/\vert \boldsymbol{\nabla }u\vert ) \equiv 0\) and \(\langle \boldsymbol{\nabla }g,\boldsymbol{\nabla }u\rangle = g_{x}u_{x}\). Further, one has u x  = 1 −ɛksin(kx) and \(g_{x} =\varepsilon \, k^{2}\cos (kx)/2 + \mathcal{O}(\varepsilon ^{2})\), finally turning (4.35) into

$$\displaystyle{ u_{t} = g_{x}u_{x} = \frac{1} {2}\,k^{2}\varepsilon \cos (kx) + \mathcal{O}(\varepsilon ^{2})\;. }$$
(4.37)

From this it can be read off that a frequency response factor k 2∕2 occurs that grows indefinitely for high frequencies. Since the nonlinearity of (4.35) instantaneously spreads out the single perturbation frequency k to higher harmonics, arbitrarily high amplification appears already within short evolution time, and the regularity of the evolving function is lost. This explains the stair-casing behaviour of self-snakes without pre-smoothing.

Using pre-smoothed u σ in the edge-stopping function argument, one has instead x u σ  = x +ɛ exp(−k 2 σ 2∕2) cos(kx), g x  = k 2 ɛ exp(−k 2 σ 2∕2) cos(kx)∕2 and therefore

$$\displaystyle{ u_{t} = \frac{1} {2}\,k^{2}\varepsilon \,\exp \left (-\frac{k^{2}\sigma ^{2}} {2} \right )\cos (kx) + \mathcal{O}(\varepsilon ^{2})\;, }$$
(4.38)

with the frequency response factor k 2exp(−k 2 σ 2∕2)∕2 that is globally bounded with its maximum at \(k = \sqrt{2}/\sigma\). Therefore, pre-smoothing ensures that the regularity of the evolving function is maintained.

5.2.1.2 Amoeba Filter Analysis

To analyse the effect of amoeba median filtering (with Euclidean amoeba metric) on the function (4.36), consider an amoeba of amoeba radius ϱ around (x 0, y 0), and assume that the contrast scale is chosen as β = 1. The median of u within that amoeba can be expressed via an integral formula, see [54, 57], which can be numerically evaluated to be approximately equal to u(x 0, y 0) +δ(k) ⋅ ɛcos(kx 0) with a frequency response factor δ(k). In other words, one amoeba median filter step amplifies the perturbation uu 0 of (4.36) versus u 0(x, y) = x by the amplification factor λ(k): = 1 +δ(k).

Figure 4.13 shows results of numerical approximation of one amoeba median filtering step with β = 1, ϱ = 1, on test images of type (4.36) with two different frequencies k. The numerical computation was carried out on a discrete grid with mesh size h = 0. 0025. For best approximation to the space-continuous case, amoeba distances between pixels were computed by numerical integration instead of the Dijkstra search on the pixel graph. Denoting the filtered image by v, numerical amplification factors can be computed as 〈vu 0, uu 0〉∕〈uu 0, uu 0〉 (with the usual scalar product of functions on a suitable bounded interval); these are in good accordance with the theoretical result.

Fig. 4.13
figure 13

Numerical computation results for the amplification of a gradient-aligned perturbation of a linear slope function by one amoeba median filtering step. Top row shows k = 5, bottom row k = 10. Graphs in left column show unperturbed function u 0, perturbed input function u, and filter result v; graphs in right column show perturbations uu 0 and vu 0. Horizontal axes represent x, vertical axes represent function values. Computations were carried out on a grid with mesh size 0. 0025

Figure 4.14 shows the amplification function λ(k) for ϱ = 1 together with its counterpart λ s(k): = 1 + 1∕6 ⋅ k 2exp(−k 2 σ 2∕2)∕2 for one time step of self-snakes with pre-smoothing, with the time step size ϱ 2∕6 = 1∕6 matching the amoeba radius according to Theorem 4.1. The figure also includes numerical amplification factors for amoeba median filtering with the same parameters for frequencies k = 1, 2, , 30. The parameter σ = 0. 268 in the self-snakes case has been chosen for a good match to the first wave of δ(k). With this parameter, the amplification behaviour for frequencies up to approx. 10 is very similar for the pre-smoothed self-snakes equation and amoeba median filtering. However, for higher frequencies the amplification factor of pre-smoothed self-snakes rapidly approaches one (no amplification) whereas it oscillates around 3∕2 for the amoeba filter.

As a result, oscillations with sufficiently high frequency are just almost not amplified in the pre-smoothed self-snakes evolution. With amoeba median filtering, they are amplified by the globally bounded factor λ(k) in each iteration step. Whatever ɛ was in the initial image u from (4.36), after a finite number of iterations the oscillations grow to a level for which the hypothesis ɛ < ​​ < 1 of our analysis is no longer valid. Even in the space-continuous setting under consideration, oscillations cannot actually grow infinitely because the median operation obeys the maximum–minimum principle.

In practice, amoeba filters are computed in a space-discrete setting such that the effective range of spatial frequencies (parametrised by the angular frequency k of oscillations) is limited by the sampling theorem. For fixed amoeba radius ϱ = 1 as in Fig. 4.14, the relevant range of frequencies is determined by the mesh size of the pixel grid. If this mesh size is not below approx. π∕10, the higher lobes of the amplification function λ(k) that make up the difference to self-snakes with pre-smoothing do not take effect at all. Translating this to a grid with mesh size 1, as common in image processing, this means that for amoeba radius ϱ up to approx. 10∕π ≈ 3 the frequency response of amoeba median filtering does almost not differ from that of self-snakes with pre-smoothing.

Fig. 4.14
figure 14

Amplification of a gradient-aligned perturbation of a linear slope function by one amoeba median filtering step (theoretical and numerical values) and a corresponding time step of an explicit scheme for self-snakes with pre-smoothing (Adapted and extended from [54])

5.2.2 Test Case 2: Level-Line-Aligned Oscillation

To complement the perturbation analysis of gradient-aligned oscillations, a second test case is considered in which the perturbation frequency is aligned with the level line direction, \(\boldsymbol{k} = (0,k)\). The resulting input signal, compare the schematic representation in Fig. 4.12c, reads

$$\displaystyle{ u(x,y) = x +\varepsilon \cos (ky)\;,\quad \varepsilon <\!\!<1\;. }$$
(4.39)

This test case was not presented in [54, 57]. Given that self-snakes act smoothing along level line direction, it can be expected that this kind of perturbation is dampened by their evolution. This will be confirmed by the analysis, and the corresponding behaviour of the amoeba median filter will be stated.

5.2.2.1 Self-Snakes Analysis

Unlike for the first test case, gradient directions of u now vary across the image range, combining constant u x  = 1 with u y  = −k ɛsin(ky). Accordingly, the edge-stopping function takes the values

$$\displaystyle{ g(x,y) = \frac{1} {2 + k^{2}\varepsilon ^{2}\sin ^{2}(ky)} = \frac{1} {2}\left (1 -\frac{k^{2}\varepsilon ^{2}} {2} \sin ^{2}(ky)\right ) + \mathcal{O}(\varepsilon ^{3}) }$$
(4.40)

and thereby \(g_{x}(x,y) = \mathcal{O}(\varepsilon ^{3})\), \(g_{y}(x,y) = -k^{3}\varepsilon ^{2}\sin (ky)\cos (ky)/2 + \mathcal{O}(\varepsilon ^{3})\).

This leads further to

$$\displaystyle\begin{array}{rcl} \vert \boldsymbol{\nabla }u\vert & =& 1 + \frac{k^{2}\varepsilon ^{2}} {2} \sin ^{2}(ky) + \mathcal{O}(\varepsilon ^{4})\;,{}\end{array}$$
(4.41)
$$\displaystyle\begin{array}{rcl} \mathrm{div}\left (\frac{\boldsymbol{\nabla }u} {\vert \boldsymbol{\nabla }u\vert }\right )& =& \partial _{x}\left (1 -\frac{k^{2}\varepsilon ^{2}} {2} \sin ^{2}(ky)\right ) + \partial _{ y}{\bigl ( - k\varepsilon \sin (ky)\bigr )} + \mathcal{O}(\varepsilon ^{3}) \\ & =& -k^{2}\varepsilon \cos (ky) + \mathcal{O}(\varepsilon ^{2})\;, {}\end{array}$$
(4.42)
$$\displaystyle\begin{array}{rcl} \langle \boldsymbol{\nabla }g,\boldsymbol{\nabla }u\rangle & =& \mathcal{O}(\varepsilon ^{3})\;,{}\end{array}$$
(4.43)

thus after inserting into (4.35)

$$\displaystyle{ u_{t} = -\frac{1} {2}k^{2}\varepsilon \cos (ky) + \mathcal{O}(\varepsilon ^{2}) }$$
(4.44)

which confirms by the negative sign of the frequency response factor − k 2∕2 that the perturbation is smoothed out by the self-snakes process.

Pre-smoothing here leads to

$$\displaystyle{ g(x,y) = \frac{1} {2}\,\left (1 -\frac{k^{2}\varepsilon ^{2}} {2} \exp (-k^{2}\sigma ^{2})\sin ^{2}(ky)\right ) + \mathcal{O}(\varepsilon ^{3})\;, }$$
(4.45)

which in the further course of the calculation only influences higher-order terms, such that (4.44) is replicated.

Remark on explicit time discretisations. A difference to the first test case to be noted here is that the negative amplification factor does not depend on σ. This implies a time step size limit for explicit time discretisations of pre-smoothed self-snakes: With k denoting the highest perturbation frequency that can occur in the discretised image, given by the Nyquist frequency of the grid (k = π for spatial mesh size h = 1), the amplification factor λ s(k): = 1 −τk 2∕2 within a single time step of size τ must not become − 1 or lower, thus τ < 4∕k 2 must be observed.

5.2.2.2 Amoeba Filter Analysis

To determine the response of an amoeba median filter step to the perturbation (4.39), we consider again Euclidean amoeba metric and β = 1. The image graph \(\Gamma =\{ (x,y,u(x,y))\ \vert \ (x,y) \in \mathbb{R}^{2}\}\) of (4.39), compare Sect. 4.2.4, is a developable surface. The amoeba structuring element \(\mathcal{A}\) around (x 0, y 0) then is the projection of a bent Euclidean ϱ-disk \(\mathcal{A}^{{\ast}}\) affixed to \(\Gamma\) to the image plane, compare Fig. 4.12c.

The orthogonal projection \(\mathcal{A}'\) of the same bent ϱ-disk \(\mathcal{A}^{{\ast}}\) not to the image plane but to the unperturbed image graph \(\Gamma _{0} =\{ (x,y,x)\ \vert \ (x,y) \in \mathbb{R}^{2}\}\), compare Fig. 4.12d, is symmetric w.r.t. the line \(x = x_{0}':= x_{0} +\varepsilon \cos (kx_{0})/\sqrt{2}\); note that the point (x 0, y 0, u(x 0, y 0)) projects to (x 0′, y 0, x 0′). Moreover, the projection from \(\Gamma\) to \(\Gamma _{0}\) changes areas only by a factor \(1 + \mathcal{O}(\varepsilon ^{2})\). Similarly, projection from \(\Gamma\) to the image plane changes areas by a factor \(\sqrt{ 2}/2 + \mathcal{O}(\varepsilon ^{2})\).

The amoeba median can therefore be computed up to \(\mathcal{O}(\varepsilon ^{2})\) from an area difference within \(\mathcal{A}'\) that solely results from the deviation of the projected level line on \(\Gamma\) from the line x = x 0′.

The level line of u corresponding to (x 0, y 0) is given by u(x, y) = u(x 0, y 0), thus x(y) = x 0 +ɛcos(ky 0) −ɛcos(ky); it projects on \(\Gamma _{0}\) as

$$\displaystyle{ x(y) = x_{0}' + \frac{1} {2}{\bigl (\varepsilon \cos (ky_{0}) -\varepsilon \cos (ky)\bigr )} + \mathcal{O}(\varepsilon ^{2})\;. }$$
(4.46)

As the level line extends in y direction from \(y_{0} -\varrho +\mathcal{O}(\varepsilon ^{2})\) to \(y_{0} +\varrho +\mathcal{O}(\varepsilon ^{2})\), the resulting area difference on \(\Gamma _{0}\) is compensated by a level line shift of

$$\displaystyle\begin{array}{rcl} \Delta x& =& \frac{-2} {2\,\varrho } \int \limits _{y_{0}-\varrho }^{y_{0}+\varrho } \frac{\varepsilon } {2}{\bigl (\cos (ky_{0}) -\cos (ky)\bigr )}\,\mathrm{d}y + \mathcal{O}(\varepsilon ^{2}) \\ & =& \left (\frac{\sin (k\varrho )} {k\varrho } - 1\right )\varepsilon \cos (ky_{0}) + \mathcal{O}(\varepsilon ^{2})\;, {}\end{array}$$
(4.47)

making \(x_{0} + \Delta x\) the sought median, and leading to a frequency reponse factor \(\delta (k):=\mathop{ \mathrm{sinc}}\nolimits (k\varrho ) - 1\) for the increment of the perturbation.

As before, one amoeba median filter step changes the initial perturbation uu 0 of (4.39) versus u 0(x, y) = x by the amplification factor λ(k) = 1 +δ(k), i.e. \(\lambda (k) =\mathop{ \mathrm{sinc}}\nolimits (k\varrho )\). Since λ(k) is within (−1, 1) for all k > 0, perturbations of all frequencies are dampened.

Figure 4.15 shows the graphs of both amplification functions, λ(k) for amoeba median filtering with ϱ = 1, and λ s(k) = 1 + 1∕6 ⋅ (−k 2∕2) for the corresponding time step of (4.44) with time step size ϱ 2∕6 = 1∕6, along with numerically computed amplification factors for amoeba median filtering with the same parameters for k = 1, 2, , 30.

Fig. 4.15
figure 15

Amplification of a level-line-aligned perturbation of a linear slope function by one amoeba median filtering step (theoretical and numerical values) and a corresponding time step of an explicit scheme for self-snakes (with or without pre-smoothing)

6 Amoebas and Texture

As mentioned before, Dijkstra’s shortest path algorithm on the neighbourhood graph G w ( f) or a subgraph thereof is used to compute amoeba structuring elements. Whereas in image filtering, only the resulting pixel set \(\mathcal{A}_{\varrho }(i)\) around pixel i is of interest, the search tree created by Dijkstra’s algorithm bears valuable information in itself: its structure depends sensitively on the local structure of contrasts in the image, thus, on its texture. Building on work first presented in [55], this section discusses an approach directed at exploiting this information for texture analysis.

Fig. 4.16
figure 16

Six graph setups for texture feature construction from amoebas (schematic). For simplicity, graphs are drawn based on 4-neighbourhood connectivity here. In the weighted graphs, different line thicknesses symbolise edge weights

6.1 Six Graph Structures for Local Texture Analysis

Looking at the amoeba construction in more detail, information about local image texture is distributed to several features. The first aspect are the amoeba distances between adjacent pixels themselves, i.e. the edge weights of G w ( f). A second source of information is the selected pixel set of the amoeba \(\mathcal{A}_{\varrho }(i)\). The third one is the connectivity of the Dijkstra search tree. This leads to six setups for graphs that encode these information cues in different combinations. Figure 4.16 illustrates these setups.

For the first group of three graphs, the pixels within \(\mathcal{A}_{\varrho }(i)\) serve as vertices. For these, one can consider either the full weighted subgraph of G w ( f), which will be denoted by G w A, the superscript A referring to the use of the amoeba patch. Next, one can consider just the weighted Dijkstra tree, T w A. Third, deleting the edge weights from this tree yields an unweighted tree, T u A. Despite suspending the direct use of edge weights in this setting, the connectivity structure derived thereof remains present.

The second group of three graphs is analogous to the first one but chooses the pixels of a fixed window of Euclidean radius ϱ around pixel i. Again, one has the corresponding weighted subgraph of G w ( f), which will be denoted as G w E, with the superscript E referring to the Euclidean patch, the weighted Dijkstra tree T w E and the unweighted Dijkstra tree T u E.

6.2 Quantitative Graph Theory: Graph Indices

We turn now to introduce exemplary graph descriptors that can be computed from the previously mentioned graphs in order to obtain quantitative texture descriptors. A larger set of graph descriptors is discussed in the same context in [55].

These graph descriptors are just samples from a tremendous variety of more than 900 concepts [14] that have been established over almost 70 years of research, motivated from applications like the analysis of molecule connectivity in computational chemistry, see e.g. [4, 26, 29, 41, 61], inexact graph matching [19, 43], or the quantitative analysis of (for instance, metabolistic) networks, see e.g. [12, 18]. In the recent decade, the systematic study of these measures has been bundled in the field of quantitative graph theory, see e.g. [13, 15, 18].

6.2.1 Distance-Based Indices

The historically first class of graph indices are computed directly from the vertex distances within a graph.

Originally introduced for unweighted graphs G, the Wiener index [61] is obtained by just summing up the distances (path lengths) between all pairs {i, j} of vertices,

$$\displaystyle{ W(G):=\sum _{\{i,j\}}d(i,j)\;. }$$
(4.48)

A modification is the Harary index introduced by Plavšić et al. [41] that sums the reciprocals instead of the distances themselves,

$$\displaystyle{ H(G):=\sum _{\{i,j\}} \frac{1} {d(i,j)}\;. }$$
(4.49)

It is straightforward to apply both indices also for weighted graphs, replacing path lengths as distances by total path weights just as in the amoeba definition.

6.2.2 Information-Theoretic Indices

Another important class of graph indices is based on entropy concepts. Since Shannon’s work [47], the entropy

$$\displaystyle{ H(\,p):= -\sum _{k=1}^{n}p(k)\log _{ 2}p(k) }$$
(4.50)

has been established as the fundamental measure of the information content of a discrete probability measure p on {1, , n}.

6.2.2.1 Bonchev-Trinajstić Information Indices

In [4], entropy has been applied in several ways to the distribution of distances within unweighted graphs to characterise graph connectivity. We pick here two of them. We consider a graph G with vertices 1, , n and denote by D(G) its diameter, i.e. the largest path distance between two of its vertices. By k d we denote for d = 1, , D(G) the number of vertex pairs of exact distance d,

$$\displaystyle{ k_{d}:= \#\{(i,j)\ \vert \ 1 \leq i <j \leq n,\ \ d(i,j) = d\}\;. }$$
(4.51)

In [4], the mean information on distances \(\bar{I}_{\mathrm{D}}^{\mathrm{E}}\) and the total information on the realised distances I D W of G are defined, which (with a slight rewrite for I D W) read as

$$\displaystyle\begin{array}{rcl} \bar{I}_{\mathrm{D}}^{\mathrm{E}}(G)&:=& -\sum \limits _{ d=1}^{D(G)} \frac{k_{d}} {\binom{n}{2}}\log _{2} \frac{k_{d}} {\binom{n}{2}}\;,{}\end{array}$$
(4.52)
$$\displaystyle\begin{array}{rcl} I_{\mathrm{D}}^{\mathrm{W}}(G)&:=& W(G)\log _{ 2}W(G) -\sum \limits _{1\leq i<j\leq n}d(i,j)\log _{2}d(i,j)\;,{}\end{array}$$
(4.53)

where W(G) is the Wiener index (4.48). Again, both definitions can formally be applied to weighted graphs by performing the summation over the weighted path lengths d occurring in G; however, in non-degenerate cases all k d will equal 1, turning the mean information on distances \(\bar{I}_{\mathrm{D}}^{\mathrm{E}}\) into a quantity that depends essentially only on n, and does therefore not reveal much information about the graph. In our texture analysis framework, \(\bar{I}_{\mathrm{D}}^{\mathrm{E}}\) makes therefore sense only for the unweighted graphs T u A and T u E. In contrast, the total information measure I D W makes perfect sense for weighted graphs and thus for all six graph setups under consideration.

6.2.2.2 Dehmer Entropies

While the Bonchev-Trinajstić indices are based on entropies on the set of distances in a graph, a class of entropy indices defined in [12] works with distributions on the vertex set. An arbitrary positive-valued function f(information functional) on the vertices 1, , n of a graph G is converted into a probability density by normalising the sum of all values to 1, such that the individual probabilities p(i) read as

$$\displaystyle{ p(i):= \frac{f(i)} {\sum _{j=1}^{n}f(j)}\;. }$$
(4.54)

The entropy

$$\displaystyle{ I_{f}(G):= H(\,p) }$$
(4.55)

is then a graph index based on the information functional f.

In [12], two choices for f have been considered in the case of unweighted graphs, named f V and f P. For each of them, f(i) is obtained from considering the set of neighbourhoods of increasing radius around vertex i in the path metric of the graph. While f V(i) is the exponential of a weighted sum over the cardinalities of such neighbourhoods, f P(i) is the exponential of a weighted sum over the distance sums within these neighbourhoods (i.e. the Wiener indices of the corresponding subgraphs). The weight factors assigned to increasing neighbourhoods in both f P and f V can be chosen in different ways. Using what is called exponential weighting scheme in [15] and measuring distances d by total edge weights along paths in edge-weighted graphs, the resulting information functionals can be stated as

$$\displaystyle\begin{array}{rcl} f^{V }(i)&:=& \exp \left (M\sum _{ j=1}^{n}q^{d(i,j)}\right )\;,{}\end{array}$$
(4.56)
$$\displaystyle\begin{array}{rcl} f^{P}(i)&:=& \exp \left (M\sum _{ j=1}^{n}q^{d(i,j)}d(i,j)\right ){}\end{array}$$
(4.57)

with parameters M > 0 and q ∈ (0, 1), see [55] where it is also detailed how these expressions are derived from the original definitions from [12].

For the resulting entropy indices \(I_{f^{P}}\) and \(I_{f^{V }}\) as well as for a third one, \(I_{f^{\varDelta }}\), which is not discussed here, [15] demonstrated excellent discriminative power for unweighted graphs, i.e. they are able to uniquely distinguish large sets of different unweighted graphs. This finding lets appear \(I_{f^{P}}\) and \(I_{f^{V }}\) also as outstanding candidates for texture analysis tasks.

6.3 Texture Discrimination

As a first, yet simple, application of the framework that combines amoebas and graph indices, texture discrimination is considered. In [55], a total of 42 candidate texture descriptors was considered. These descriptors resulted from applying nine graph indices, including those described in Sect. 4.6.2 above, to the six graph setups introduced in Sect. 4.6.1, using only those combinations that made sense (as e.g. some graph indices cannot be used for weighted graphs). These graph indices were compared to Haralick features [21, 22], a set of region-based texture descriptors derived from several statistics of co-occurrence matrices of intensities. Despite their long history of more than 40 years, Haralick features are still prominent in texture analysis; together with some more recent modifications they continue to yield competitive results [27, 28, 49].

Fig. 4.17
figure 17

Composite image containing patches of nine different textures; top left to bottom right in rows: brick, fabric, flowers, food, leaves, metal, stone, water, wood. Texture patches originate from the VisTex database, [40]; they have been converted to greyscale, downsampled and clipped (VisTex database ©1995 Massachusetts Institute of Technology. Developed by Rosalind Picard, Chris Graczyk, Steve Mann, Josh Wachman, Len Picard, and Lee Campbell at the Media Laboratory, MIT, Cambridge, Massachusetts)

Fig. 4.18
figure 18

Examples of graph-index-based feature descriptors computed on the test image shown in Fig. 4.17. Graph indices have been computed from amoebas with Euclidean amoeba metric, β = 0. 1 and ϱ = 5. All graph index images shown here are histogram equalised. (a ) Harary index on the weighted amoeba tree T w A. (b ) Dehmer entropy \(I_{f^{P}}\) on T w A. (c ) I D W on T w A. (d ) Harary index on the weighted tree in the Euclidean neighbourhood T w E. (e ) Dehmer entropy \(I_{f^{P}}\) on T w E. (f ) Dehmer entropy \(I_{f^{V }}\) on T w E

For the texture discrimination task, the experimental setup in [55] was built to suit the region-based Haralick features by aggregating the, actually local, amoeba-graph features regionwise.

Amoeba-graph descriptors as well as Haralick features were computed for a set of nine texture images from the VisTex database, [40]. Figure 4.17 shows a composite image made up of the nine textures used in [55]. Figure 4.18 visualises selected amoeba-graph features on this test image. It can be seen that the different features respond with different degrees of sensitivity and locality to the local structure of the textures.

For each descriptor and texture pair, a statistical discrepancy measure \(u:=\vert \mu _{1} -\mu _{2}\vert /\sigma\) was computed from the mean values μ 1, μ 2 of the texture descriptor on both textures and the joint standard deviation σ. Due to the variability of each descriptor even within the same texture, thresholds for discrimination were gauged from the measured discrepancies for different patches of the same textures: A higher threshold, T 1, was chosen as double the maximum of the nine intra-texture discrepancies measured, and a lower threshold, T 2, as the third-highest of the nine intra-texture values. Texture pairs with discrepancy at least T 1 were considered as “certainly different”, and those with discrepancy at least T 2 as “probably different”.

While not each texture descriptor could equally well distinguish each pair of textures, it turns out that almost all texture pairs can be told apart by at least some descriptors, with the overall discrimination capability being well comparable with that achieved by the Haralick feature set under consideration. Indeed, the pair water/wood (the last two patches in the bottom row of Fig. 4.17 was the only one that could not be distinguished with sufficient certainty, neither by the Haralick nor the amoeba-graph feature set. The difficulty to distinguish these two textures can also be seen in Fig. 4.18.

Given that different texture pairs are distinguished best with different descriptors, it is of interest to study the similarity and dissimilarity of different amoeba-graph texture descriptors with regard to what texture pairs they can distinguish. In [55] a metric on the set of texture descriptors has been established in this way. In the further perspective, this is intended to guide the selection of a subset of just a few descriptors that complement each other well, which could therefore be a well-manageable feature set for practical applications.

6.4 Texture Segmentation

Finally, we show a simple example that demonstrates the applicability of amoeba-graph indices for texture segmentation. Here graph descriptors have been used as input to a standard geodesic active contour method with an outward force term \(\gamma \,g\,\vert \boldsymbol{\nabla }u\vert\).

Fig. 4.19
figure 19

Texture segmentation by geodesic active contour evolution based on amoeba/graph index texture features, pre-smoothing σ = 3, force term γ = −2, time step size τ = 0. 1. (a ) Original image with initial contour. (b ) Graph index \(I_{f^{P}}\) on weighted tree T w E (normalised from [0, 3. 72] to [0, 255]). (c ) Graph index \(\bar{I}_{\mathrm{D}}^{\mathrm{E}}\) on unweighted tree T u A (normalised from [0, 2. 93] to [0, 255]). (d ) Contour after 500 iterations of GAC evolution using \(I_{f^{P}}\) on T w E and \(\bar{I}_{\mathrm{D}}^{\mathrm{E}}\) on T u A each weighted 0. 5, Perona-Malik threshold λ = 0. 036. (e ) Same as (d ) but 1000 iterations. (f ) Same as (d ) but 2500 iterations. (g ) Steady state of the segmentation process from (d )–(f ) reached after 3300 iterations. (h ) Segmentation using only \(I_{f^{P}}\) on T w E, Perona-Malik threshold 0. 48, steady state reached after 7500 iterations. (i ) Segmentation using only \(\bar{I}_{\mathrm{D}}^{\mathrm{E}}\) on T u A, Perona-Malik threshold 0. 4, steady state reached after 1200 iterations

Figure 4.19a shows a test image displaying a striped ring in front of a noisy background. Figure 4.19b shows the field of graph indices \(I_{f^{P}}\) computed on weighted Dijkstra trees in Euclidean patches, T w E, while Fig. 4.19c shows \(\bar{I}_{\mathrm{D}}^{\mathrm{E}}\) on T u A. It is evident from these examples that amoeba-graph indices can turn the textured foreground object into a more homogeneous region. Using just the two graph descriptors as input channels for geodesic active contours one obtains a reasonable segmentation, see Fig. 4.19g. One might ask whether one graph index alone does the job, too. In the present example, this is indeed true; however, the results in Fig. 4.19h, i are visibly less precise in locating the contour separating foreground and background.

Note that this example is only a first proof of concept. A deeper investigation of the potential of this approach to texture segmentation as well as the study of parameter choice and comparison to other texture segmentation methods are topics for future research.

7 Outlook

From the results reviewed in this chapter it can be seen that morphological amoebas provide a powerful framework for adaptive image filtering with interesting cross-relations to other classes of filters. They can also be applied fruitfully to related tasks such as image segmentation. Combining amoeba procedures with ideas from quantitative graph theory even allows to construct a new class of texture descriptors.

At the same time, there remain many questions for future research. So far, the amoeba framework introduces adaptivity into local image filters solely by modifying the first step of the filter procedure, i.e. the selection stage. The aggregation step like median, maximum, or minimum is left unchanged. Could further improvements of adaptivity be achieved by envisioning also image-dependent modifications to the aggregation step? How do modifications of selection and aggregation step interact?

Addressing the selection step itself, it would be possible to weaken the dichotomy of including or not including neighbour locations, and to consider unsharp or weighted neighbourhoods.

No amoeba filter for multi-channel (such as colour) images have been studied in the present chapter. In principle, there is little to prevent one from applying amoeba procedures to multi-channel data. The amoeba computation step generalises straightforwardly. There are also generalisations of median filters [2, 48, 52, 59, 60] and supremum/infimum operations to multi-channel data [68] at hand. The theoretical understanding of multi-channel amoeba filters, however, lags behind that in the single-channel case. A result in [57] indicates that the median–PDE relation even in its non-adaptive form, see Proposition 4.1, has no equally simple multi-channel counterpart, thus leaving little hope to derive manageable PDE equivalents of multi-channel amoeba filters. New approaches to a deeper understanding of the properties of multi-channel amoeba filters will have to be sought.

The field of texture analysis addressed in Sect. 4.6 still is at an early stage of research. Ongoing research is directed at extending the experimental evaluation of the newly introduced amoeba-graph texture descriptors for texture discrimination to a broader body of data. Another goal is the selection of a powerful set of a few amoeba-graph descriptors with a high combined discrimination rate across multiple textures. Tuning of the parameters of the descriptors has not been studied extensively so far and will therefore be addressed in the future. Attempts are also underway to analyse the effect of the amoeba-graph descriptors theoretically.

In the field of texture segmentation the combination of amoeba-graph descriptors with other segmentation frameworks than the GAC considered in Sect. 4.6.4 will be investigated. An integration with an amoeba active contour procedure could lead to a texture segmentation framework that uses the same sort of theoretically founded procedure for both texture feature extraction and the actual segmentation step. In many existing approaches, and also in the preliminary example from Sect. 4.6.4, these two steps are based on rather unrelated approaches. With regard to the graph-theoretical roots of the texture features under consideration, also graph-cut approaches for the segmentation stage could be a candidate for further investigation.