1 Introduction

Geometric transformations are often involved in 2D and 3D digital image processing such as image registration [26]. Among them, rigid motions, i.e. translations, rotations and their composition, are fundamental ones. When a rigid motion is applied to a digital image, we need to digitize the result in order to map back each point onto the Cartesian grid. In such a point-wise model of rigid motions in \(\mathbb {Z}^n\), this final digitization step induces discontinuities in the transformation space. A direct consequence is the loss of geometric and topological invariance during rigid motions in \(\mathbb {Z}^n\), as shown in Fig. 1, by contrast with rigid motions in \(\mathbb {R}^n\) where geometry and topology are preserved.

Fig. 1.
figure 1

Digital images (left) and their images under digitized rigid motions (right). (a) A digital disk. (b) A digital plane. These sets preserve neither topology nor geometry.

These topological issues have been studied in \(\mathbb {Z}^2\). In particular, a class of digital images that preserve their topological properties during rigid motions—called regular images—was identified, as well as the “regularization” process based on an up-sampling strategy. This regularization approach allows creating regular images out of non-regular ones [18]. However, this up-sampling strategy in \(\mathbb {Z}^2\) cannot be directly extended to \(\mathbb {Z}^3\), leading to topological open problems in 3D digitized rigid motions [1]. In this paper, we investigate this topic.

In particular, we consider an alternative approach to regularity, based on quasi-r-regular polygons, which are used as intermediate continuous models of digital shapes for their rigid motions in \(\mathbb {Z}^2\) [16]. This approach, which relies on a mixed discrete–continuous paradigm (see [9] for related works), relies on three steps: polygonizing the boundary of a given digital set; applying a rigid motion on the polygon; and digitizing the transformed polygon. Topological issues may occur during the last step. In this context, the class of quasi-r-regular polygons provides guarantees on topological preservation between the polygons and their digitized analog. It should be mentioned that quasi-r-regularity is related to the classical notions of r-regularity [20] and r-half-regularity [25] for continuous sets with smooth and polygonal boundaries, respectively. The main advantage of this approach is its possible extension to 3D [17], by contrast to the notion of regularity.

Our first contribution is a link between the two concepts of regularity and quasi-r-regularity, in 2D. We also show that such a link does not exist in 3D. This difference explains why a straightforward extension of image regularity to 3D does not preserve topology under the point-wise rigid motions in \(\mathbb {Z}^3\). This fact emphasizes that quasi-r-regular polyhedra may be a key concept for topology-preserving 3D rigid motion on \(\mathbb {Z}^3\). Then, a question arises: which polyhedrization method(s) we can guarantee to generate quasi-r-regular polyhedra from 3D binary images? Our first investigations show that polyhedral isosurfaces generated by the marching cubes method [12]—mostly used for 3D digital images—do not fulfill quasi-r-regularity requirements in \(\mathbb R^3\), whereas, its 2D analog, namely the marching squares method allows one to generate quasi-r-regular polygons in \(\mathbb R^2\).

2 Rigid Motions on \(\mathbb {Z}^n\)

Let us consider a bounded, closed, connected subset \( X \) of the Euclidean space \(\mathbb {R}^n\), \(n \ge 2\). A rigid motion on \(\mathbb {R}^n\) is defined by a mapping

$$\begin{aligned} \left| \begin{array}{lllll} {\mathfrak T}&{} : &{} \mathbb {R}^n &{} \rightarrow &{} \mathbb {R}^n \\ &{} &{} {\mathrm x}&{} \mapsto &{} R {\mathrm x}+ {\mathrm t}\end{array} \right. \end{aligned}$$
(1)

where \(R\) is a rotation matrix and \({\mathrm t}\in \mathbb {R}^n\) is a translation vector. Such bijective transformation \({\mathfrak T}\) is isometric and orientation-preserving, so that \({\mathfrak T}( X )\) has the same shape as \( X \) i.e., both its geometry and topology are preserved.

If we simply apply a rigid motion \({\mathfrak T}\), such as defined in Eq. (1), to the discrete set \(\mathbb {Z}^n\), we generally have \({\mathfrak T}(\mathbb {Z}^n) \not \subseteq \mathbb {Z}^n\). Then, in order to map back onto \(\mathbb {Z}^n\), we need a digitization operator

$$\begin{aligned} \left| \begin{array}{lllll} {\mathfrak D}&{} : &{} \mathbb {R}^n &{} \rightarrow &{} \mathbb {Z}^n \\ &{} &{} (x_1, \ldots , x_n) &{} \mapsto &{} \left( \left\lfloor x_1 + \frac{1}{2} \right\rfloor , \ldots , \left\lfloor x_n + \frac{1}{2} \right\rfloor \right) \end{array} \right. \end{aligned}$$
(2)

where \(\lfloor s \rfloor \) denotes the greatest integer lower than s. A discrete version of \({\mathfrak T}\) is then obtained by

$$\begin{aligned} {\mathcal T}= {\mathfrak D}\circ {\mathfrak T}_{\mid \mathbb {Z}^n} \end{aligned}$$
(3)

so that the point-wise rigid motion of a finite subset \(\mathsf {X}\) on \(\mathbb {Z}^n\) is given by \({\mathcal T}(\mathsf {X})\). Due to the behavior of \({\mathfrak D}\) that maps \(\mathbb {R}^n\) onto \(\mathbb {Z}^n\), digitized rigid motions are, most of the time, non-bijective (see Fig. 2). Besides, they guarantee neither topology nor geometry preservation of \(\mathsf {X}\) (see Fig. 1).

Fig. 2.
figure 2

(a) Points of \(\mathbb {Z}^2\) (triangles), initially located at the center of unit squares of the Cartesian tiling of the Euclidean space. (b) After a rigid motion \({\mathfrak T}\) of these points (circles), some of the unit square cells contain no point (non-surjectivity, green cells) or two points (non-injectivity, red cells); the transformation \({\mathcal T}\) is no longer bijective. (Color figure online)

3 Regular Images and Topological Invariance Under Rigid Motions

The above problems were studied in [18] and led to the notion of regularity in \(\mathbb Z^2\) defined in the frameworks of digital topology [7] and well-composed images [11] (see Sect. 3.2). Unfortunately, this notion of regularity is inadequate in \(\mathbb Z^3\) (Sect. 3.3).

3.1 Digital Topology and Well-Composed Images

Digital topology [7] provides a simple framework for handling the topology of binary images in \(\mathbb {Z}^n\). It is shown in [14] that it is compliant with other discrete models (e.g. Khalimsky grids [5] and cubical complexes [8]) but also with continuous notions of topology [15].

Practically, digital topology relies on adjacency relations: two distinct points \({\mathsf p}, {\mathsf q}\in \mathbb {Z}^2\) are k-adjacent if \(\Vert {\mathsf p}- {\mathsf q}\Vert _{\ell } \le 1\) with \(k=2n\) (resp. \(3^n-1\)) when \(\ell = 1\) (resp. \(\infty \)). In the case of \(\mathbb {Z}^2\) (resp. \(\mathbb {Z}^3\)), we retrieve the well-known 4- and 8-adjacency (resp. 6- and 26-adjacency) relations. If two points \({\mathsf p}\), \({\mathsf q}\) are k-adjacent, we note \({\mathsf p}\smallfrown _{k} {\mathsf q}\).

From the reflexive–transitive closure of the k-adjacency relation on a finite subset \(\mathsf {X} \subset \mathbb {Z}^n\), we derive the k-connectivity relation on \(\mathsf {X}\). It is an equivalence relation whose equivalence classes are called the k-connected components of \(\mathsf {X}\). Due to paradoxes related to the discrete version of the Jordan theorem [13], some dual adjacencies are used for \(\mathsf {X}\) and its complement \(\overline{\mathsf {X}} = \mathbb Z^n \setminus \mathsf {X}\), namely the \((k,\overline{k})\)-adjacencies [22], where \((k,\overline{k})= (2n, 3^{n}-1)\) or \((3^{n}-1, 2n)\).

The notion of well-composedness [11] was then introduced to characterize some digital sets \(\mathsf {X}\) whose structure intrinsically avoids the topological issues of the Jordan theorem in \(\mathbb {Z}^2\) and further in higher dimensions.

Definition 1

(Well-composed sets [11]). We say that a set \(\mathsf {X} \subset \mathbb {Z}^2\) is weakly well-composed if any 8-connected component of \(\mathsf {X}\) is also a 4-connected component. We say that \(\mathsf {X}\) is well-composed if both \(\mathsf {X}\) and \(\overline{\mathsf {X}}\) are weakly well-composed.

The notion of well-composedness on sets is trivially extended to binary images: an image \(I : \mathbb {Z}^2 \rightarrow \{ 0, 1 \}\), defined by the finite set \(\mathsf {X} = I^{-1}(\{1\}) = \{ {\mathsf p}\in \mathbb {Z}^2 \mid I({\mathsf p}) = 1 \}\) is well-composed when \(\mathsf {X}\) is well-composed.

This definition implies that the boundaryFootnote 1 of \(\mathsf {X}\) is a set of 1-manifolds whenever \(\mathsf {X}\) is well-composed. In particular, a definition of well-composedness in \(\mathbb {Z}^n\), \(n \ge 3\), is based on this \((n-1)\)-manifoldness characterization. This discussion is out of the scope of this paper; the interested reader is referred to [4, 10] for more details.

3.2 Topological Invariance Under Rigid Motions in \(\mathbb {Z}^2\)

Given a binary image I, a rigid motion \({\mathcal T}: \mathbb {Z}^2 \rightarrow \mathbb {Z}^2\), and the transformed imageFootnote 2 \(I_{{\mathcal T}}\) obtained from I and \({\mathcal T}\), a frequent question in image analysis is: “does \({\mathcal T}\) preserve the topology between I and \(I_{{\mathcal T}}\)?”. It is generally answered by observing the topological invariants of these images.

Among the simplest topological invariants are the Euler-Poincaré characteristics and the Betti numbers. However, these are too weak to accurately model the notion of “topology preservation” between digital images [13]. Therefore, it is necessary to consider stronger topological invariants, e.g. the (digital) fundamental group [6], the homotopy-type (considered via various notions of simple points [2, 3] or simple sets [19]), or the adjacency tree [21]. The adjacency tree was considered in [18] and allowed to develop comprehensive proofs of the topology preservation properties. Indeed, in the 2D case, this topology preservation is equivalent to the preservation of the homotopy-type [23], that is the most commonly used topological invariant in 2D image processing.

Definition 2

(Topological invariance [18]). Let I be a binary and well-composed image. We say that I is topologically invariant if any transformed image \(I_{{\mathcal T}}\) has an adjacency-tree isomorphic to that of I.

In [18], a new notion of regularity was then introduced for 2D images.

Definition 3

(Regular image [18]). Let \(I : \mathbb Z^2 \rightarrow \{0,1\}\) be a non-singularFootnote 3, well-composed image. Let \(v \in \{ 0, 1 \}\). We say that I is v-regular if for any \({\mathsf p}, {\mathsf q}\in I^{-1}(\{v\})\), we have

(4)

where . We say that I is regular if it is both 0- and 1-regular.

The regularity—which strengthens the notion of well-composedness—provides sufficient conditions for topological invariance under rigid motions.

Theorem 1

([18]). An image \(I : \mathbb Z^2 \rightarrow \{0,1\}\) is topologically invariant if it is regular.

3.3 Topological Alterations Under Rigid Motions on \(\mathbb {Z}^3\)

In \(\mathbb Z^2\), Definition 3 describes a regular set \(\mathsf {X}\) (resp. its complement \(\overline{\mathsf {X}}\)) as a cover of \(2 \times 2\) squares that must locally intersect everywhere. Intuitively, the extension of this definition to \(\mathbb Z^3\) would consist of considering a cover of \(2 \times 2 \times 2\) cubes, that would also locally overlap everywhere. One may expect that a regular image in \(\mathbb Z^3\) would also be topologically invariant. However, this is false, in general.

Indeed, for any regular image I containing a connected set \(\mathsf {X}\) (composed of at least one \(2 \times 2 \times 2\) cube), we can find an ad hoc transformation \({\mathcal T}\) and a point \({\mathsf p}\in \mathbb Z^3\) such that \(I_{\mathcal T}({\mathsf p}) = 1\) whereas for any \({\mathsf q}\smallfrown _6{} {\mathsf p}\) we have \(I_{\mathcal T}({\mathsf q}) = 0\). An example of such a case is illustrated in Fig. 3(a). This provides us with counterexamples to the putative extension of Theorem 1 to the 3D case. For an illustration, we refer the reader to Fig. 3(b, c).

Fig. 3.
figure 3

(a) A sample of a regular set \(\mathsf {X} \subset \mathbb Z^3\), illustrated as its voxel polyhedron \(P \subset \mathbb R^3\) (in green); \(\mathsf {X}\) is 6-connected. Let us consider a rigid motion \({\mathfrak T}^{-1}\) of \(\mathbb {Z}^3\), a part of which (transformation of a point and its 6-adjacent neighborhood) is illustrated by blue dots. The central point (in dark blue) lies in P, whereas all of its 6-adjacent points (in light blue) do not. With such a transformation, \([{\mathfrak D}\circ ({\mathfrak T}^{-1})]^{-1}(\mathsf {X})\) is not 6-connected anymore. (b,c) A counterexample to the topology-preservation of a part of a 3D regular image under rigid motion: (b) a part of a regular set, which is 6-connected; (c) the transformed set, obtained after applying a rigid motion, which is no longer 6-connected; see, e.g. the blue voxel, which has all of its 6-adjacent points in the background. (d,e) Another counterexample to the topology-preservation of a 3D regular image under rigid motion: (d) a regular set, which is 6-connected; (e) the transformed set, which is no longer 6-connected (see the blue voxel). (Color figure online)

This implies that the notion of regularity reaches its limit of validityFootnote 4 in \(\mathbb Z^2\). Alternative approaches are then required to handle the case of topology preservation under rigid motions in higher dimensions.

4 Quasi-regular Polytopes and Their Digitization

As discussed previously, the topological properties of digital sets in \(\mathbb {Z}{}^n\) may be altered by rigid motions. This is due, in particular, to the process (Eq. (3)) that aims to map back the transformed result from \(\mathbb R^n\) to \(\mathbb Z^n\). In practice, this issue is the same as the problem of digitization encountered for defining the digital analog of a continuous set.

Recently, the notion of quasi-r-regularity [16] was introduced together with an algorithmic scheme in order to perform rigid motions on digital sets in \(\mathbb Z^2\). The scheme relies on the use of intermediate modeling of a 2D digital set as a piecewise affine subset of \(\mathbb {R}^2\), namely a polygon. The rigid motion transforms this polygon, and a result in \(\mathbb Z^2\) is then retrieved by a final digitization of the transformed polygon. The polygon in \(\mathbb R^2\) and its digitized analog in \(\mathbb Z^2\) have the same topology if the polygon is quasi-r-regular.

Then, the use of an intermediate continuous model allows one to avoid the alterations induced by the standard pointwise definition of rigid motions that led to the difficulties identified in the case of regularity (see Sect. 3.2).

We recall the definitions of quasi-r-regularity that was initially defined in \(\mathbb {R}^2\) [16] and then extended to \(\mathbb {R}^3\) [17]. These definitions and associated results are developed in the case of simply connected (i.e. connected, without tunnels/holes) digital sets.

Definition 4

(Quasi-r-regularity [16, 17]). Let \( X \subset \mathbb {R}^n\) (\(n=2,3\)) be a bounded, simply connected set. We say that \( X \) is quasi-r-regular with margin \(r^{\prime }-r\) (with \(r^{\prime } \ge r > 0\)) if it satisfies the following four properties:

  • \( X \ominus B_r\) is non-empty and connected,

  • \(\overline{ X } \ominus B_r\) is connected,

  • \( X \subseteq X \ominus B_r \oplus B_{r^{\prime }}\),

  • \(\overline{ X } \subseteq \overline{ X } \ominus B_r \oplus B_{r^{\prime }}\),

with \(\oplus , \ominus \) the standard dilation and erosion operators and \(B_r, B_r' \subset \mathbb {R}^n\) the closed balls of radius r and \(r'\), respectively.

The Gauss digitization of a quasi-r-regular set \( X \subset \mathbb R^2\) (namely \( X \cap \mathbb {Z}^2\)) is a well-composed set that remains simply connected, thus preserving its topological properties from \(\mathbb R^2\) to \(\mathbb Z^2\).

Proposition 1

([16]). If \( X \subset \mathbb {R}{}^2\) is quasi-1-regular with margin \(\sqrt{2} - 1\), then \(\mathsf {X} = X \cap \mathbb {Z}^2\) and \( \mathsf {\overline{X}} = \overline{ X } \cap \mathbb {Z}^2\) are both 4-connected. In particular, \(\mathsf {X} \subset \mathbb {Z}{}^2\) is well-composed.

In [17], a similar resultFootnote 5 was obtained for convex quasi-r-regular sets of \(\mathbb {R}^3\). This result is extended hereafter to any quasi-r-regular sets of \(\mathbb {R}^3\).

Proposition 2

(Extended from [17]). If \(X \subset \mathbb {R}{}^3\) is quasi-1-regular with margin \(\frac{2}{\sqrt{3}} - 1\), then \(\mathsf {X} = X \cap \mathbb {Z}^3\) and \(\mathsf {\overline{X}} = \overline{X} \cap \mathbb {Z}^3\) are both 6-connected.

Proof

We only prove the 6-connectedness of \(\mathsf {X}\); the same reasoning holds for \(\mathsf {\overline{\mathsf {X}}}\). Let us first prove that \((X \circ B_1) \cap \mathbb {Z}^3\) is 6-connected. Let \({\mathsf p}\) and \({\mathsf q}\) be two distinct points of \((X \circ B_1) \cap \mathbb {Z}^3\). Let \(B^{\mathsf p}_1\) and \(B^{\mathsf q}_1\) be two balls of radius 1, included in \(X \circ B_1\) and such that \({\mathsf p}\in B^{\mathsf p}_1\) and \({\mathsf q}\in B^{\mathsf q}_1\) (such balls exist, from the definition of opening). Let \(b_{\mathsf p}\) and \(b_{\mathsf q}\) be the centers of \(B^{\mathsf p}_1\) and \(B^{\mathsf q}_1\), respectively. We have \(b_{\mathsf p}, b_{\mathsf q}\in X \ominus B_1\), from the definition of erosion. Since \(X \ominus B_1\) is connected in \(\mathbb {R}^3\), there exists a continuous path \(\varPi \) from \(b_{\mathsf p}\) to \(b_{\mathsf q}\) in \(X \ominus B_1\). Note that for any ball \(B_1\), we always have \(B_1 \cap \mathbb {Z}^3\) non-empty and 6-connected; in particular it contains at least two points of \(\mathbb {Z}^3\). For a value \(\varepsilon > 0\) small enough, two balls \(B_1\) and \(B'_1\) with centres distant of \(\varepsilon \) are such that \(B_1 \cap B'_1 \cap \mathbb {Z}^3 \ne \emptyset \). As a consequence, the union \(\bigcup _{b \in \varPi } B_1(b) \cap \mathbb {Z}^3\) (with \(B_1(b)\) the ball of center b) is a 6-connected set of \(\mathbb {Z}^3\), and \({\mathsf p}\), \({\mathsf q}\) are then connected in \((X \circ B_1) \cap \mathbb {Z}^3\). Our purpose is then to prove that any integer point \({\mathsf p}\) in \(X \setminus (X \circ B_1)\) is 6-adjacent to a point of \((X \circ B_1) \cap \mathbb {Z}^3\). Let \({\mathsf p}\in X \setminus (X \circ B_1)\) be such point. From Definition 4, we have \({\mathsf p}\in X \subseteq X\,\ominus \,B_1\,\oplus \,B_{\frac{2}{\sqrt{3}}}\). Then, from the definition of dilation, there exists \(b \in X\,\ominus \,B_1\) such that b is the center of a ball \(B_{\frac{2}{\sqrt{3}}}(b)\) of radius \(\frac{2}{\sqrt{3}}\), and \({\mathsf p}\) is a point within this ball. The distance between b and \({\mathsf p}\) is lower than \(\frac{2}{\sqrt{3}}\). As b is a point of \(X\,\ominus \,B_1\), it is also the center of a ball \(B_1(b)\) of radius 1 included in \(X\,\circ \,B_1\). From the definition of adjacency, any point \({\mathsf q}\) being 6-adjacent to \({\mathsf p}\) belongs to the sphere \(S_1({\mathsf p})\) of radius 1 and center \({\mathsf p}\). Let us consider the intersection D between \(S_1({\mathsf p})\) and \(B_1(b)\). This set D is a spherical dome, namely a part of the sphere \(S_1({\mathsf p})\) with a circular boundary C. This set C also corresponds to the intersection of \(S_1({\mathsf p})\) and the 2D plane orthogonal to the line \((b{\mathsf p})\) and intersecting the segment \([b{\mathsf p}]\) at an equal distance lower than \(\frac{1}{\sqrt{3}}\) from both b and \({\mathsf p}\). Then, the radius of this circle C is greater than \(\sqrt{1^2 - (\frac{1}{\sqrt{3}})^2} = \frac{\sqrt{6}}{3}\). In particular, C encompasses an equilateral triangle of edge length \(\sqrt{2}\). As a consequence, the spherical dome D of \(S_1({\mathsf p})\) bounded by this circle always contains at least one point \({\mathsf q}\smallfrown _6 {\mathsf p}\). As such point \({\mathsf q}\) lies in \((X \circ B_1)\,\cap \,\mathbb {Z}^3\), it follows that \(\mathsf {X}\) is 6-connected. \(\square \)

Remark 1

The value \(r'\) (see Definition 4), required to define the margin \(r'-1\) for quasi-1-regular sets, is \(\sqrt{2} = \frac{2}{\sqrt{2}}\) in \(\mathbb Z^2\) and \(\frac{2}{\sqrt{3}}\) in \(\mathbb Z^3\). The above proof allows us to understand that in \(\mathbb Z^n\), the required value \(r'\) is \(\frac{2}{\sqrt{n}}\). Indeed, the crucial part of the proof is to ensure that a point \({\mathsf p}\) of \(X \setminus (X \circ B_1)\,\cap \,\mathbb Z^n\) remains 2n-adjacent to points of \((X \circ B_1)\,\cap \,\mathbb Z^n\). To this end, let us consider a \((n-1)\)-simplex of \(\mathbb R^n\), whose vertices are spatially organized as the n points induced by the orthonormal basis of \(\mathbb R^n\). This \((n-1)\)-simplex must be encompassed by the \((n-2)\)-sphere C that is the intersection between the \((n-1)\)-sphere \(S_1({\mathsf p})\) of center \({\mathsf p}\) and radius 1 and the hyperplane orthogonal to the segment \([b {\mathsf p}]\) and equidistant to \({\mathsf p}\) and a point \(b \in X \ominus B_1\) defined as the centre of a ball \(B_{\frac{2}{\sqrt{n}}}(b)\) that contains \({\mathsf p}\). Note that \({\mathsf p}\) is, by construction, at a distance \(r'\) from b. The distance between the barycentre of this \((n-1)\)-simplex and its vertices, i.e. the radius of the \((n-1)\)-sphere C is \(\sqrt{1-\frac{1}{n}}\). Since each point of C is at a distance 1 of \({\mathsf p}\) while the center of C is on the segment \([b {\mathsf p}]\) at a distance \(\frac{r'}{2}\) from \({\mathsf p}\), it follows that the distance between \({\mathsf p}\) and b, namely \(r'\), is \(\frac{2}{\sqrt{n}}\).

The following property is a direct corollary of this remark and it provides a dimensional limit of validity for the notion of quasi-1-regularity.

Property 1

In \(\mathbb R^4\), the value \(r'\) required for quasi-1-regularity is \(\frac{2}{\sqrt{4}} = 1\). Then, the margin \(r'-r\) is equal to 0, in other words, no margin is permitted. The notion of quasi-r-regularity then becomes similar to that of r-regularity [20]. In particular, only smooth sets of \(\mathbb R^4\) can be quasi-1-regular.

5 Links Between Regularity and Quasi-r-Regularity: The Cubic Polygonal Model

We now investigate the links between the notions of regularity [18] (Sect. 3) and quasi-r-regularity [16, 17] (Sect. 4). Note that we still focus on simply connected sets.

5.1 2D Case

The paradigm of quasi-r-regularity for rigid motion of digital sets \(\mathsf {X} \subset \mathbb {Z}^2\) acts in three steps. First, a polygon \(P \subset \mathbb R^2\) is defined as a continuous representation of \(\mathsf {X}\). Note that there exist various ways of carrying out polygonization. The main constraint is the coherence between the polygon P and its digital analog \(\mathsf {X}\). In particular, it is important to satisfy \(P \cap \mathbb Z^2 = \mathsf {X}\). Second, the polygon P is transformed by \({\mathfrak T}\) (Eq. (1)). In other words, we build a new polygon \(P_{\mathfrak T}= {\mathfrak T}(P) = \{{\mathfrak T}(x) \mid x \in P\}\). Third, the transformed polygon \(P_{\mathfrak T}\subset \mathbb R^2\) is digitized to map the result back onto \(\mathbb Z^2\). To this end, we use the Gauss digitization model, i.e. we set \(\mathsf {X}_{\mathcal T}{} = P_{\mathfrak T}\cap \mathbb Z^2 = {\mathfrak T}(P) \cap \mathbb Z^2\).

When considering the notion of regularity, at the first sight, the paradigm for rigid motion of digital sets \(\mathsf {X} \subset \mathbb {Z}^2\) may appear as a different one. It is however the same. In order to compute the transformed object \(\mathsf {X}_{\mathcal T}\) from \(\mathsf {X}\), we do not use the forward transformation model, but the backward one. More precisely, we define \(\mathsf {X}_{\mathcal T}\) as \([{\mathfrak D}\circ ({\mathfrak T}^{-1})]^{-1}(\mathsf {X})\), that is \(\mathsf {X}_{\mathcal T}= \{x \in \mathbb Z^2 \mid {\mathfrak D}\circ ({\mathfrak T}^{-1})(x) \in \mathsf {X}\}\). But this formula is equivalentFootnote 6 to where is the polygon defined as , with the closed, unit square centered on (0, 0). In other words, we implicitly apply the three-step polygonization-based algorithm involved in the context of quasi-r-regularity, with a specific kind of polygonization, called cubic polygonization. This polygonization associates a digital set \(\mathsf {X} \subset \mathbb Z^2\) with its set of pixels, i.e. Voronoi cells in \(\mathbb R^2\). In particular, it is plain that such polygonization satisfies .

The question which now arises is to determine whether a regular digital set \(\mathsf {X}\) leads to a quasi-1-regular polygon . The answer is negative; this emphasizes the fact that quasi-1-regularity is a sufficient, yet non-necessary condition for topology preservation.

Property 2

The regularity of a simply connected set \(\mathsf {X} \subset \mathbb {Z}^2\) does not imply the quasi-1-regularity of .

To prove this property, it is sufficient to exhibit a counterexample. A simple one is the object \(\mathsf {X} \subset \mathbb {Z}^2\) defined as the union of two \(2 \times 2\) patterns intersecting in exactly one point; for instance, \(\mathsf {X} = \{(0,0),(1,0),(0,1),(1,1),(2,1),(1,2),(2,2)\}\). This set is obviously regular, but the associated polygon is not quasi-1-regular. Indeed, we have , which is composed of two points in \(\mathbb R^2\) and is non-connected.

In [18] the strategy for building a regular set from a well-composed set \(\mathsf {X}\) was to up-sample \(\mathsf {X}\), i.e. to define a new set \(\mathsf {X_2} \in \mathbb Z^2\) such that \((x,y) \in \mathsf {X} \Leftrightarrow (2x,2y) + \{0,1\}\times \{0,1\} \subseteq \mathsf {X_2}\). By applying the same strategy on a regular set \(\mathsf {X}\), we can build an up-sampled set \(\mathsf {X_2} \subset \mathbb Z^2\) which is still regular, but also quasi-1-regular. In other words, with the cubic polygonization model, regularity implies quasi-r-regularity—up to an up-sampling realized by doubling the resolution of the Cartesian grid.

Proposition 3

If a simply connected set \(\mathsf {X} \subset \mathbb {Z}^2\) is regular, then \(\mathsf {X_2} \subset \mathbb {Z}^2\) is regular and is quasi-1-regular with margin \(\sqrt{2}-1\).

Proof

The regularity of \(\mathsf {X_2}\) is obvious. We show the non-vacuity and connectedness of and the fact that ; the same reasoning holds for . Since \(\mathsf {X}\) is regular, it is defined as \(\mathsf {X} = S \oplus \{0,1\}^2\) where \(S = \{ (x,y) \in \mathsf {X} \; \vert \; (x,y) + \{0,1\}^2 \subset \mathsf {X} \}\). By definition, we have \(\mathsf {X_2} = \bigcup _{(x,y) \in S} (2x,2y) + \{0,1,2,3\}^2\). Let \((x,y) \in S\). We have , and then . Then we have on the one hand, and , on the other hand. Due to the specific square structure of \(\mathsf {X_2}\) and its regularity, we have , where is the square of edge size 2 centered on (0, 0). In particular, we have , and we note the residue between both. The non-vacuity of . Up to a translation of \((-\frac{1}{2},-\frac{1}{2})\) and a scaling of factor \(\frac{1}{2}\), the set is equal to \(\bigcup _{(x,y) \in S} [x,x+1] \times [y,y+1]\). The existence of a continuous path between two points of \(\bigcup _{(x,y) \in S} [x,x\,+\,1] \times [y,y+1]\) is equivalent to the existence of a 4-path between two points of \(\bigcup _{(x,y) \in S} \{x,x\,+\,1\} \times \{y,y\,+\,1\} = \bigcup _{(x,y) \in S} (x,y) + \{0,1\}^2 = \mathsf {X}\). Since \(\mathsf {X}\) is 4-connected in \(\mathbb Z^2\), it follows that is connected in \(\mathbb R^2\). The residue R is composed of connected components of \(\mathbb R^2\) (namely “triangular” shapes formed by two edges of length 1 adjacent to the border of and a third concave, edge defined as a the quadrant of a circle of radius 1); the connectedness of then follows from that of . We have . Since , the decreasingness of erosion and increasingness of dilation lead to . \(\square \)

5.2 3D Case

As already observed in Sect. 3.3, the extension of the notion of regularity to \(\mathbb {Z}^3\) leads to 3D regular sets that may not be topologically invariant (see Fig. 3 for examples). Actually, we have an even stronger result, regularity in 3D never leads to quasi-r-regularity.

Property 3

Let \(\mathsf {X} \subset \mathbb {Z}^3\) be a simply connected, regular set. Let , with the closed, unit cube centered at (0, 0, 0). Then is never quasi-1-regular with margin \(\frac{2}{\sqrt{3}} - 1\).

To prove this property, it is sufficient to observe that for any salient vertex v of (such vertex exists, as \(\mathsf {X}\) is finite and is then bounded), the distance between v and . Then, v does not belong to .

In particular, the up-sampling strategy proposed in the 2D case is useless in 3D. Indeed, in 2D this up-sampling allowed us to tackle connectedness issues in , whereas in 3D connectedness issues occur in the complement part , and the size of this residue is not impacted by increasing the resolution of the Cartesian grid.

6 Links Between Regularity and Quasi-r-Regularity: The Marching Squares/Cubes Polygonal Model

6.1 2D Case

The above cubic polygonization is the model implicitly considered when applying a pointwise rigid motion with the backward transformation model, and with the nearest neighbor digitization operator \({\mathfrak D}\) (Eq. (2)). This trivial polygonization is directly mapped on the pixel structure of the image, leading to poor modeling of the shape of the underlying continuous set.

There exist numerous ways of polygonizing a digital set. Here, we investigate the marching squares (MS) model, which is probably the simplest polygonization, except from the cubic one. In our case, the considered images are binary and regular. Then, the MS polygonization is the same as the cubic polygonization, except in the \(2 \times 2\) configurations \((x,y)+\{0,1\}^2\) where one point (for instance (xy)) belongs to \(\mathsf {X}\) (resp. \(\overline{\mathsf {X}}\)) while the other three belong to \(\overline{\mathsf {X}}\) (resp. \(\mathsf {X}\)). In that case, the edge of the MS polygon, noted \(P_\Diamond (\mathsf {X})\), associated to \(\mathsf {X}\) is a segment between the points \((x,y+\frac{1}{2}), (x+\frac{1}{2},y)\) (whereas the cubic polygon would locally have edges/segments between the points \((x,y+\frac{1}{2}), (x+\frac{1}{2},y+\frac{1}{2})\) and \((x+\frac{1}{2},y+\frac{1}{2}), (x+\frac{1}{2},y)\)).

In the case of a regular object \(\mathsf {X} \subset \mathbb Z^2\), the MS polygonization can be formalized as follows. We have \(\mathsf {X} = S \oplus \{0,1\}^2\), where \(S = \{ (x,y) \in \mathsf {X} \; \vert \; (x,y) + \{0,1\}^2 \subset \mathsf {X} \}\). By setting \(S' = (\frac{1}{2},\frac{1}{2}) + S\), this rewrites as \(\mathsf {X} = \bigcup _{(x,y) \in S'} (x,y) + \{-\frac{1}{2},\frac{1}{2}\}^2\). In other words, \(S'\) is the set of barycenters of the \(2 \times 2\) square subsets of points forming \(\mathsf {X}\). Let C be the octagon centered on (0, 0), formed by the two edges \([(-\frac{1}{2},1),(\frac{1}{2},1)]\) and \([(\frac{1}{2},1),(1,\frac{1}{2})]\), and the other six edges obtained by rotation of center (0, 0) and angles \(k.\pi /2\), \(k = 1, 2, 3\), of these two edges. (Note that the distance between (0, 0) and the four edges induced by \([(-\frac{1}{2},1),(\frac{1}{2},1)]\) (resp. \([(\frac{1}{2},1),(1,\frac{1}{2})]\)) is 1 (resp. \(\frac{3}{2 \sqrt{2}} > 1\))). Let \(G = \bigcup \{ [p,q] \subset \mathbb R^2 \mid p, q \in S' \wedge 0 < \Vert p - q\Vert _2 \le \sqrt{2} \}\). In other words, G is the set of the continuous straight segments linking the points of \(S'\) that are either 4- or 8-adjacent in the grid \(\mathbb Z^2 + (\frac{1}{2},\frac{1}{2})\).

Property 4

Let \(\mathsf {X}\) be a simply connected set. If \(\mathsf {X}\) is regular, then \(P_\Diamond (\mathsf {X}) = G \oplus C\)

Despite its simplicity, this MS polygonization model is sufficient for linking the notions of regularity and quasi-r-regularity.

Proposition 4

Let \(\mathsf {X} \subset \mathbb {Z}^2\) be a simply connected set. If \(\mathsf {X}\) is regular, then \(P_\Diamond (\mathsf {X}) \subset \mathbb R^2\) is quasi-1-regular with margin \(\sqrt{2}-1\).

Proof

We show the non-vacuity and connectedness of \(P_\Diamond (\mathsf {X}) \ominus B_1\) and the fact that \(P_\Diamond (\mathsf {X})\subseteq P_\Diamond (\mathsf {X}) \ominus B_1 \oplus B_{\sqrt{2}}\); the same reasoning holds for \(\overline{P_\Diamond (\mathsf {X})}\). We have \(B_1 \subset C\). Then, it leads to \(S' \subset G \subseteq G \oplus C \ominus B_1 = P_\Diamond (\mathsf {X}) \ominus B_1\). The non-vacuity of \(P_\Diamond (\mathsf {X}) \ominus B_1\) derives from that of \(S'\) and S. From the definition of regularity, it is plain that G is a connected subset of \(\mathbb R^2\). Since C is convex, \(G \oplus C\) is also a connected subset of \(\mathbb R^2\). But as \(B_1\) is convex and \(B_1 \subset C\), \(G\,\oplus \,C\,\ominus \,B_1 = P_\Diamond (\mathsf {X})\,\ominus \,B_1\) is also connected in \(\mathbb R^2\). We have \(C \subset B_{\sqrt{2}}\), then \(G \oplus C \subseteq G \oplus B_{\sqrt{2}}\). But we also have \(G \subseteq P_\Diamond (\mathsf {X}) \ominus B_1\), then \(G \oplus B_{\sqrt{2}} \subseteq P_\Diamond (\mathsf {X}) \ominus B_1 \oplus B_{\sqrt{2}}\). It follows that \(P_\Diamond (\mathsf {X}) = G \oplus C \subseteq P_\Diamond (\mathsf {X}) \ominus B_1 \oplus B_{\sqrt{2}}\). \(\square \)

6.2 3D Case

Similarly to the case of the cubic polyhedrization, we observe that the standard marching cubes (MC) method [12], namely the 3D version of the marching squares, also fails to generate a quasi-r-regular polyhedron from a regular set.

Property 5

Let \(\mathsf {X} \subset \mathbb {Z}^3\) be a simply connected, regular set. Let \(P_\Diamond (\mathsf {X})\) be the polyhedron generated from \(\mathsf {X}\) by MC polyhedrization. Then \(P_\Diamond (\mathsf {X})\) is never quasi-1-regular with margin \(\frac{2}{\sqrt{3}} - 1\).

To prove this property, it is sufficient to observe that there exists a vertex v on a convex part of \(P_\Diamond (\mathsf {X})\) (such vertex exists, as \(\mathsf {X}\) is finite and \(P_\Diamond (\mathsf {X})\) is then bounded), such that the distance between v and \(P_\Diamond (\mathsf {X}) \ominus B_1\) is \(\frac{\sqrt{6}}{2} > \frac{2}{\sqrt{3}}\). Thus, v does not belong to \(P_\Diamond (\mathsf {X}) \ominus B_1 \oplus B_{\frac{2}{\sqrt{3}}}\).

7 Conclusion

In this article, we observed that the notion of quasi-r-regularity allows one to define polygons/polyhedra that preserve their topology under digitization in \(\mathbb Z^n\) for \(n = 2, 3\) (this property is no longer valid in \(\mathbb Z^n\), \(n \ge 4\)). As a consequence, building a quasi-r-regular polygon/polyhedron from a digital set in \(\mathbb Z^2\) or \(\mathbb Z^3\) for handling topology-preserving rigid motions is relevant. In this context, we established that two simple polygonization models (cubic model and marching squares) can link the notions of regularity and quasi-r-regularity in \(\mathbb Z^2\). However, in 3D, the corresponding models fail to generate quasi-r-regular polyhedra in \(\mathbb R^3\). Our further works will consist of investigating other kinds of polyhedrization devoted to 3D regular images.