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.

Introduction

We propose a symmetric thinning scheme for cubical or simplicial complexes of dimension 2 or 3. Our motivations are listed below:

  • Complexes can be used for the representation of discrete geometric objects, yielding better understanding of their structure and topological properties;

  • The framework of digital topology does not permit to obtain skeletons that are provably thin, however, such a property can be proved in the framework of complexes;

  • To our knowledge, there does not yet exist any symmetrical thinning algorithm in the framework of complexes. Only asymmetric algorithms, based on the collapse operation have been proposed. However, asymmetric thinning algorithms can produce, for the same object, drastically different results depending of the orientation of the object in space (see Fig. 8). On the other hand, symmetric algorithms guarantee a 90\({^\circ }\) rotation invariance.

In our previous works on critical kernels, we have proposed methods where the input and the output were “homogenous” complexes, that is, sets of pixels or sets of voxels (see e.g. [2, 3]). The case of general complexes (made of elements of various dimensions) has never been considered in this framework.

Here, we show how to obtain, with a same generic thinning scheme, ultimate, curve or surface skeletons that are uniquely defined (no arbitrary choice is done). We also show that, if a thin skeleton is needed, it is better to use our symmetric method first and finish the thinning with a few steps of collapse.

1 Cubical Complexes

Although we focus on cubical complexes in this paper, all the notions and methods introduced from here to Sect. 5 can be readily transposed to the framework of simplicial complexes (see [1]).

Abstract complexes have been promoted in particular by V. Kovalevsky [9] in order to provide a sound topological basis for image analysis.

Intuitively, a cubical complex may be thought of as a set of elements having various dimensions (e.g., vertices, edges, squares, cubes) glued together according to certain rules. In this section, we recall briefly some basic definitions on complexes, see also [2, 6] for more details. We consider here n-dimensional complexes, with \(0 \leqslant n \leqslant 3\).

Let S be a set. If T is a subset of S, we write \(T \subseteq S\). Let \(\mathbb {Z}\) denote the set of integers.

We consider the families of sets \(\mathbb {F}^{1}_{0}\), \(\mathbb {F}^{1}_{1}\), such that \(\mathbb {F}^{1}_{0} = \{ \{a \} \; | \;a \in \mathbb {Z}\}\), \(\mathbb {F}^{1}_{1} = \{ \{ a, a+1 \}\; | \;a \in \mathbb {Z}\}\). A subset f of \(\mathbb {Z}^n\), \(n \geqslant 2\), which is the Cartesian product of exactly m elements of \(\mathbb {F}^{1}_{1}\) and \((n - m)\) elements of \(\mathbb {F}^{1}_{0}\) is called a face or an m-face of \(\mathbb {Z}^n\), m is the dimension of f, we write \(\dim (f) = m\).

Observe that any non-empty intersection of faces is a face. For example, the intersection of two 2-faces A and B may be either a 2-face (if \(A = B\)), a 1-face, a 0-face, or the empty set.

Fig. 1.
figure 1

Graphical representations of: (a) a 0-face, (b) a 1-face, (c) a 2-face, (d) a 3-face.

We denote by \(\mathbb {F}^{n}\) the set composed of all m-faces of \(\mathbb {Z}^n\), with \(0 \leqslant m \leqslant n\). An m-face of \(\mathbb {Z}^n\) is called a point if \(m = 0\), a (unit) interval if \(m = 1\), a (unit) square if \(m = 2\), a (unit) cube if \(m = 3\) (see Fig. 1).

Let f be a face in \(\mathbb {F}^{n}\). We set \(\hat{f} = \{ g \in \mathbb {F}^{n} \; | \;g \subseteq f \}\) and \( \hat{f}^* = \hat{f}{\setminus }\{f\}\).

Any \(g \in \hat{f}\) is a face of f.

If X is a finite set of faces in \(\mathbb {F}^{n}\), we write \({X}^- = \cup \{\hat{f} \; | \;f \in X \}\), \({X}^-\) is the closure of X.

A set X of faces in \(\mathbb {F}^{n}\) is a cell or an m-cell if there exists an m-face \(f \in X\), such that \(X = \hat{f}\). The boundary of a cell \(\hat{f}\) is the set \(\hat{f}^*\).

A finite set X of faces in \(\mathbb {F}^{n}\) is a complex (in \(\mathbb {F}^{n}\) ) if \(X = {X}^-\). Any subset Y of a complex X which is also a complex is a subcomplex of X. If Y is a subcomplex of X, we write \(Y \preceq X\). If X is a complex in \(\mathbb {F}^{n}\), we also write \(X \preceq \mathbb {F}^{n}\). In Fig. 2, some complexes are represented. Notice that any cell is a complex.

Let \(X \subseteq \mathbb {F}^{n}\). A face \(f \in X\) is a facet of X if there is no \(g \in X\) such that \(f \in \hat{g}^*\). We denote by \({X}^+\) the set composed of all facets of X.

If X is a complex, observe that in general, \({X}^+\) is not a complex, and that \({[{X}^+]}^- = X\).

2 Collapse

In this section we recall a definition of the operation of collapse [7], which is a discrete analogue of a continuous deformation (a homotopy).

Let X be a complex in \(\mathbb {F}^{n}\) and let \(f \in X\). If there exists one face \(g \in \hat{f}^*\) such that f is the only face of X which strictly includes g, then g is said to be free for X and the pair (fg) is said to be a free pair for X. Notice that, if (fg) is a free pair, then we have necessarily \(f \in {X}^+\) and \(\dim (g) = \dim (f) - 1\).

Let X be a complex, and let (fg) be a free pair for X. The complex \(X{\setminus }\{f,g\}\) is an elementary collapse of X.

Let X, Y be two complexes. We say that X collapses onto Y if \(Y=X\) or if there exists a collapse sequence from X to Y, i.e., a sequence of complexes \(\langle X_0,...,X_\ell \rangle \) such that \(X_0 = X\), \(X_\ell = Y\), and \(X_i\) is an elementary collapse of \(X_{i-1}\), \(i = 1,...,\ell \). Figure 2 illustrates a collapse sequence.

Fig. 2.
figure 2

(a): a complex \(X \preceq \mathbb {F}^3\). (a–d): a collapse sequence from X.

Remark 1

Let V be a set of 2-faces (pixels) or a set of 3-faces (voxels), and let \(x \in V\). The element x is simple, in the sense of digital topology (see [6, 8]) if the complex \({V}^-\) collapses onto \({(V{\setminus }\{x\})}^-\).

3 Critical Kernels

Let us briefly recall the framework introduced by one of the authors (in [1]) for thinning, in parallel, discrete objects with the warranty that we do not alter the topology of these objects. We focus here on the two- and three-dimensional cases, but in fact the results in this section are valid for complexes of arbitrary dimension. This framework is based solely on three notions: the notion of an essential face which allows us to define the core of a face, and the notion of a critical face (see illustrations in Fig. 3).

Definition 2

([1]). Let \(X \preceq \mathbb {F}^n\) and let \(f \in X\). We say that f is an essential face for X if f is precisely the intersection of all facets of X which contain f, i.e., if \(f = \cap \{ g \in {X}^+ \; | \;f \subseteq g \}\). We denote by \({ {}Ess}(X)\) the set composed of all essential faces of X. If f is an essential face for X, we say that \(\hat{f}\) is an essential cell for X. If \(Y \preceq X\) and \({ {}Ess}(Y) \subseteq { {}Ess}(X)\), then we write \(Y \trianglelefteq X\).

Fig. 3.
figure 3

(a): a complex \(X \preceq \mathbb {F}^2\), the essential faces are shown in gray. (b, c, d, e): an essential face (in gray) and its core (in black). The faces in (b, e) are regular, those in (c, d) are critical.

Observe that a facet of X is necessarily an essential face for X, i.e., \({X}^+ \subseteq { {}Ess}(X)\).

Definition 3

([1]). Let \(X \preceq \mathbb {F}^n\) and let \(f \in { {}Ess}(X)\). The core of \(\hat{f}\) for X is the complex \({ {}Core}(\hat{f},X) = \cup \{\hat{g} \; | \;g \in { {}Ess}(X) \cap \hat{f}^* \}\).

Definition 4

([1]). Let \(X \preceq \mathbb {F}^n\) and let \(f \in X\). We say that f and \(\hat{f}\) are regular for X if \(f \in { {}Ess}(X)\) and if \(\hat{f}\) collapses onto \({ {}Core}(\hat{f},X)\). We say that f and \(\hat{f}\) are critical for X if \(f \in { {}Ess}(X)\) and if f is not regular for X. If \(X \preceq \mathbb {F}^n\), we set \({ {}Critic}(X) = \cup \{ \hat{f} \; | \;f\) is critical for \(X\}\), we say that \({ {}Critic}(X)\) is the critical kernel of X.

If f is a pixel (resp. a voxel), then saying that f is regular is equivalent to say that f is simple in the classical sense (see Remark (1) and [6]). Thus, the notion of regular face generalizes the one of simple pixel (resp. voxel) to arbitrary facets and even to faces that are not facets.

The following theorem is the most fundamental result concerning critical kernels. We use it here in dimension 2 or 3, but notice that the theorem holds whatever the dimension.

Theorem 5

([1]). Let \(n \in \mathbb {N}\), let \(X \preceq \mathbb {F}^n\).

  1. (i)

    The complex X collapses onto its critical kernel.

  2. (ii)

    If \(Y \trianglelefteq X\) contains the critical kernel of X, then X collapses onto Y.

  3. (iii)

    If \(Y \trianglelefteq X\) contains the critical kernel of X, then any Z such that \(Y \preceq Z \trianglelefteq X\) collapses onto Y.

Let n be a positive integer, let \(X \preceq \mathbb {F}^n\). We define \({ {}Critic}^n(X)\) as follows: \({ {}Critic}^0(X) = X\), and \({ {}Critic}^n(X) = { {}Critic}({ {}Critic}^{n-1}(X))\), whenever \(n>0\). If \({ {}Critic}^n(X) = { {}Critic}^{n+1}(X)\), then we say that \({ {}Critic}^n(X)\) is the ultimate skeleton of X and we write \({ {}Critic}^n(X) = { {}Critic}^\infty (X)\).

From Theorem 5, we deduce immediately that for any \(X \preceq \mathbb {F}^n\), the complex X collapses onto \({ {}Critic}^\infty (X)\). See Fig. 4 for an illustration.

4 Symmetric Thinning Scheme

In this section, we introduce our new generic parallel thinning scheme, see Algorithm 1. It is generic in the sense that any notion of skeletal element (introduced below) may be used, for obtaining, e.g., ultimate, curve, or surface skeletons.

In order to compute curve or surface skeletons, we have to keep other faces than the ones that are necessary for the preservation of the topology of the object X. In the scheme, the set K corresponds to a set of features that we want to be preserved by a thinning algorithm (thus, we have \(K \subseteq X\)). This set K, called constraint set, is updated dynamically at line 3 of the algorithm. To this aim, we will define a function \({ {}Skel}_X\) from \({X}^+\) onto \(\{{ {True}},{ {False}}\}\), that allows us to detect some skeletal facets of X, e.g., some facets belonging to parts of X that are surfaces or curves. These detected facets are progressively stored in K.

figure a

Notice that, before line 4, the complex \(Y = { {}Critic}(X) \cup {K}^-\) is such that \(Y \trianglelefteq X\) and \({ {}Critic}(X) \subseteq Y\). Thus, by Theorem 5(ii), the original complex X collapses onto the result of SymThinningScheme, for any X and any function \({ {}Skel}_X\).

See Fig. 4 for an illustration of SymThinningScheme, using a function \({ {}Skel}_X\) that yields \({ {False}}\) for any facet. The result of this operation is, obviously, the ultimate skeleton of the input complex X.

Fig. 4.
figure 4

(a): a complex \(X \preceq \mathbb {F}^3\). (b): after one execution of the main loop of SymThinningScheme: \({ {}Critic}^1(X) = { {}Critic}(X)\). (c): after two executions of the main loop: \({ {}Critic}^2(X)\). (d): the final result: \({ {}Critic}^3(X) = { {}Critic}^\infty (X)\).

In order to preserve geometrical features of the original object, such as elongated or flat parts, we use two kinds of skeletal facets called isthmuses.

Intuitively, a facet f of a complex X is said to be a 1-isthmus (resp. a 2-isthmus) if the core of \(\hat{f}\) for X corresponds to the one of an element belonging to a curve (resp. a surface) [3].

Let \(X \subseteq \mathbb {F}^n\) be a non-empty set of faces. A sequence \((f_i)_{i=0}^\ell \) of faces of X is a path in X (from \(f_0\) to \(f_\ell \) ) if \(f_i \cap f_{i+1} \ne \emptyset \), for all \(i \in [0,\ell -1 ]\). We say that X is connected if, for any two faces fg in X, there is a path from f to g in X.

We say that \(X \preceq \mathbb {F}^{n}\) is a 0-surface if \({X}^+\) is precisely made of two facets f and g of X such that \(f \cap g = \emptyset \).

We say that \(X \preceq \mathbb {F}^{n}\) is a 1-surface (or a simple closed curve) if:

  1. (i)

    \({X}^+\) is connected; and

  2. (ii)

    For each \(f \in {X}^+\), \({ {}Core}(\hat{f},X)\) is a 0-surface.

We say that \(X \preceq \mathbb {F}^{n}\) is an simple open curve if:

  1. (i)

    \({X}^+\) is connected; and

  2. (ii)

    For each \(f \in {X}^+\), \({ {}Core}(\hat{f},X)\) is a 0-surface or a single cell.

Definition 6

Let \(X \preceq \mathbb {F}^{n}\), let \(f \in {X}^+\).

We say that f is a 1-isthmus for X if \({ {}Core}(\hat{f},X)\) is a 0-surface.

We say that f is a 2-isthmus for X if \({ {}Core}(\hat{f},X)\) is a 1-surface.

We say that f is a \(2^+\) -isthmus for X if f is a 1-isthmus or a 2-isthmus for X.

Our aim is to thin an object, while preserving a constraint set K that is made of faces that are detected as k-isthmuses during the thinning process. We obtain curve skeletons with \(k = 1\), and surface skeletons with \(k = 2^+\). These two kinds of skeletons may be obtained by using SymThinningScheme, with the function \({ {}Skel}_X\) defined as follows:

$$ { {}Skel}_X(x) = \left\{ \begin{array}{ll} { {True}}&{} {\text {if}\ x\ \text {is a}\ k\text {-isthmus for}\ X,} \\ { {False}}&{} \mathrm{otherwise,} \end{array} \right. $$

with k being set to 1 or \(2^+\).

Observe that a facet may be a k-isthmus at a given step of Algorithm 1, but not at further steps. This is why previously detected isthmuses are stored in K.

Figure 5 illustrates curve and surface skeletons. We observe that these skeletons contain faces of all dimensions: 3, 2, 1, 0. This is the counterpart of the choice of having a symmetric process, hence a 90\({^\circ }\) rotation invariance property, as illustrated in Fig. 6. We deal with the thinness issue in the next section.

Observe also that, in Fig. 6, the obtained skeletons are simple open curves, as defined above. More generally, despite the fact that they are composed of faces of various dimensions, parts of produced skeletons can be directly interpreted as pieces of curves or surfaces.

Fig. 5.
figure 5

(a): a complex \(X \preceq \mathbb {F}^3\). (b): curve skeleton of X. (c): surface skeleton of X.

Fig. 6.
figure 6

Illustration of 90\({^\circ }\) rotation invariance with the symmetric thinning (algorithm SymThinningScheme).

5 Asymmetric Thinning Scheme

Thinner skeletons may be obtained if we give up the symmetry. To this aim, the collapse operation may be directly used. The method described in this section corresponds to a special case of a method introduced by Liu et al. in [10] (see also [4]) for producing families of filtered skeletons. Here, we are interested in non-filtered skeletons obtained through parameter-free thinning methods. Besides, the filtering approach of [10] can easily be adapted to our method.

In general, removing free pairs from a complex in parallel does not preserve topology. But under certain conditions parallel collapse of free pairs is feasible.

First, we need to define the direction of a free face. Let X be a complex in \(\mathbb {F}^{n}\), let (fg) be a free pair for X. Since (fg) is free, we know that \(\dim (g) = \dim (f) - 1\), and it can be easily seen that \(f = g \cup g'\) where \(g'\) is the translate of g by one of the 2n vectors of \(\mathbb {Z}^n\) with all coordinates equal to 0 except one, which is either \(+1\) or \(-1\). Let v denote this vector, and c its non-null coordinate. We define \({ {}Dir}(f,g)\) as the index of c in v, it is the direction of the free pair (fg). Its orientation is defined as \({ {}Orient}(f,g)=1\) if \(c=+1\), and as \({ {}Orient}(f,g)=0\) otherwise.

Considering two distinct free pairs (fg) and (ij) for a complex X in \(\mathbb {F}^{n}\) such that \({ {}Dir}(f,g)={ {}Dir}(i,j)\) and \({ {}Orient}(f,g) = { {}Orient}(i,j)\), we have \(f \ne i\). It can easily be seen that (fg) is free for \(X{\setminus }\{i,j\}\), and (ij) is free for \(X{\setminus }\{f,g\}\). Loosely speaking, (fg) and (ij) may collapse in any order or in parallel. More generally, we have the following property.

Proposition 7

([5]). Let X be a complex in \(\mathbb {F}^{n}\), and let \((f_1,g_1), \ldots , (f_m,g_m)\) be m distinct free pairs for X having all the same direction and the same orientation. The complex X collapses onto \(X{\setminus }\{f_1,g_1, \ldots , f_m,g_m\}\).

Now, we are ready to introduce Algorithm 2.

Fig. 7.
figure 7

(a): a complex \(X \preceq \mathbb {F}^3\). (b): a curve skeleton by collapse of X. (c): a surface skeleton by collapse of X.

figure b

Notice that opposite orientations (e.g., north and south) are treated consecutively in a same directional substep. To obtain curve or surface skeletons, we set the function \({ {}Skel}_X\) as follows:

$$ { {}Skel}_X(x) = \left\{ \begin{array}{ll} { {True}}&{} \text{ if } \dim (x) = 1\text{, } \\ { {False}}&{} \text{ otherwise. } \end{array} \right. $$

for curve skeletons, and

$$ { {}Skel}_X(x) = \left\{ \begin{array}{ll} { {True}}&{} \text{ if } \dim (x) \in \{1,2\}\text{, } \\ { {False}}&{} \text{ otherwise. } \end{array} \right. $$

for surface skeletons.

Fig. 8.
figure 8

Illustration of asymmetric thinning (algorithm ParDirCollapse). The boxed area is detailed in Fig. 9.

Fig. 9.
figure 9

Detail of the thinning by collapse (algorithm ParDirCollapse) of the complexes of Fig. 8. (a, d): first step. (b, e): second step. (c, f): third step. Black faces are the ones that remain at the end of the step. The order in which the faces of different directions and orientations are processed is the same in all cases: 1. horizontal, left to right (white); 2. horizontal, right to left (light gray); 3. vertical, downwards (medium gray); 4. vertical, upwards (dark gray). An arrow indicates the only 1-face that is added to the constraint set K at the beginning of the second iteration. At the beginning of the third step, all the 1-faces in black are in K. We observe the birth of two parallel branches in (c), and the merging of two branches in (f).

Figure 7 shows results of algorithm ParDirCollapse. Notice that the curve skeleton is only composed of 1- and 0-faces, and that the surface skeleton does not contain any 3-face. Indeed, the following property guarantees that a curve skeleton in 2D (resp. a surface skeleton in 3D) does not contain any 2-face (resp. 3-face).

Proposition 8

([5]). Let X be a finite complex in \(\mathbb {F}^{n}\), with \(n > 0\), that has at least one n-face. Then X has at least one free \((n-1)\)-face.

The price to pay for getting this thinness property is the loss of 90\({^\circ }\) rotation invariance. The example of Fig. 8 shows that differences of arbitrary size may be observed between skeletons of a same shape, depending on its position in space. On the left, we see that two parallel skeleton branches correspond to a single branch of the right image. The length of this “split branch” may be arbitrarily big, depending on the size of the whole object.

Figure 9 details the directional substeps of algorithm ParDirCollapse and shows how this algorithm may give birth to different skeleton configurations for different orientations of the same original object.

6 Experiments, Discussion and Conclusion

Skeletons are notoriously sensitive to noise, and this is major problem for many applications. Even in the continuous case, the slightest perturbation of a smooth contour shape may provoke the appearance of an arbitrarily long skeleton branch, that we will refer to as a spurious branch. A desirable property of discrete skeletonization methods is to generate as few spurious branches as possible, in response to the so-called discretization (or voxelization) noise that is inherent to any discretization process.

It would make little sense to directly compare results of SymThinningScheme with those of ParDirCollapse, as the goals of these two methods are different. On the other hand, we may compare the results of (i) ParDirCollapse with those of (ii) SymThinningScheme followed by ParDirCollapse, as both are thin skeletons.

First of all, let us take a look at Fig. 10, where the latter method is applied to the same objects as in Figs. 6 and 8. We see that the split branch artifact of Fig. 8 is avoided.

Fig. 10.
figure 10

Illustration of symmetric thinning (algorithm SymThinningScheme) followed by a few asymmetric thinning steps (algorithm ParDirCollapse).

We will compare the two methods with respect to their ability to produce skeletons that are free of spurious branches. In the following, we compare how different methods behave with respect to this property.

In order to get ground truth skeletons, we discretized six simple 3D shapes for which the skeletons are known: a bent cylinder forming a knot (\(X_1\)), a Euclidean ball (\(X_2\)), a thickened straight segment (\(X_3\)), a torus (\(X_4\)), a thickened spiral (\(X_5\), see Fig. 11), an ellipsoid (\(X_6\)). For example, a curve skeleton of a discretized torus should ideally be a simple closed discrete curve (a 1-surface). Any extra branch of the skeleton must undoubtedly be considered as spurious. Thus, a simple and effective criterion for assessing the quality of a skeletonization method is to count the number of extra branches, or equivalently in our case, the number of extra curve extremities (free faces). Notice that, even if the original objects are complexes obtained by taking the closure of sets of voxels (3-faces), the intermediate and final results are indeed general complexes, which may contain 2-facets and 1-facets.

In order to compare methods, we use the indicator \(S(X) = |c(X) - c_i(X)|\), where c(X) stands for the number of curve extremities for the result obtained from X after thinning, and \(c_i(X)\) stands for the ideal number of curve extremities to expect with the object X. In other words, S(X) counts the number of spurious branches in the skeleton of object X, a result of 0 being the best one (Table 1).

Fig. 11.
figure 11

Results for object \(X_5\). Left: ParDirCollapse(\(X_5\)). Center: SymThinning Scheme(\(X_5\)). Right: ParDirCollapse(SymThinningScheme(\(X_5\))).

Table 1. Experimental results

Additionally, we performed discrete rotations of the object \(X_4\) (torus), by angles ranging from 1 to 89\({^\circ }\) by steps of 1\({^\circ }\), and computed the values of S(X) for all these rotated objects and for both methods. The mean value of S(X) was 131.0 for ParDirCollapse and 69.2 for SymThinningScheme followed by ParDirCollapse, which always gave the best result.

To conclude, our symmetric parallel thinning scheme is the first one that permits to thin general 2D or 3D complexes in a symmetrical manner, avoiding any arbitrary choice. We also showed experimentally that if, however, thin skeletons are required, then it is better to use our symmetric thinning scheme first.