1 Introduction

There are several competing algorithms for the computation of the surface area of a set which is only observed through a pixel image, e.g., [1, 6, 10, 12,13,14, 21]; see [11, Sec. 12.2 and 12.5] for an overview. This paper deals with so-called local algorithms, [13, 14, 21] in the above list. Local algorithms for binary images are easy to implement and computationally fast, but they cannot be multigrid convergent, while of the estimators mentioned in the above list [1, 6] and [12] are multigrid convergent. In many situations easy implementation and fast computation are more important than multigrid convergence and therefore local estimators for the surface area are used, e.g., by MAVI [17]. Svane [26] considers local estimators for the surface area based on grayscale images. These estimators are multigrid convergent, and it can be expected that they are even simpler to implement than local estimators for binary images and that they are comparable regarding computation time. However, Svane’s estimators rely on quite severe assumptions which limit their range of applicability. First, the image is assumed to be the convolution of the displayed object with the point spread function. This is not a reasonable assumption if the image is recorded using computed tomography. Second, the point spread function is assumed to be known.

The idea behind local algorithms is the following: In a d-dimensional image a pattern of side length n is called \(n\times \dots \times n\)-pixel configuration (d factors). Mathematically, it is modeled as a disjoint partition (BW) of \(\{0,\dots , n-1\}^d\) into two disjoint subsets, where B represents the set of black pixels and W represents the set of white pixels. Since the set \(\{0,\dots , n-1\}^d\) consists of \(n^d\) points and each point is either colored black or colored white, there are \(2^{(n^d)}\) pixel configurations. We enumerate them as \((B_j,W_j), \, j=1,\dots ,2^{(n^d)}\). A pixel image of lattice distance \(t>0\) can be represented by the set \(A\subseteq t\mathbb {Z}^d\) of its black pixels, where tS for \(t>0\) and \(S\subseteq \mathbb {R}^d\) is the homothetic image \(\{tx\mid x\in S\}\) of S with scaling factor t and scaling center at the origin. While the observation window is usually bounded in applications, our results hold only if the observed set K is completely contained in the observation window and thus we assume that the observation window is \(\mathbb {R}^d\). Now the j-th pixel configuration count at lattice distance t of the image A is defined as

$$ N_{t,j}(A) = \#\big \{ v\in \mathbb {Z}^d \mid (A-tv) \cap \{0,\dots , (n-1)t\}^d = tB_j\}. $$

It represents the number of occurrences of the j-th pixel configuration in the image A, cf. Fig. 1. We assume that A is a pixel image \(A_t(K)\) of K at lattice distance t. A local algorithm now approximates the surface area S(K) of a set \(K\subseteq \mathbb {R}^d\) by a weighted sum

$$\begin{aligned} \sum _{j=1}^{2^{(n^d)}} t^{d-1} w_{j} N_{t,j}(A) \end{aligned}$$
(1)

of pixel configuration counts, where \(w_{j}\) are constants chosen in advance, called weights. The factor \(t^{d-1}\) compensates for the fact that \(N_{t,j}(A)\) increases of order \((1/t)^{d-1}\) as \(t\rightarrow 0\) for those pixel configurations \((B_j,W_j)\) which are “responsible” for the surface area (see [25, Corollary 3.2] for ways how to make this precise). The two pixel configurations \((B_1, W_1)=(\emptyset , \{0,\dots , n-1\}^d)\) and \((B_{2^{(n^d)}}, W_{2^{(n^d)}})=(\{0,\dots , n-1\}^d, \emptyset )\) consisting only of white pixels resp. consisting only of black pixels lie typically outside resp. inside the image set A and not on its boundary. Hence, these counts do not provide information about the surface area. Thus, one should put

$$\begin{aligned} w_1=w_{2^{(n^d)}}=0, \end{aligned}$$
(2)

which will be assumed in this paper.

Fig. 1
figure 1

Pixel configuration counts. The \(2\times 2\)-pixel configuration on the left occurs 8 times in the image on the right. Thus, the pixel configuration count of the pixel configuration on the left in the image on the right is 8. Notice that while pixel images are by definition subsets of the pixel lattice and thus consists of discrete points, it is convenient to plot the pixels so large that they (almost) touch each other, when the space in between the pixels is of no importance

Fig. 2
figure 2

The Gauss discretization. The lower picture is the Gaussian discretization of the set plotted gray in the upper picture w.r.t the pixel lattice plotted black in the upper picture

For the theoretical investigation of surface area estimators, we assume that the set \(K\subseteq \mathbb {R}^d\) is randomly shifted, i.e., the random set \(K+tU:=\{x+tU \mid x\in K\}\) for a random vector U is considered. A natural choice for the distribution of U is the uniform distribution on \([0,1)^d\), but the results of this paper will hold for any distribution of U. As discretization model the Gauss discretization is used, i.e., a pixel is colored black if it lies in the shifted set \(K+tU\) and is colored white otherwise; cf. Fig. 2. Thus, the model for the image of K is

$$ A=(K+tU) \cap t\mathbb {Z}^d.$$

Under these assumptions no asymptotically unbiased local estimator for the surface area exists. More specifically, it is shown in [29] that, when U is uniformly distributed on \([0,1)^3\), any local estimator of the surface area in \(\mathbb {R}^3\) attains relative asymptotic biases of at least \(4\%\) for certain test sets and, moreover, explicit weights for which this lower bound is achieved are given. However, the bias is only one component of the error. There are a number of papers investigating the other component, namely the variance, for other estimators. Hahn and Sandau [4] as well as Janác̆ek and Kubínová [8] investigate estimators which are suitable when the picture is analogue or when limited computational capacity requires an artificial coarsening of the image. Svane [27] investigates the variance of the above-mentioned local algorithms for grayscale images. There is no estimator for binary digital images for which the variance has been investigated so far. The objective of the present paper is to examine the variance of local estimators for binary digital images.

While we use a similar setup as [29], we need slightly more strict regularity assumptions on the set K. In \(\mathbb {R}^2\) we assume:

  1. (R1)

    The boundary \({{\,\mathrm{bd}\,}}K\) of K is piecewise the graph of a convex or concave function with either of the two coordinate axis being the domain, i.e.,

    $$ {{\,\mathrm{bd}\,}}K = \bigcup _{k=1}^m F_k, $$

    where for each \(k\in \{1,\dots , m\}\) we have either

    $$\begin{aligned} F_k&= \{ (x,f_k(x)) \mid x\in D_k \} \quad \text{ or } \\ F_k&= \{ (f_k(x),x) \mid x\in D_k \}, \end{aligned}$$

    where \(D_k\) is a compact interval and \(f_k: D_k \rightarrow \mathbb {R}\) is a continuous function which is convex or concave, and where \(F_{k_1} \cap F_{k_2}\) for \(k_1\ne k_2\) contains only points that are both endpoints of \(F_{k_1}\) and of \(F_{k_2}\). At the intersection point of two sets \(F_{k_1}\) and \(F_{k_2}\), they form an angle of strictly positive width (while an angle of \(\pi \) is allowed). Furthermore, we assume that K is topological regular, i.e., each point of some set \(F_k, k=1,\dots , m\), is the limit of interior points of K.

An even more strict assumption is needed in \(\mathbb {R}^d, d>2\). We require:

  1. (R2)

    The set K is of the form

    $$ K = {{\,\mathrm{cl}\,}}\big ( \bigcup _{k=1}^{m'} L_k \setminus \bigcup _{k=m'+1}^m L_k \big ), $$

    where \({{\,\mathrm{cl}\,}}S\) denotes the closure of a set \(S\subseteq \mathbb {R}^d\) and where the sets \(L_k\) are either convex polytopes with interior points or compact convex sets with interior points for which \({{\,\mathrm{bd}\,}}L_k\) is a \(C^2\)-manifold with nowhere vanishing Gauss–Kronecker curvature. In intersection points \(z\in {{\,\mathrm{bd}\,}}L_{k_1} \cap {{\,\mathrm{bd}\,}}L_{k_2}\), the bodies \(L_{k_1}\) and \(L_{k_2}\) do not have exterior normal vectors which are (up to sign) equal. Geometrically, this means that \({{\,\mathrm{bd}\,}}L_{k_1}\) and \({{\,\mathrm{bd}\,}}L_{k_2}\) intersect nowhere under an angle of zero.

Under the above assumptions, we can show our main result.

Theorem 1

Let \(K\subseteq \mathbb {R}^{d}\) be a set fulfilling Assumption (R1) if \(d=2\) or Assumption (R2) if \(d>2\) and let \(\hat{S}_t\) be an estimator of the form (1) fulfilling (2). Then there is a constant s such that for any \(t>0\) it holds

$$\begin{aligned} \sup \big \{&\hat{S}_t(K+tv) \mid v\in [0,1)^d \big \} \nonumber \\&- \inf \big \{ \hat{S}_{t}(K+tv) \mid v\in [0,1)^d \big \} \le s \cdot t. \end{aligned}$$
(3)

Thus,

$$ {{\,\mathrm{\mathsf {Var}}\,}}\big (\hat{S}_t(K+tU) \big )\le s^2t^2/4, $$

where U is a random vector.

In the first step of the Proof of Theorem 1, we show Assumption (R1) or Assumption (R2) implies that the boundary of K can be decomposed into certain sets \(M_\kappa \) to be defined below such that the intersections \(M_\kappa \cap M_{\kappa '}\) are small for \(\kappa \ne \kappa '\) in a certain sense. In the second step we derive upper and lower bounds for certain sums of pixel configuration counts. Since it will be possible to reconstruct the individual pixels configuration counts from these sums, the bounds derived in the second step imply the assertion of Theorem 1. The details are given in Sect. 2.

In Sect. 3 we show by an example that the assertions of Theorem 1 do not need to hold for a set \(K\subseteq \mathbb {R}^d\) that is the union of two convex sets whose boundary components intersect under an angle of zero. Moreover, we show that an essential lemma (Lemma 2) of our proof fails to hold for general compact and convex sets \(K\subseteq \mathbb {R}^d\). Thus, the method of our proof breaks down completely without the assumption that the sets \(L_1, \dots , L_m\) from (R2) are either polytopes or sufficiently smooth. It is unclear, whether the assertion of Theorem 1 still holds in this more general situation. A simulation study (Sect. 4) shows that the order derived in Theorem 1 is optimal for the cube and thus is optimal in general, whereas a better bound can be achieved for the ball. In the simulation part we will also examine the integral of mean curvature. In Sect. 5 we discuss our results, we compare them to the results Svane [27] obtained for grayscale images and we mention some open questions.

2 The Proof

In this section we prove Theorem 1. We start by introducing some notation and in particular defining the sets \(M_\kappa \) mentioned in the introduction. Then we show that in dimension \(d=2\) Assumption (R1) implies the existence of an appropriate boundary decomposition of K, followed by a proof that in dimension \(d>2\) such a decomposition is implied by (R2). After this, we prove that this boundary decomposition implies certain upper and lower bounds on the pixel configuration counts. Finally, we show how these bounds imply Theorem 1.

2.1 Notation

We assume n and d to be fixed and hence we will suppress dependence on n and d in the notation. We fix an enumeration \(x_1, \dots , x_{n^d}\) of the points in \(\{0,\dots , n-1\}^d\) and consider for every permutation \(p\in S(n^d)\) the set

$$\begin{aligned} \tilde{G}_p:= \{ u\in S^{d-1} \mid&\langle x_{p(1)}, u \rangle< \langle x_{p(2)}, u \rangle< \dots \\&< \langle x_{p(n^d)}, u \rangle \}, \end{aligned}$$

where \(S^{d-1}:=\{ u\in \mathbb {R}^d \mid \Vert u\Vert = 1 \}\), and we put \(G_p:={{\,\mathrm{cl}\,}}\tilde{G}_p\). Notice that

$$\begin{aligned} G_p:= \{ u\in S^{d-1} \mid&\langle x_{p(1)}, u \rangle \le \langle x_{p(2)}, u \rangle \le \dots \\&\le \langle x_{p(n^d)}, u \rangle \}, \end{aligned}$$

unless \(\tilde{G}_p\) is empty. If \(d=2\) and \(n=2\) the non-empty sets \(G_p\) are the eight arcs which essentially (up to permuting the indices or changing the sign of the entries) look like

$$ G_1 = \{ (u_1, u_2)\in S^1 \mid 0 \le u_1, \ 0 \le u_2,\ u_1\le u_2\}. $$

If \(n>2\) then there are more (and thus smaller) arcs.

If \(d=3\) and \(n=2\) there are 48 sets which are isometric to

$$\begin{aligned} G_1 = \{ (u_1, u_2, u_3) \in S^2 \mid&0\le u_1, \ 0\le u_2,\ 0\le u_3,\\&u_1\le u_2, \ u_1+ u_2 \le u_3\}, \end{aligned}$$

and 48 sets that are isometric to

$$\begin{aligned} G_2 = \{ (u_1, u_2, u_3) \in S^2 \mid&0\le u_1, \ 0\le u_2,\ 0\le u_3, \\&u_1 \le u_2\le u_3, \ u_3 \le u_1+ u_2\}. \end{aligned}$$

For each \(p\in S(n^d)\) let \(H_p\) denote the closure of the set of all boundary points of K that have at least one exterior normal vector in \(G_p\). Taking the closure is necessary in order to ensure \({{\,\mathrm{bd}\,}}K = \cup _{p\in S(n^d)} H_p\) because there are boundary points of K in which there is no exterior normal vector. An illustrative example is given in Fig. 3.

Fig. 3
figure 3

The sets \(G_p\) and \(H_p\). For \(d=2\) and \(n=2\) the unit circle \(S^1\) is decomposed into eight arcs \(G_p\) (left). The boundary of each set \(K\subseteq \mathbb {R}^2\) fulfilling (R1) is decomposed into eight corresponding sets \(H_p\) (right)

Consider a further decomposition

$$ {{\,\mathrm{bd}\,}}K = \bigcup _{\kappa =1}^{\mu } M_\kappa ^+, $$

where each set \(M_\kappa ^+\) is an intersection \(F_k\cap H_p\) if K fulfills (R1) and an intersection \(({{\,\mathrm{bd}\,}}K) \cap ({{\,\mathrm{bd}\,}}L_k) \cap H_p\) if K fulfills (R2). In order to ensure that these sets intersect not “too much”, put \(M_{\kappa } := {{\,\mathrm{cl}\,}}\big (M_{\kappa }^+ \setminus \bigcup _{\lambda =1}^{\kappa -1} M_{\lambda }^+\big )\), \(\kappa =1,\dots , \mu \). Let \(p(\kappa ), \kappa =1,\dots , \mu ,\) be the element of \(S(n^d)\) with \(M_\kappa \subseteq H_p\)—choose an arbitrary one if it is not unique.

While Theorem 1 holds for a fixed set \(K\subseteq \mathbb {R}^d\) and a lattice \(t\mathbb {Z}^d\) with \(t\rightarrow 0\), taking the view that the lattice is fixed, while K is scaled homothetically with a factor \(r\rightarrow \infty \) will be more intuitive in our lemmata. Hence, we will only consider the lattice \(\mathbb {Z}^d\) here and in the next two subsections.

A cell is a set of the form \(C=[l_1, l_1+n-1] \times \dots \times [l_d, l_d+n-1]\) for some point \((l_1, \dots , l_d)\in \mathbb {Z}^d\). For \(\kappa \in \{1,\dots , \mu \}\) let \(\mathcal {C}^{\kappa ,j}\) denote the system of cells C, such that \(({{\,\mathrm{bd}\,}}K) \cap C \subseteq M_\kappa \) and \(K \cap C \cap \mathbb {Z}^d = B_j+l\). Let \(\mathcal {C}'_\kappa \) denote the system of all cells C intersecting both \(M_\kappa \) and another boundary component \(M_\lambda \), \(\lambda \ne \kappa \), i.e.,

$$\begin{aligned} \mathcal {C}'_\kappa = \{&C= [l_1, l_1+n-1] \times \dots \times [l_d, l_d+n-1] \mid \\&(l_1, \dots , l_d)\in \mathbb {Z}^d, \quad C\cap M_\kappa \ne \emptyset ,\\&C\cap M_\lambda \ne \emptyset \text{ for } \text{ some } \lambda \in \{1,\dots , \mu \}\setminus \{\kappa \} \} . \end{aligned}$$

Put \(N^{\kappa ,j}(K):= \# \mathcal {C}^{\kappa ,j}\), \(N_\kappa '(K):= \# \mathcal {C}'_\kappa \), \(N'(K):=\sum _{\kappa =1}^\mu N_\kappa '(K)\) (notice that \(N'(K)\) is the number of cells which are intersected by more than one boundary component counted with multiplicity—a cell intersected by two components is counted twice, a cell intersected by three components is counted three times etc.); see Fig. 4.

Fig. 4
figure 4

The numbers \(N^{\kappa ,j}\) and \(N_\kappa '\). We added to Fig. 2 one boundary component \(M_\kappa \) in blue. Moreover, cells belonging to \(\mathcal {C}^{\kappa ,j}\) for the pixel configuration \((B_j,W_j)\) from Fig. 1 (in particular \(n=2\)) are plotted in red, while cells belonging to \(\mathcal {C}'_\kappa \) for \(n=2\) are plotted in green. Since there are 1 resp. 2 such cells, we have \(N^{\kappa ,j}=1\) and \(N_\kappa '=2\)

2.2 The Boundary Decomposition

We will now show that the Assumptions (R1) resp. (R2) imply that the number of cells intersecting more than one boundary component \(M_\kappa \) is small in a certain way.

Lemma 1

Let \(K\subseteq \mathbb {R}^{2}\) be a compact set satisfying (R1).

Then \(N'(rK+v) \le S\) for \(v\in \mathbb {R}^2\) and sufficiently large r for a bound S which may depend on K, but not on r or v.

Proof

Fix \(\kappa \in \{1, \dots , \mu \}\). Since the functions \(f_k, k=1,\dots , m,\) of (R1) are assumed to be either convex or concave, the set \(M_\kappa \) is connected. Cells of \(\mathcal {C}_\kappa '(rK+v)\) intersect also another boundary part \(rM_{\kappa '}+v\), \(\kappa '\ne \kappa \). By the compactness of the sets \(M_\kappa \), there is \(r_0\) such that for \(r>r_0\) in such a situation always \(rM_{\kappa }+v\) and \(rM_{\kappa '}+v\) intersect. They intersect usually in one point, in some exceptional cases in two points. We will assume that there is only one intersection point in the following, since in the case of two intersection points the notation is blown up, while the ideas of the proof remain the same.

If the angle \(\alpha _{\kappa ,\kappa '}\) between \(M_{\kappa }\) and \(M_{\kappa '}\) at their intersection point z is bigger than \(\pi /2\), then \(p(\kappa )\ne p(\kappa ')\) and the angle between two vectors from \(G_{p(\kappa )}\) and from \(G_{p(\kappa ')}\) is at least \(\pi /4\). Hence, any cell intersecting both \(rM_{\kappa }+v\) and \(rM_{\kappa '}+v\) must contain a point which has distance at most \(2(n-1)\) from rz. Indeed, let \(x\in rM_\kappa +v\) and \(y\in rM_{\kappa '}+v\) be in the same cell and let \(y'\) be the orthogonal projection of x onto the line through y and rz. Then

$$ \sqrt{2}(n-1) \ge \Vert x-y\Vert \ge \Vert x-y'\Vert \ge \Vert x-rz\Vert \cdot \tfrac{1}{2}\sqrt{2}.$$

Therefore, there can be at most \(25n^2\) cells intersecting both \(rM_\kappa +v\) and \(rM_{\kappa '}+v\). Indeed, every cell \([l_1, l_1+n-1] \times [l_2, l_2+n-1]\), \((l_1, l_2)\in \mathbb {Z}^2\), which intersects both \(rM_\kappa +v\) and \(rM_{\kappa '}+v\) must contain a point x with \(\Vert x-rz\Vert \le 2(n-1)\). Hence, \(l_1\in [rz_1-3(n-1), rz_1+2(n-1)]\) and \(l_2\in [rz_2-3(n-1), rz_2+2(n-1)]\), where \((z_1,z_2)=z\). Obviously, there are no more than \((5(n-1)+1)^2 \le 25 n^2\) such cells (it would not be difficult to obtain a far lower bound; however, it only matters that this bound is independent of r, so we will not take the effort of improving it).

So assume \(\alpha _{\kappa ,\kappa '}\le \pi /2\) from now on. Let \(u^{(1)}\) and \(u^{(2)}\) be the unit vectors such that \(\pm u^{(1)}\) are normal vectors of \(M_{\kappa }\) in z and \(\pm u^{(2)}\) are normal vectors of \(M_{\kappa '}\) in z, oriented in such a way that both \(u^{(1)}\) and \(u^{(2)}\) point from \(M_{\kappa '}\) to \(M_{\kappa }\) in a neighborhood of z (by the assumptions made so far, the angle which \(M_{\kappa }\) and \(M_{\kappa '}\) form at z is strictly positive but not larger than \(\pi /2\), so this choice is properly defined; it is convenient to orient the vectors like this and ignore whether they are now outward or inward normal vectors). Let \(\tilde{u}^{(1)}= \tfrac{2}{3} u^{(1)}+ \tfrac{1}{3} u^{(2)}\) and \(\tilde{u}^{(2)}= \tfrac{1}{3} u^{(1)}+ \tfrac{2}{3} u^{(2)}\) and put \(H_1:=\{y \in \mathbb {R}^{2} \mid \langle y, \tilde{u}^{(1)} \rangle \ge \langle z, \tilde{u}^{(1)} \rangle \}\) and \(H_2:=\{y \in \mathbb {R}^{2} \mid \langle y, \tilde{u}^{(2)} \rangle \le \langle z, \tilde{u}^{(2)} \rangle \}\). There is some \(\delta >0\) with \(M_{\kappa } \cap B_\delta (z) \subseteq H_1\) and \(M_{\kappa '} \cap B_\delta (z)\subseteq H_2\), where \(B_\delta (z):=\{y\in \mathbb {R}^d \mid \Vert y-z\Vert < \delta \}\). For sufficiently large r the sets \(r(M_{\kappa } \setminus B_\delta (z))\) and \(r(M_{\kappa '} \setminus B_\delta (z))\) have distance more than \((n-1)\sqrt{2}\) and hence there can be no cell which intersects both sets. Let \(\tilde{\alpha }_{\kappa ,\kappa '}\) denote the angle between \(H_1\) and \(H_2\) and let H denote a half-plane with \(z\in {{\,\mathrm{bd}\,}}H\) and \(M_{\kappa }\cup M_{\kappa '}\subseteq H\). Then a point of \(H_1\cap H\) which lies in the same cell as a point from \(H_2\cap H\) can have at most distance \((n-1)\sqrt{2}/\sin (\tilde{\alpha }_{\kappa ,\kappa '})\) from rz. So there can be at most \(((n-1)2\sqrt{2}/\sin (\tilde{\alpha }_{\kappa ,\kappa '})+n)^2\) cells which intersect both \(M_{\kappa }\) and \(M_{\kappa '}\).

figure b

Altogether we have

$$ \begin{aligned} N'_\kappa (rK+&v) \le \sum _{\kappa ': \alpha _{\kappa ,\kappa '}>\pi /2} 25n^2 \\&+ \sum _{\kappa ': \alpha _{\kappa ,\kappa '} \le \pi /2} ((n-1)2\sqrt{2}/\sin (\tilde{\alpha }_{\kappa ,\kappa '})+n)^2, \end{aligned} $$

where the sums are taken over all \(\kappa ' \in \{1,\dots ,\mu \}\) with \(M_\kappa \cap M_{\kappa '} \ne \emptyset \) (if \(M_\kappa \cap M_{\kappa '}\) consists of two points, then \(\kappa '\) contributes two summands to the sum). Summing up we get

$$ \begin{aligned} N'(rK+&v) \le \sum _{\kappa ,\kappa ': \alpha _{\kappa ,\kappa '}>\pi /2} 25n^2 \\&+ \sum _{\kappa , \kappa ': \alpha _{\kappa ,\kappa '} \le \pi /2} ((n-1)2\sqrt{2}/\sin (\tilde{\alpha }_{\kappa ,\kappa '})+n)^2, \end{aligned} $$

where the sums are taken over all ordered pairs \((\kappa , \kappa ') \in \{1,\dots , \mu \}^2\) with \(M_\kappa \cap M_{\kappa '} \ne \emptyset \). \(\square \)

Lemma 2

Let \(K\subseteq \mathbb {R}^{d}\) be a compact set fulfilling (R2).

Then \(N'(rK+v) \le Sr^{d-2}\) for \(v\in \mathbb {R}^d\) and large enough r for a bound S which may depend on K, but not on r or v.

In the proof of this lemma, we need the following lemma. Let \(\tilde{\kappa }_{\tilde{n}}\) denote the Lebesgue measure of the \(\tilde{n}\)-dimensional unit ball.

Lemma 3

Let \(R\subseteq \mathbb {R}^d\) be a rectangle of side-lengths \(a_1,a_2,\dots , a_{d-1}\) within a hyperplane H. Assume \(a_1\ge a_2 \ge \dots \ge a_{d-1}\). Then R intersects at most

$$ \sum _{\mathfrak {j}=0}^{d-1} \tilde{\kappa }_{d-\mathfrak {j}} \left( {\begin{array}{c}d-1\\ \mathfrak {j}\end{array}}\right) (n-1)^{d-\mathfrak {j}} d^{(d-\mathfrak {j})/2} a_1\cdot \dots \cdot a_\mathfrak {j} $$

cells.

Proof

Consider the parallel set

$$ R_{\oplus \rho }:= \{ x\in \mathbb {R}^d \mid \Vert x-y\Vert \le \rho \text{ for } \text{ one } y\in R\} , \quad \rho \ge 0,$$

of R. By the Steiner formula its Lebesgue measure is given by

$$ \lambda _d( R_{\oplus \rho }) = \sum _{\mathfrak {j}=0}^d \tilde{\kappa }_{d-\mathfrak {j}} \rho ^{d-\mathfrak {j}} V_\mathfrak {j}(R), $$

where \(V_\mathfrak {j}(R)\) is the \(\mathfrak {j}\)-th intrinsic volume of R; see, e.g., [22, (4.1)]. The intrinsic volumes of the rectangle R are given by

$$\begin{aligned} V_\mathfrak {j}(R)&= \sum _{1\le i_1\le \dots \le i_\mathfrak {j}\le d-1} a_{i_1} \cdot \dots \cdot a_{i_\mathfrak {j}}\\&\le \left( {\begin{array}{c}d-1\\ \mathfrak {j}\end{array}}\right) a_1\cdot a_2 \cdot \dots \cdot a_\mathfrak {j}, \end{aligned}$$

\(\mathfrak {j}=0,\dots , d-1\), and \(V_d(R)=0\). Hence,

$$\begin{aligned} \lambda _d(&R_{\oplus (n-1)\sqrt{d}}) \\&\le \sum _{\mathfrak {j}=0}^{d-1} \tilde{\kappa }_{d-\mathfrak {j}} \left( {\begin{array}{c}d-1\\ \mathfrak {j}\end{array}}\right) (n-1)^{d-\mathfrak {j}} d^{(d-\mathfrak {j})/2} a_1\cdot \dots \cdot a_\mathfrak {j}. \end{aligned}$$

A cell intersected by R is covered by \(R_{\oplus (n-1)\sqrt{d}}\). In particular, for a cell \([l_1,l_1+n-1] \times \dots \times [l_d, l_d+n-1]\) intersected by R, the subset \([l_1,l_1+1) \times \dots \times [l_d, l_d+1)\) is completely covered by \(R_{\oplus (n-1)\sqrt{d}}\), and these subsets are disjoint for different cells. Hence, the assertion follows. \(\square \)

It is well known that for a set \(S\subseteq \mathbb {R}^d\) and a point \(x\in \mathbb {R}^d\setminus S\) there is at least one point \(y\in S\) with

$$ \Vert x-y\Vert = \inf \{ \Vert x-z\Vert \mid z\in S \} $$

if S is closed, while there is at most one such point \(y\in S\) provided that S is convex. If S is a \(C^2\)-manifold, then there is a number \(\rho >0\) such that y exists and is determined uniquely given that \(\inf \{ \Vert x-z\Vert \mid z\in S \} < \rho \). If y exists and is determined uniquely, then it is called the metric projection of x onto S and denoted by p(Sx).

Proof of Lemma 2

Fix \(\kappa \in \{1,\dots , \mu \}\). Each cell of \(\mathcal {C}_\kappa '(rK+v)\) intersects another boundary part \(rM_{\kappa '}+v\), \(\kappa \ne \kappa '\). By the compactness of the sets \(M_\kappa \) there is \(r_0\) such that for \(r>r_0\) in such a situation \(rM_{\kappa }+v\) and \(rM_{\kappa '}+v\) always intersect. We will now determine for each index \(\kappa '\in \{1,\dots ,\mu \} \setminus \{\kappa \}\) such that \(rM_{\kappa }+v\) and \(rM_{\kappa '}+v\) intersect an upper bound for the number of cells intersecting both \(rM_{\kappa }+v\) and \(rM_{\kappa '}+v\). Summing up over all pairs \((\kappa , \kappa ')\) will yield the assertion of the lemma.

The sets \(M_\kappa \) and \(M_{\kappa '}\) can either belong to polytopes or to smooth convex bodies. This leads to several cases. Both sets can belong to polytopes, exactly one of these sets can belong to a polytope or none of these sets can belong to a polytope. In the case none of these sets belong to a polytope, it will be necessary to consider two subcases: \(M_\kappa \) and \(M_\kappa '\) may belong to the same smooth convex body \(L_k\) or they may belong to different smooth convex bodies \(L_{k_1}\) and \(L_{k_2}\), \(k_1\ne k_2\). If \(M_\kappa \) belongs to a polytope \(L_{k_1}\) and \(M_{\kappa '}\) belongs to a polytope \(L_{k_2}\), we will be able to give one proof holding for both \(k_1=k_2\) and \(k_1\ne k_2\) and hence we do not need to distinguish the subcases. If \(M_\kappa \) belong to a polytope \(L_{k_1}\), while \(M_{\kappa '}\) belongs to a smooth convex body \(L_{k_2}\), then \(k_1\ne k_2\). In conclusion, there are four cases to consider:

  • \(M_{\kappa }\) and \(M_{\kappa '}\) are parts of polytopes.

  • \(M_{\kappa }\) and \(M_{\kappa '}\) belong to the same smooth body L.

  • \(M_{\kappa }\) belongs to a polytope P, while \(M_{\kappa '}\) belongs to a smooth convex body L (or the other way round).

  • \(M_{\kappa }\) and \(M_{\kappa '}\) belong to different smooth bodies \(L_{k_1}\) and \(L_{k_2}\).

1. case: \(M_{\kappa }\) and \(M_{\kappa '}\) are parts of polytopes:

We may assume w.l.o.g. that \(M_\kappa \) and \(M_{\kappa '}\) are contained in hyperplanes. Since the angle under which \(M_{\kappa }\) and \(M_{\kappa '}\) meet is nonzero, their intersection is at most \((d-2)\)-dimensional.

Let \(\tilde{M}\) be the set of points in \(rM_{\kappa }+v\) that lie in a cell which is also intersected by \(rM_{\kappa '}+v\). A point in \(\tilde{M}\) can at most have distance \((n-1)\sqrt{d}\) from \(rM_{\kappa '}+v\), and therefore, it can at most have distance \((n-1)\sqrt{d}/\sin (\alpha )\) from the affine hull E of \(M_\kappa \cap M_{\kappa '}\), where \(\alpha \) is the angle under which \(M_{\kappa }\) and \(M_{\kappa '}\) intersect. However, the metric projection \(p(rE+v,x)\) of a point \(x\in rM_\kappa +v\) does not need to lie in \((rE+v) \cap ( (rM_\kappa +v) \cup (rM_\kappa '+v))\) and so we have to find an upper bound for the diameter of \(\{ p(rE+v,x) \mid x\in \tilde{M}\}\). For \(\lambda \in \{\kappa , \kappa '\}\) consider the boundary \(I_\lambda ^{ + \rho }\) of the parallel set of \(I_\lambda :=E\cap M_\lambda \) at distance \(\rho \) within E. Let \(\rho \) be small enough that \(p(E,\mathfrak {v})\) either lies in \(I_\lambda \) or has distance at least \(\rho \) from \(I_\lambda \) for any vertex \(\mathfrak {v}\) of \(M_\lambda \). Then

$$ \beta _\lambda := \min \big \{ d(M_\lambda \cap (x+E^\perp ), x) \mid x\in I_\lambda ^{ + \rho } \big \}/\rho > 0 , $$

where \(d(M,x):=\inf \{ \Vert x-y\Vert \mid y\in M\}\), does not depend on \(\rho \). Put \(\beta :=\min \{\beta _\kappa , \beta _{\kappa '}\}\). Notice that \(\beta =\infty \) if and only if for both \(\lambda =\kappa \) and \(\lambda =\kappa '\) and for all \(\rho >0\) we have \(M_\lambda \cap (x+E^\perp ) = \emptyset \) for all \(x\in I^{+\rho }_\lambda \). If \(\beta <\infty \), then the diameter of \(\{ p(rE+v,x) \mid x\in \tilde{M}\}\) is at most \(rl+2(n-1)\sqrt{d}/\beta /\sin (\alpha )\), where l is the diameter of \(I_{\kappa } \cup I_{\kappa '}\). Indeed, for a point \(x\in \tilde{M}\) there must be a point \(y\in rM_{\kappa }+v\) with \(\Vert x-y\Vert \le (n-1)\sqrt{d}\) such that x and y are seen under an angle of at least \(\alpha \) from \(p(rE+v,x)\) and thus x can have distance at most \((n-1)\sqrt{d}/\sin (\alpha )\) from \(rE+v\). So \(p(rE+v,x)\) can have distance at most \((n-1)\sqrt{d}/\sin (\alpha )/ \beta \) from \((rI_{\kappa }+v) \cup (rI_{\kappa '}+v)\). If \(\beta =\infty \), then \(p(rE+v,x)\) lies in \((rI_\kappa +v) \cup (rI_{\kappa '}+v)\) and hence the diameter of \(\{ p(rE+v,x) \mid x\in \tilde{M}\}\) is bounded from above by rl.

Altogether, \(\tilde{M}\) is contained in a \((d-1)\)-dimensional rectangle with \(d-2\) side lengths at most \(rl+2(n-1)\sqrt{d}/ \beta /\sin (\alpha )\) or rl, respectively, and the remaining side length being at most \((n-1)\sqrt{d}/\sin (\alpha )\). Thus, by Lemma 3, the number of cells that are intersected both by \(rM_{\kappa }+v\) and by \(rM_{\kappa '}+v\) is bounded by a polynomial of degree \(d-2\).

2. case: \(M_{\kappa }\) and \(M_{\kappa '}\) belong to the same smooth body L:

The support function of a non-empty compact set \(\tilde{L}\subseteq \mathbb {R}^d\) is defined as

$$ h_{\tilde{L}}(u) := \max \{ \langle x, u\rangle \mid x \in \tilde{L}\}, \quad u \in \mathbb {R}^d; $$

see [22, Sec. 1.7.1]. From [22, p. 115] we get that \(h_L\) is twice differentiable on \(\mathbb {R}^d\setminus \{0\}\), since L is convex and \({{\,\mathrm{bd}\,}}L\) is a \(C^2\)-manifold with non-vanishing Gauss–Kronecker curvature. Let \(H_uh_L\) be its Hessian matrix in \(u\in \mathbb {R}^d\setminus \{0\}\) and put \(Li:= \max \{ \Vert H_uh_L\Vert _2 \mid u\in S^{d-1} \}\), where \(\Vert \cdot \Vert _2\) denotes the matrix norm induced by the Euclidean norm.

The sets \(M_{\kappa }\) and \(M_{\kappa '}\) belong to two different sets \(H_{p}\) and \(H_{p'}\) for \(p,p'\in S(n^d)\). In any point \(z\in (rM_\kappa +v) \cap (rM_{\kappa '}+v)\) there must be a normal vector of \(rL+v\) that lies in \(\tilde{G}:=G_{p} \cap G_{p'}\subseteq S^{d-1}\). By [22, Corollary 1.7.3] \(rL+v\) can have an exterior normal vector in \(\tilde{G}\) only in points that lie in the image \(\tilde{H}\) of \(\tilde{G}\) under \(\nabla h_{rL+v}\). The set \(\tilde{G}\) is a subset of a \((d-2)\)-dimensional sphere. Hence, it can be covered by \(2(d-1)\) sets isometric to \(\{(\tilde{u}_1, \dots , \tilde{u}_{d-1}) \in S^{d-2}\mid \tilde{u}_{d-1}\ge 1/\sqrt{d-1}\}\). This set is the image of \(\tilde{D}:=\{ \tilde{v}\in \mathbb {R}^{d-2} \mid \Vert \tilde{v}\Vert \le \sqrt{(d-2)/(d-1)}\}\) under the mapping

$$ \tilde{f}:(\tilde{v}_1,\dots , \tilde{v}_{d-2}) \mapsto (\tilde{v}_1,\dots , \tilde{v}_{d-2}, \sqrt{1-\dots -\tilde{v}_{d-2}^2}) $$

which is Lipschitz continuous with Lipschitz constant \(\sqrt{d}\). There are \(\tilde{N}:=(\lceil d\cdot r\cdot Li\rceil )^{d-2}\) points \(\tilde{v}^{(1)}, \dots , \tilde{v}^{(\tilde{N})}\) with \(\tilde{D}\subseteq \bigcup _{\mathfrak {k}=1}^{\tilde{N}}B_{1/(\sqrt{d}\cdot r\cdot Li)}(\tilde{v}^{(\mathfrak {k})})\) and thus \(\tilde{f}(\tilde{D}) \subseteq _{\mathfrak {k}=1}^{\tilde{N}} B_{1/(r\cdot Li)}(\tilde{f}(\tilde{v}_\mathfrak {k}))\), where \(\lceil a \rceil := \min \{b\in \mathbb {Z} \mid b\ge a \}\). Hence, there are \(N:=2(d-1)\cdot \tilde{N}=2(d-1) \cdot (\lceil d\cdot r\cdot Li\rceil )^{d-2}\) points \(w^{(1)}, \dots , w^{(N)} \in \tilde{G}\) such that \(\tilde{G}\subseteq \bigcup _{\mathfrak {k}=1}^N B_{1/(r\cdot Li)}(w^{(\mathfrak {k})})\). Now for every point \(z\in \tilde{H}\) one of the points \(x^{(\mathfrak {k})}:=\nabla h_{rL+v}(w^{(\mathfrak {k})})\), \(\mathfrak {k}=1, \dots , N\) has distance at most 1, since \(\nabla h_{rL+v}\) has Lipschitz constant \(r\cdot Li\).

Since the principal curvatures depend continuously on the point, a compactness argument ensures that the principal radii of curvature of rL are bounded from below by \((n-1)\sqrt{d}\) for sufficiently large r. Then a point in a cell intersecting both \(rM_{\kappa }+v\) and \(rM_{\kappa '}+v\) can have distance at most \((n-1)\sqrt{d}\) from the nearest point in \(\tilde{H}\), and therefore, it has distance less than \((n-1)\sqrt{d}+1\) from the nearest point \(x^{(\mathfrak {k})}, \mathfrak {k}\in \{1,\dots , N\}\). Thus, there can be at most \((n+2+2(n-1)\sqrt{d})^d \cdot N = 2(d-1)(n+2+2(n-1)\sqrt{d})^d \cdot (\lceil d\cdot r\cdot Li\rceil )^{d-2}\) cells intersecting both \(rM_{\kappa }+v\) and \(rM_{\kappa '}+v\).

3. case: \(M_{\kappa }\) belongs to a polytope P, while \(M_{\kappa '}\) belongs to a smooth convex body L (or the other way round):

Let \(E_1, \dots , E_s\) denote the affine hulls of the facets of P which are intersected by \(M_{\kappa } \cap M_{\kappa '}\). Then \(\Gamma ^{(i)}:=E_i \cap {{{\,\mathrm{bd}\,}}L}\) is the boundary of a convex body lying in \(E_i\) for each \(i=1,\dots , s\). Put \(\tilde{\Gamma }^{(i)} := \Gamma ^{(i)} \cap M_{\kappa } \cap M_{\kappa '}\).

By the smoothness assumption on L, the angle \(E_i\) and \(M_{\kappa '}\) form at the points \(z \in \Gamma ^{(i)}\) is continuous as a function of z. By the compactness of \(\tilde{\Gamma }^{(i)}\) it attains a minimum \(\alpha _i>0\)—we shall omit the index i if there is no ambiguity. Unlike in the first case one cannot assume that two points \(x\in M_\kappa \) and \(x'\in M_{\kappa '}\) are always seen from an appropriate point \(z\in \Gamma ^{(i)}\) under an angle of at least \(\alpha \), since \({{\,\mathrm{bd}\,}}L\) is curved. We shall explain now, why this can be assumed with \(\alpha \) replaced by \(\alpha /2\).

Since \(\Gamma ^{(i)}\) is a \(C^2\)-manifold, there is some critical radius \(\rho _*\) such that the metric projection \(p(\Gamma ^{(i)},x)\) is defined uniquely for any point x of distance less than \(\rho _*\) to \(\Gamma ^{(i)}\). Let e(z) for \(z\in \Gamma ^{(i)}\) be the infimum over all \(\rho >0\) for which there is \(\tau \in (0,\rho \cdot \sin {(\alpha /2)}]\) such that one of the four points \(z \pm \rho \nu (z) \pm \tau \nu _{E_i}\) lies in \({{\,\mathrm{bd}\,}}L\), where \(\nu (z)\) is a unit normal vector of \(\Gamma ^{(i)}\) in \(z\in \Gamma ^{(i)}\) within the linear subspace which is parallel to \(E_i\) and where \(\nu _{E_i}\) is the unit normal vector of \(E_i\). Observe that if \(\rho >0\) is sufficiently small and \(\tau >0\) is such that \(z+\rho \nu (z)+\tau \nu _{E_i}\in {{\,\mathrm{bd}\,}}L\), then the angle under which \(z+\rho \nu (z)\) and \(z+\rho \nu (z)+\tau \nu _{E_i}\) are seen from z is larger than \(\alpha /2\) and hence \(\tau >\rho \cdot \sin (\alpha /2)\). The same holds if some plus signs are replaced by minus signs. Thus, \(e(z)>0\). Furthermore, e is lower semicontinuous. Indeed, let \((z_n)_{n\in \mathbb {N}}\) be a sequence in \(\Gamma ^{(i)}\) converging to \(z\in \Gamma ^{(i)}\) and let \(\epsilon >0\). Then there are sequences \((\rho _n)_{n\in \mathbb {N}}\) and \((\tau _n)_{n\in \mathbb {N}}\) with \(z_n+\rho _n \nu (z_n)+ \tau _n \nu _{E_i} \in {{\,\mathrm{bd}\,}}L\), \(\tau _n\le \rho _n \cdot \sin (\alpha /2)\) and \(\rho _n<e(z_n)+\epsilon \) for all \(n\in \mathbb {N}\). Subsequences, w.l.o.g. the sequences themselves, converge to limits \(\rho \) and \(\tau \) satisfying \(z+\rho \nu (z)+ \tau \nu _{E_i} \in {{\,\mathrm{bd}\,}}L\), \(\tau \le \rho \cdot \sin (\alpha /2)\) and \(\rho \le \liminf _{n\rightarrow \infty } e(z_n)+\epsilon \). Hence, \(e(z) \le \liminf _{n\rightarrow \infty } e(z_n)+\epsilon \). Since \(\epsilon >0\) was arbitrary, the proof of the lower semicontinuity is complete. Therefore, e attains a minimum \(e_*>0\) on \(\tilde{\Gamma }^{(i)}\). Let \(\epsilon >0\) be such that \(e(z)>e_*/2\) for any \(z\in \Gamma ^{(i)} \cap \tilde{\Gamma }^{(i)}_{\oplus \epsilon }\). So let r be large enough such that the distance of \((rE_i \cap rM_\kappa )\setminus r\tilde{\Gamma }^{(i)}_{\oplus \min \{\rho _*, e_*, \epsilon \}/2}\) to \(rM_{\kappa '}\) is larger than \((n-1)\sqrt{d}\). Then a cell intersecting both \((rE_i+v)\cap (rM_{\kappa }+v)\) and \(rM_{\kappa '}+v\) must contain a point of distance at most \((n-1)\sqrt{d}/\sin (\alpha /2)\) from \(r\Gamma ^{(i)}+v\).

Now \(\Gamma ^{(i)}=\bigcup _{\mathfrak {i}\in \{1, \dots , d-1\}} \bigcup _{\epsilon \in \{\pm 1\}} \Gamma ^{(i,\epsilon ,\mathfrak {i})}\), where

$$\begin{aligned} \Gamma ^{(i,\epsilon ,\mathfrak {i})}:= \big \{&z\in \Gamma ^{(i)} \mid \epsilon \cdot \langle \nu (z), \tilde{e}_{\mathfrak {i}} \rangle \\&= \max \{|\langle \nu (z), \tilde{e}_{\mathfrak {j}} \rangle | \mid \mathfrak {j}=1,\dots , d-1\} \big \},\end{aligned}$$

\(\epsilon \in \{\pm 1\}, \, \mathfrak {i}\in \{1,\dots , d-1\}\), where \(\nu (z)\) is the exterior normal vector of \(\Gamma ^{(i)}\) in z within the linear subspace \(\hat{E}_i\) parallel to \(E_i\) and where \(\tilde{e}_1, \dots , \tilde{e}_{d-1}\) is an orthonormal base of \(\hat{E}_i\). The sets \(\Gamma ^{(i,\epsilon ,\mathfrak {i})}\) can be written as graphs \(\{\tilde{v}+\tilde{f}(\tilde{v}) \tilde{e}_{\mathfrak {i}} \mid \tilde{v}\in \tilde{D}\}\), where \(\tilde{f}:\tilde{D} \rightarrow \mathbb {R}\), \(\tilde{D}\subseteq \tilde{e}_{\mathfrak {i}}^\perp \), is some function that is the restriction of a convex or concave function. We shall concentrate on the case of a concave function, i.e., \(\epsilon =+1\), in the following. Now there are \(N^{(i)}:=(\lceil 2(d-2)\cdot r \cdot \Lambda ^{(i)} \rceil )^{d-2}\) points \(v_1^{(i,\epsilon ,\mathfrak {i})}, \dots , v_{N^{(i)}}^{(i,\epsilon ,\mathfrak {i})}\in \tilde{e}_i^\perp \) with \(\tilde{D} \subseteq \bigcup _{\mathfrak {k}=1}^{N^{(i)}} B_{1/(4r\sqrt{d-2})}(v_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})})\), where \(\Lambda ^{(i)}\) is the diameter of \(\Gamma ^{(i)}\). For each of these points let \(\tilde{v}_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})}\) be a point in \(B_{1/(4r\sqrt{d-2})}(v_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})}) \cap \tilde{D}\) with

$$ \tilde{f}(\tilde{v}_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})}) =\min \{ \tilde{f}(v) \mid v\in \tilde{D} \cap B_{1/(4r\sqrt{d-2})}(v_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})}) \}. $$

Put \(x_{\mathfrak {k}}^{(i,\epsilon , \mathfrak {i})} := r\big (\tilde{v}_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})} + \tilde{f}(\tilde{v}_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})}) \tilde{e}_i\big ).\) Then

$$\bigcup _{\mathfrak {k}=1}^{N^{(i)}} \bigcup _{\epsilon \in \{\pm 1 \}} \bigcup _{\mathfrak {i}=1}^{d-1} B_1(x_\mathfrak {k}^{(i,\epsilon ,\mathfrak {i})}) \supseteq r\Gamma ^{(i)}.$$

Indeed, for any \(y\in \Gamma ^{(i)}\) we choose the indices \(\mathfrak {i}\in \{1, \dots , d-1\}\) and \(\epsilon \in \{\pm 1\}\) with \(y\in \Gamma ^{(i,\epsilon ,\mathfrak {i})}\) and we let \(v_y:=y-\langle y, \tilde{e}_{\mathfrak {i}}\rangle \tilde{e}_{\mathfrak {i}}\) denote the orthogonal projection of y onto \(\tilde{e}_{\mathfrak {i}}^\perp \). Then there is some \(v_\mathfrak {k}^{(i,\epsilon ,\mathfrak {i})}\) with \(\Vert v_y- v_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})}\Vert \le 1/(4r\sqrt{d-2})\) and hence \(\Vert v_y- \tilde{v}_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})}\Vert \le 1/(2r\sqrt{d-2})\). Let \(\tilde{u}\in \hat{E}_i\) be such that \(\tilde{u}+\tilde{e}_\mathfrak {i}\) is an exterior normal vector of \(\Gamma ^{(i)}\) in \(\tilde{v}_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})}+ \tilde{f}(\tilde{v}_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})}) \tilde{e}_{\mathfrak {i}}\). Then, due to the choice of \(\mathfrak {i}\), each component of \(\tilde{u}\) most have an absolute value of at most 1. Therefore,

$$\begin{aligned} 0\le \tilde{f}(v_y) - \tilde{f}(\tilde{v}_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})})&\le | \langle v_y-\tilde{v}_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})}, \tilde{u}\rangle | \\&\le \Vert v_y-\tilde{v}_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})}\Vert \cdot \Vert \tilde{u}\Vert \le \frac{1}{2r} \end{aligned}$$

and hence \(\Vert ry-x_{\mathfrak {k}}^{(i,\epsilon ,\mathfrak {i})}\Vert <1\).

Now a cell intersecting both \((rE_i+v)\cap (rM_{\kappa }+v)\) and \(rM_{\kappa '}+v\) must contain a point of distance at most \((n-1)\sqrt{d}/\sin (\alpha /2)+1\) from the nearest point \(x_\mathfrak {k}^{(i)},\, \mathfrak {k}=1,\dots , N^{(i)}.\) Hence, there are less than

$$\begin{aligned}&\sum _{i=1}^s 2(d-1) \cdot N^{(i)}\cdot (\lceil 2(n-1)\sqrt{d}/\sin (\alpha _i/2)+n+2\rceil )^d\\&\quad = \begin{aligned}\sum _{i=1}^s&(2d-2)\cdot (\lceil 2(d-2)\cdot r\cdot \Lambda ^{(i)}\rceil )^{d-2}\\&\cdot (\lceil 2(n-1)\sqrt{d}/\sin (\alpha _i/2)+n+2\rceil )^d\end{aligned} \end{aligned}$$

cells intersecting both \(M_\kappa \) and \(M_{\kappa '}\).

4. case: \(M_{\kappa }\) and \(M_{\kappa '}\) belong to different smooth bodies \(L_{k_1}\) and \(L_{k_2}\):

Fix \(z_0\in {{\,\mathrm{bd}\,}}L_{k_1} \cap {{\,\mathrm{bd}\,}}L_{k_2}\). Then there are a neighborhood \(U\subseteq \mathbb {R}^{d}\) of \(z_0\), a vector \(\nu _1\in S^{d-1}\), a neighborhood W of 0 in \(\nu _1^\perp \) and two \(C^2\)-functions \(g_1, g_2: W\rightarrow \mathbb {R}\) such that

$$ {{\,\mathrm{bd}\,}}L_{k_i} \cap U = \{w + g_i(w) \nu _1 + z_0 \mid w \in W \}, \quad i=1,2. $$

By the implicit function theorem there is a unit vector \(\nu _2 \in \nu _1^\perp \), a neighborhood \(W'\) of 0 in \(W\cap \nu _2^\perp \) and a \(C^2\)-function \(h: W'\rightarrow \mathbb {R}\) with

$$\begin{aligned} \Gamma&:= {{\,\mathrm{bd}\,}}L_{k_1}\cap {{\,\mathrm{bd}\,}}L_{k_2} \cap U \\&=\{ w + h(w)\nu _2 + g_1\big (w+h(w)\nu _2\big )\nu _1 +z_0\mid w\in W'\} \end{aligned}$$

possibly after replacing U by a smaller set.

Replacing \(W'\) by a subset if necessary, we may assume that \(g_1\), \(g_2\) and h are Lipschitz continuous with Lipschitz constant 1. Moreover, choose \(\Lambda \) such that \(W'\) is contained in a cube of side-length \(\Lambda \). Then there are \(N:= (\lceil \Lambda \sqrt{d-2}\cdot r\rceil )^{d-2}\) points \(x_1,\dots , x_N \in \Gamma \) with \(\bigcup _{\mathfrak {k}=1}^N B_{1/r}(x_\mathfrak {k}) \supseteq \Gamma \), namely the images of the points of the lattice covering \(W'\) with grid distance \(\tfrac{1}{\sqrt{d-2}r}\) under the mapping \(w\mapsto w + h(w)\nu _2 + g_1\big (w+h(w)\nu _2\big )\nu _1 +z_0\). By the compactness of \({{\,\mathrm{bd}\,}}L_{k_1}\cap {{\,\mathrm{bd}\,}}L_{k_2}\) there are finitely many of the manifolds \(\Gamma ^{(1)}, \dots , \Gamma ^{(s)}\) constructed above such that \({{\,\mathrm{bd}\,}}L_{k_1}\cap {{\,\mathrm{bd}\,}}L_{k_2} = \bigcup _{i=1}^s \Gamma ^{(i)}\). Let \(N^{(i)}\) and \(\Lambda ^{(i)}\) denote the numbers constructed above associated to the manifold \(\Gamma ^{(i)}\), \(i=1,\dots , s\)—notice that the \(N^{(i)}\) depend on r, while the \(\Lambda ^{(i)}\) are independent of r. So there are \(N^\Sigma :=\sum _{i=1}^s N^{(i)}\) points \(x_1,\dots , x_{N^\Sigma }\in r{{\,\mathrm{bd}\,}}L_{k_1}\cap r{{\,\mathrm{bd}\,}}L_{k_2}\) with \(\bigcup _{\mathfrak {k}=1}^{N^\Sigma } B_1(x_\mathfrak {k}) \supseteq r{{\,\mathrm{bd}\,}}L_{k_1}\cap r{{\,\mathrm{bd}\,}}L_{k_2}\).

Similar as in the third case we get that there is a minimal angle \(\alpha \) under which \({{\,\mathrm{bd}\,}}L_{k_1}\) and \({{\,\mathrm{bd}\,}}L_{k_2}\) intersect. Now fix some \(i\in \{1, \dots , s \}\) and let \(e(z),\, z\in \Gamma ^{(i)}\), be the infimum over all \(\rho >0\) for which there are \(\tau \in \mathbb {R}\) such that one of the four points \(z\pm \rho \nu (z)\pm \tau \nu _1\) lies in \({{\,\mathrm{bd}\,}}L_{k_1}\) and satisfies \(d({{\,\mathrm{bd}\,}}L_{k_2},z\pm \rho \nu (z)\pm \tau \nu _1)\le \sqrt{\rho ^2+\tau ^2}\cdot \sin (\alpha /2)\), where \(\nu (z)\) is the normal vector of \(\{w+h(w)\nu _2 \mid w\in W'\}\) at z within \(\nu _1^\perp \). Similar as in the third case it can be shown that e attains its minimum.

The same way as in the third case one sees that for sufficiently large r there are at most

$$\begin{aligned}&\sum _{i=1}^s N^{(i)}(\lceil 2(n-1)\sqrt{d}/\sin (\alpha /2)+n+2\rceil )^d \\&\quad = \begin{aligned}\sum _{i=1}^s&(\lceil \Lambda ^{(i)}\sqrt{d-2}\cdot r\rceil )^{d-2}\\ {}&(\lceil 2(n-1)\sqrt{d}/\sin (\alpha /2)+n+2\rceil )^d\end{aligned} \end{aligned}$$

cells intersecting both \(rM_{\kappa }+v\) and \(rM_{\kappa '}+v\).

So for any pair \((\kappa , \kappa ')\in \{1, \dots , \mu \}\) with \(\kappa \ne \kappa '\) the number of cells intersecting both \(rM_{\kappa }+v\) and \(rM_{\kappa '}+v\) is bounded uniformly in v by a function of order \(d-2\) in r. Summing up over all such pairs, we get that \(N'(rK+v)\) is bounded uniformly in v by a function of order \(d-2\) in r. \(\square \)

2.3 Bounds on the Pixel Configuration Counts

Our aim in this section is to derive bounds on the numbers \(N^{\kappa ,j}\) defined in Sect. 2.1.

Let \(K\subseteq \mathbb {R}^d\) be a compact set fulfilling (R1) if \(d=2\) or (R2) if \(d>2\). For every \(p\in S(n^d)\) and \(j=1,\dots , 2^{(n^d)}\), let \(\epsilon ^-=(\epsilon _{1,j,p}^-, \dots , \epsilon _{d,j,p}^-)\in B\) and \(\epsilon ^+ =(\epsilon _{1,j,p}^+, \dots , \epsilon _{d,j,p}^+) \in W\) be the points with

$$\begin{aligned} \langle \epsilon ^-, u \rangle&= \max \{\langle x,u\rangle \mid x\in B \} \qquad \text{ and } \\ \langle \epsilon ^+, u \rangle&= \min \{\langle x,u\rangle \mid x\in W \} \end{aligned}$$

for some \(u\in \tilde{G}_p\). Clearly, the points \(\epsilon ^+\) and \(\epsilon ^-\) are determined uniquely and they are independent of u as long as \(u\in \tilde{G}_p\). Now for every \(l\in \mathbb {Z}^d\) with \({{\,\mathrm{bd}\,}}K \cap (l+[0,(n-1)]^d) \subseteq H_p\) we have

$$ l+ B_j \subseteq K,\ l+W_j\subseteq K^C \iff l+\epsilon ^- \in K,\ l+\epsilon ^+ \in K^C, $$

since the exterior normal vectors of K in all points of \({{\,\mathrm{bd}\,}}K \cap (l+[0,(n-1)]^d)\) belong to \(G_p\). We get

$$\begin{aligned}&N^{\kappa ,j} \\&\quad = \begin{aligned} \#\{l\in \mathbb {Z}^d \mid&l+\epsilon ^- \in K, \, l+\epsilon ^+ \in K^C,\\&\emptyset \ne ({{\,\mathrm{bd}\,}}K) \cap (l+[0,n-1]^d) \subseteq M_\kappa \} \end{aligned} \\&\quad = \begin{aligned}\sum _{i=1}^d \sum _{\gamma =\epsilon ^-_{i,j,p(\kappa )}}^{\epsilon ^+_{i,j,p(\kappa )}-1}&\\ \#\{l\in \mathbb {Z}^d \mid&l+ (\epsilon _{1,j,p(\kappa )}^-, \dots , \epsilon _{i-1,j,p(\kappa )}^-,\gamma ,\\ {}&\qquad \epsilon _{i+1, j,p(\kappa )}^+, \dots , \epsilon _{d, j,p(\kappa )}^+) \in K, \\&\quad l+ (\epsilon _{1,j,p(\kappa )}^-, \dots , \epsilon _{i-1,j,p(\kappa )}^-, \gamma +1,\\ {}&\qquad \epsilon _{i+1, j,p(\kappa )}^+, \dots , \epsilon _{d, j,p(\kappa )}^+) \in K^C,\\&\quad \emptyset \ne ({{\,\mathrm{bd}\,}}K) \cap (l+[0,n-1]^d) \subseteq M_\kappa \}\\ -\#\{l\in \mathbb {Z}^d \mid&l+ (\epsilon _{1,j,p(\kappa )}^-, \dots , \epsilon _{i-1,j,p(\kappa )}^-, \gamma +1,\\&\qquad \epsilon _{i+1, j,p(\kappa )}^+, \dots , \epsilon _{d, j,p(\kappa )}^+) \in K, \\&\quad l+ (\epsilon _{1,j,p(\kappa )}^-, \dots , \epsilon _{i-1,j,p(\kappa )}^-, \gamma ,\\&\qquad \epsilon _{i+1, j,p(\kappa )}^+, \dots , \epsilon _{d, j,p(\kappa )}^+) \in K^C,\\&\quad \emptyset \ne ({{\,\mathrm{bd}\,}}K) \cap (l+[0,n-1]^d) \subseteq M_\kappa \} \end{aligned} \end{aligned}$$

(in the second set \(\gamma \) and \(\gamma +1\) are exchanged), where we understand \(\sum _{\gamma =b}^a \alpha _\gamma = -\sum _{\gamma =a+1}^{b-1} \alpha _\gamma \) if \(a+1<b\) and \(\sum _{\gamma =a}^{a-1} \alpha _\gamma =0\). The idea behind this formula is that we go from \(\epsilon ^-\) to \(\epsilon ^+\) along a sequence of several intermediate points and determine for each pair of neighboring intermediate points for how many cells this pair is critical (in the sense that after adding the base point l of the cell one of the two points lies in K, while the other one lies in \(K^C\)).

Thus, we introduce the following notation: If \(x=(x_1, \dots , x_{d-1})\in \mathbb {R}^{d-1}\), \(y\in \mathbb {R}^{}\) and \(i\in \{1,\dots , d\}\), then \([x]^i_y:=(x_1, \dots , x_{i-1}, y, x_{i}, \dots , x_{d-1})\) is the vector in \(\mathbb {R}^{d}\) obtained from x by inserting y at the i-th position and moving the i-th to \((d-1)\)-st entry by one position.

For \(\kappa \in \{1,\dots , \mu \}\), \(\epsilon \in \{0,\dots ,n-1\}^{d-1}\), \(\gamma \in \{0,\dots , n-2\}\) and \(i\in \{1,\dots , d\}\) let \(\mathcal {C}_{\kappa ,\epsilon ,\gamma ,i}\) denote the system of cells which intersect \({{\,\mathrm{bd}\,}}K\), but only in points belonging to \(M_\kappa \), and for which \({{\,\mathrm{bd}\,}}K\) passes through between \(l+[\epsilon ]^i_\gamma \) and \(l+ [\epsilon ]^i_{\gamma +1}\). Formally, put

$$\begin{aligned} \mathcal {C}_{\kappa ,\epsilon ,\gamma ,i} := \{&l+[0, n-1]^d \mid l\in \mathbb {Z}^d , \\&(l+[0,n-1]^d) \cap {{\,\mathrm{bd}\,}}K \ne \emptyset , \\&(l+[0,n-1]^d) \cap {{\,\mathrm{bd}\,}}K \subseteq M_\kappa , \\&\# (K \cap \{l+[\epsilon ]^i_\gamma , l+[\epsilon ]^i_{\gamma +1} \} ) = 1 \} , \end{aligned}$$

and \(N^-_{\kappa ,\epsilon ,\gamma ,i} := \# \mathcal {C}_{\kappa ,\epsilon ,\gamma ,i}\); see Fig. 5.

The cells having one of these three pixel configurations make up the set \(\mathcal {C}_{\kappa ,\epsilon ,\gamma ,i}\) in the case \(d=2\), \(n=3\), \(\epsilon =0\), \(\gamma =1\), \(i=2\) and \(\kappa \in \{1,\dots ,\mu \}\) is as indicated by the slope of the line (as usual, the first coordinate of a point is plotted horizontal, increasing to the right, and the second coordinate is plotted vertical, increasing upwards). The defining property is that the border line must pass through between the upper left point and the middle left point. In the image from Figs. 1, 2, 3 and 4 the system \(\mathcal {C}_{\kappa , \epsilon , \gamma , i}\) consists only of a single cell—the one plotted red below—hence \(N_{\kappa ,\epsilon ,\gamma ,i} = 1\).

Now we have

$$\begin{aligned} N^{\kappa ,j} =&\sum _{i=1}^d \sum _{\gamma =\epsilon ^-_{i,j,p(\kappa )}}^{\epsilon ^+_{i,j,p(\kappa )}-1} {{\,\mathrm{sign}\,}}(u_i)\nonumber \\&\cdot N^-_{\kappa , (\epsilon _{1,j,p(\kappa )}^-, \dots , \epsilon _{i-1,j,p(\kappa )}^-, \epsilon _{i+1, j,p(\kappa )}^+, \dots , \epsilon _{d, j,p(\kappa )}^+ ), \gamma ,i} \end{aligned}$$
(4)

for an arbitrary \((u_1, \dots , u_d)\in \tilde{G}_{p(\kappa )}\), where \({{\,\mathrm{sign}\,}}\) is the sign function.

figure c

We are going to show that for \(\kappa \in \{1, \dots , \mu \}\), \(\epsilon \in \{0,\dots ,n-1\}^{d-1}\), \(\gamma \in \{0,\dots , n-2\}\) and \(i\in \{1,\dots ,d\}\) the number \(N^-_{\kappa ,\epsilon ,\gamma ,i}\) approximately equals

$$ I_{\kappa ,i} := \lambda _{d-1}(M_\kappa \mid E_i),$$

where M|E denotes the image of M under the orthogonal projection onto E and \(E_i:=e_i^\perp \) for the standard base \(e_1, \dots , e_d\) of \(\mathbb {R}^d\).

Before we come to the main result of this subsection, we discuss the special case that \(d=2\), \(n=2\) and \(p\in S(4)\) is such that \(G_p=\{ (u_1, u_2) \in \mathbb {R}^2 \mid 0 \le u_1 \le u_2 \}\).

In this case \(I_{\kappa ,1}\) is the length of the orthogonal projection of \(M_\kappa \) onto the y-axis and \(I_{\kappa ,2}\) is the length of the projection of \(M_\kappa \) onto the x-axis.

We let in this special case \(N^{\kappa ,1}\) denote the number of cells C with \(\emptyset \ne C \cap ({{\,\mathrm{bd}\,}}K) \subseteq M_\kappa \) with a black pixel in the lower left corner and the remaining three pixels being white, \(N^{\kappa ,2}\) is the number of cells “on” \(M_\kappa \) with two black pixels in the lower row and two white pixels in the upper row and \(N^{\kappa ,3}\) is the same number for the configuration in which only the pixel in the upper right corner is white. Thus, we have

$$\begin{aligned} N_{\kappa ,0,0,1}^-&= N^{\kappa ,1}&N_{\kappa ,1,0,1}^-&= N^{\kappa ,3} \\ N_{\kappa ,0,0,2}^-&= N^{\kappa ,1} + N^{\kappa ,2}&N_{\kappa ,1,0,2}^-&=N^{\kappa ,2} + N^{\kappa ,3}. \end{aligned}$$

Theorem 2

Let \(K\subseteq \mathbb {R}^2\) fulfill (R1) and let \(M_\kappa \subseteq H_p\) for the \(p\in S(4)\) described above. Then

$$\begin{aligned} N^{\kappa ,3} - N'_\kappa \le I_{\kappa ,1}&\text{ and } I_{\kappa ,1} \le N^{\kappa ,3}+N'_\kappa , \end{aligned}$$
(5)
$$\begin{aligned} N^{\kappa ,1} - N'_\kappa \le I_{\kappa ,1}&\text{ and } I_{\kappa ,1} \le N^{\kappa ,1}+N'_\kappa , \end{aligned}$$
(6)
$$\begin{aligned} N^{\kappa ,3} + N^{\kappa ,2} - N'_\kappa \le I_{\kappa ,2}&\text{ and } I_{\kappa ,2} \le N^{\kappa ,3} + N^{\kappa ,2} + N'_\kappa , \end{aligned}$$
(7)
$$\begin{aligned} N^{\kappa ,1} + N^{\kappa ,2} - N'_\kappa \le I_{\kappa ,2}&\text{ and } I_{\kappa ,2} \le N^{\kappa ,1} + N^{\kappa ,2} + N'_\kappa . \end{aligned}$$
(8)

Since this theorem is a special case of Theorem 3 below, we do not give a formal proof, but we only describe the ideas.

A horizontal line intersecting \(M_\kappa \) will pass through exactly one cell with three black pixels and one white pixel (unless the horizontal line is very close to one of the endpoints of \(M_\kappa \)). Thus, the number \(N^{\kappa ,3}\) of such cells equals the length of the projection of \(M_\kappa \) onto the y-axis up to some “border” effects coming from the fact that we had to exclude horizontal lines which are close to one of the endpoints of \(M_\kappa \) in the sentence before. If we make this approximation precise by two inequalities, we arrive at (5).

Exactly the same argument is true when cells with three black pixels are replaced by cells with one black pixel. Hence, (6) follows.

Fig. 5
figure 5

An example of a set \(\mathcal {C}_{{\kappa ,\epsilon ,\gamma ,i}}\)

We see that there are vertical lines intersecting no cell with three black pixels and one white pixel even if the line intersects \(M_\kappa \) far from the endpoints. However, we can observe that every vertical line either intersects a cell with three black pixels or a cell with two black pixels and that it can only intersect one such cell. Hence, the sum of the numbers of these two types of cells equals the length of the orthogonal projection of \(M_\kappa \) onto the x-axis. Similar as above we obtain (7). The same way as (7) we get (8).

Now let us return to arbitrary n and d.

Theorem 3

Let \(K\subseteq \mathbb {R}^{d}\) fulfill (R2) resp. (R2). Let \(\kappa \in \{1,\dots ,\mu \}\), \(i\in \{1,\dots ,d\}\), \(\epsilon \in \{0,\dots , n-1\}^{d-1}\) and \(\gamma \in \{0,\dots ,n-2\}\). Then

  1. (i)

    \(N^-_{\kappa ,\epsilon , \gamma ,i} - N'_\kappa \le I_{\kappa ,i}\)

  2. (ii)

    \( I_{\kappa ,i} \le N^-_{\kappa ,\epsilon ,\gamma ,i} + N'_\kappa \)

Proof

To prove (i) let \(\mathcal {Z} \subseteq \mathbb {Z}^{d-1}\) denote the set of points \(l=(l_1,\dots , l_{d-1})\in \mathbb {Z}^{d-1}\) for which there is some \(k\in \mathbb {Z}\) with

$$\begin{aligned}{}[l_1,l_1&+n-1] \times \dots \times [l_{i-1},l_{i-1}+n-1]\\&\times [k, k+n-1] \\&\times [l_{i},l_{i}+n-1] \times \dots \times [l_{d-1},l_{d-1}+n-1] \\&\in \mathcal {C}_{\kappa ,\epsilon ,\gamma ,i}. \end{aligned}$$

Clearly this integer k is determined uniquely - denote it by k(l) and put \(C_l:=[l_1,l_1+1] \times \dots \times [l_{i-1},l_{i-1}+1]\times [k(l), k(l)+1] \times [l_{i},l_{i}+1] \times \dots \times [l_{d-1},l_{d-1}+1]\). Let \(\mathcal {Z}_1:= \{l\in \mathcal {Z} \mid \times _{s} [l_s,l_s+1] \subseteq (M_\kappa \cap C_l)|E_i \}\), where \(E_i:=e_i^\perp \), and denote \(\mathcal {Z}_2:=\mathcal {Z} \setminus \mathcal {Z}_1\). Then

$$ \# \mathcal {Z}_1 \le \lambda _{d-1}\big ( \bigcup _{l\in \mathcal {Z}_1} (M_\kappa \cap C_l)| E_i \big ) \le I_{\kappa ,i}. $$

For every \(l\in \mathcal {Z}_2\) there is some integer \(k'(l)\) with

$$\begin{aligned} {[}l_1,&l_1+n-1] \times \dots \times [l_{i-1},l_{i-1}+n-1] \\&\times [k'(l), k'(l)+n-1] \\&\times [l_{i},l_{i}+n-1]\times \dots \times [l_{d-1},l_{d-1}+n-1] \in \mathcal {C}'_\kappa . \end{aligned}$$

Thus, \(\# \mathcal {Z}_2 \le N'_\kappa \). Hence, the first inequality follows.

In order to show (ii), we identify \(E_i\) with \(\mathbb {R}^{d-1}\). Let \((l_1,\dots , l_{d-1})\in \mathbb {Z}^{d-1}\) be a point with \(M_\kappa |E_i\) intersecting \(\times _{s} [l_s,l_s+n-1]\). If \(\times _{s} [l_s,l_s+n-1] \subseteq M_\kappa |E_{i}\) does not hold, then \((M_\kappa \cap M_{\kappa '}) |E_{i}\) intersects \(\times _{s} [l_s,l_s+n-1]\) for a \(\kappa '\ne \kappa \). Thus, there is a cell with coordinates in \(\times _{s} [l_s,l_s+n-1]\) that belongs to \(\mathcal {C}'_\kappa \). So assume \(\times _{s} [l_s,l_s+n-1] \subseteq M_\kappa |E_{i}\) from now on.

Let \(k\in \mathbb {Z}\) be the integer for which the line segment from \([l+\epsilon ]_{k+\gamma }^{i}\) to \([l+\epsilon ]_{k+\gamma +1}^{i}\) intersects \(M_\kappa \)–in case this k is not unique, choose the largest one if the i-th component of vectors from \(\tilde{G}_{p(\kappa )}\) is positive and choose the smallest one if the i-th component of the vectors from \(\tilde{G}_{p(\kappa )}\) is negative. Obviously,

$$\begin{aligned}{}[l_1,&l_1+n-1] \times \dots \times [k, k+n-1] \times \dots \\ {}&\times [l_{d-1}, l_{d-1}+n-1] \in \mathcal {C}_{\kappa ,\epsilon ,\gamma , i}\cup \mathcal {C}'_\kappa .\end{aligned}$$

So there is either a cell contributing to \(N^-_{\kappa ,\epsilon ,\gamma ,i}\) or a cell contributing to \(N'_\kappa \) with coordinates in \(\times _{s\ne i} [l_s,l_s+n-1]\) unless \((M_\kappa |E_i) \cap (\times _{s\ne i} [l_s,l_s+n-1]) = \emptyset \). In the latter case, however, \(\lambda _{d-1}((M_\kappa |E_i) \cap (\times _{s\ne i} [l_s,l_s+1]) )=0\). Summing up over all \(l\in \mathbb {Z}^{d-1}\) yields the second inequality. \(\square \)

For \(u\in S^{d-1}\) and \(c\in \mathbb {R}\) we let \((B_{u,c}, W_{u,c})\) denote the pixel configuration with \(B_{u,c}=\{x\in \{0,\dots ,n-1\}^d \mid \langle x, u \rangle \le c \}\) and \(W_{u,c}=\{x\in \{0,\dots ,n-1\}^d \mid \langle x, u \rangle > c \}\).

Corollary 1

Let \(K\subseteq \mathbb {R}^{d}\) fulfill (R1) resp. (R2). Let \(\kappa \in \{1,\dots ,\mu \}\) and \(j\in \{1,\dots ,2^{n^d}\}\). If \((B_j,W_j)=(B_{u,c}, W_{u,c})\) for some \(u\in \tilde{G}_{p(\kappa )}\) and \(c\in \mathbb {R}\), then

$$\begin{aligned} \begin{aligned} \sum _{i=1}^d \big (&(\epsilon ^+_{i,j,p(\kappa )} - \epsilon ^-_{i,j,p(\kappa )})\cdot {{\,\mathrm{sign}\,}}(u_i) \cdot I_{\kappa ,i} \\&\quad - |\epsilon ^+_{i,j,p(\kappa )} - \epsilon ^-_{i,j,p(\kappa )}|\cdot N'_\kappa \big )\\&\le \ N^{\kappa ,j} \\&\le \sum _{i=1}^d \big ((\epsilon ^+_{i,j,p(\kappa )} - \epsilon ^-_{i,j,p(\kappa )})\cdot {{\,\mathrm{sign}\,}}(u_i) \cdot I_{\kappa ,i} \\&\quad + |\epsilon ^+_{i,j,p(\kappa )} - \epsilon ^-_{i,j,p(\kappa )}|\cdot N'_\kappa \big ).\end{aligned} \end{aligned}$$

If \((B_j,W_j)\) is not of this form, then

$$\begin{aligned} N^{\kappa ,j}=0. \end{aligned}$$

Proof

The first assertion is an immediate consequence of (4) and Theorem 3, while the second one is trivial. \(\square \)

2.4 Proof of the Main Result

Here we prove Theorem 1.

The idea of this proof is the following: Using Corollary 1 we can approximate \(N^{\kappa ,j}(\frac{1}{t}K+v)\) up to a small correction term by an expression which is invariant under translations. For the translation invariant expression the supremum and the infimum on the left hand side of (3) cancel. Hence, we are left with the correction term, which grows at most of order \((1/t)^{d-2}\) by Lemmas 1 and 2. Together with the normalizing factor \(t^{d-1}\) in (1), the whole expression thus tends linearly to zero as \(t\rightarrow 0\).

Proof of Theorem 1

We have

$$\begin{aligned} \sum _{\kappa =1}^\mu N^{\kappa ,j}(\tfrac{1}{t}K+v)&\le N_{t,j}(K+tv)\\&\le \sum _{\kappa =1}^\mu N^{\kappa ,j}(\tfrac{1}{t}K+v) + N'(\tfrac{1}{t}K+v), \end{aligned}$$

for \(j=1,\dots , 2^{(n^d)}\).

From Corollary 1 we get

$$\begin{aligned} \sup \{&\begin{aligned}\hat{S}_{t}(K+tv)&\mid v\in [0,1)^d \}\\&- \inf \{ \hat{S}_{t}(K+tv) \mid v\in [0,1)^d \} \end{aligned} \\&\le \begin{aligned} \sum _{j=1}^{2^{(n^d)}} \big ( \sup \{ w_j\cdot t^{d-1} \cdot N_{t,j}(K+tv) \mid v\in [0,1)^d \}\\ - \inf \{ w_j\cdot t^{d-1} \cdot N_{t,j}(K+tv) \mid v\in [0,1)^d \} \big ) \end{aligned} \\&\le \begin{aligned} \sum _{j=1}^{2^{(n^d)}} \sum _{\kappa =1}^\mu&|w_j|\cdot t^{d-1} \cdot \big ( \sup \{ N^{\kappa ,j}(\tfrac{1}{t}K+v) \mid \\&\qquad v\in [0,1)^d \}\\&- \inf \{ N^{\kappa ,j}(\tfrac{1}{t}K+v) \mid v\in [0,1)^d \} \big ) \\&+ \Big ( \sum _{j=1}^{2^{(n^d)}} |w_j|\Big ) \cdot t^{d-1}\\&\cdot \sup \{N'(\tfrac{1}{t}K+v) \mid v\in [0,1)^d \}\end{aligned} \\&\le \begin{aligned} \sum _{j=1}^{2^{(n^d)}}&\sum _{\kappa =1}^\mu |w_j|\cdot t^{d-1} \cdot \sum _{i=1}^d 2|\epsilon ^+_{i,j,p(\kappa )}-\epsilon ^-_{i,j,p(\kappa )}| \\&\cdot \sup \{ N'(\tfrac{1}{t}K+v) \mid v\in [0,1)^d \} \\&+ \Big ( \sum _{j=1}^{2^{(n^d)}} |w_j|\Big ) \cdot t^{d-1}\\ {}&\cdot \sup \{ N'(\tfrac{1}{t}K+v) \mid v\in [0,1)^d \}\end{aligned} \\&\le \begin{aligned} \Big ( \sum _{j=1}^{2^{(n^d)}} |w_j|\Big )&\cdot t^{d-1} \cdot \Big ( (2nd\mu +1)\\ {}&\cdot \sup \{N'(\tfrac{1}{t}K+v) \mid v\in [0,1)^d \} \Big )\end{aligned} \\&\le st \end{aligned}$$

for an appropriate constant s by Lemmas 1 or 2. The second assertion is an immediate consequence of the first one. \(\square \)

3 Counterexamples

In this section we give examples showing that we cannot relax the assumptions of Theorem 1. At first we show that without the assumption that the different boundary parts \(F_1, \dots , F_m\) in (R1) do not intersect under an angle of zero the convergence rate of \({{\,\mathrm{\mathsf {Var}}\,}}\hat{S}_t(K+tU)\) may be slower. Building Cartesian products with \([0,1]^{d-2}\), one obtains a similar result in higher dimensions. It remains open, whether convergence can be assured at all without this assumption.

Example 1

Put for some \(k\ge 2\) (see Fig. 6)

$$\begin{aligned} L_1&:= \{ (x,y) \in \mathbb {R}^2 \mid |x|^k \le y \le 1 \} \\ L_2&:= \{ (x,y) \in \mathbb {R}^2 \mid -1\le x \le 1,\, -1 \le y\le 0 \} \text{ and } \\ K&:= L_1 \cup L_2. \end{aligned}$$

Moreover, let \(U=(U_1, U_2)\) be uniformly distributed on \([0,1)^2\).

Fig. 6
figure 6

The set K from Example 1 in the case \(k=2\)

The pixel configuration counts of K can be computed—except for the complete white pixel configuration—by

$$ N_{t,j}(K+tU) = N_{t,j}(L_1+tU) + N_{t,j}(L_2+tU) -E_j, $$

where \(E_j\) is some correction term arising due to intersection effects. Assume \(n=2\) from now on, i.e., consider \(2\times 2\)-pixel configurations. For the pixel configuration \((B_j,W_j)\) consisting of two white pixels in the lower horizontal row and two black pixels in the upper horizontal row, this correction term is

$$ E_j= D:= \# \{ v_1\in \mathbb {Z} \mid (tv_1,t), (tv_1+t,t) \in L_1+tU \}. $$

For the opposite pixel configuration \(E_j=D+2\) has to be subtracted, for the complete black pixel configuration \(E_j=-D\) holds, for the two pixel configurations which contain two white pixels in the lower row and one black pixel and one white pixel in the upper row we have \(E_j=1\) and for the two pixel configurations with black lower row and one black pixel and one white pixel in the upper row \(E_j=-1\) holds. For any other pixel configuration we have \(E_j=0\).

Recall that by Theorem 1 both \({{\,\mathrm{\mathsf {Var}}\,}}( t N_{t,j}(L_1+tU))\) and \({{\,\mathrm{\mathsf {Var}}\,}}( t N_{t,j}(L_2+tU))\) are of order \(O(t^2)\) as \(t\rightarrow 0\).

We have

$$\begin{aligned} D&= \begin{aligned}\# \{ v_1\in \mathbb {Z} \mid&|tv_1-tU_1|^k \le t-tU_2,\\ {}&|tv_1+t-tU_1|^k \le t-tU_2 \}\end{aligned} \\&= \begin{aligned}\# \{v_1\in \mathbb {Z} \mid&|tv_1-tU_1|\le \root k \of {t-tU_2}, \\ {}&|tv_1+t-tU_1| \le \root k \of {t-tU_2} \}\end{aligned}\\&{\left\{ \begin{array}{ll} \le \lfloor 2\cdot \root k \of {t-tU_2}/t \rfloor \\ \ge \lfloor 2\cdot \root k \of {t-tU_2}/t \rfloor -1.\end{array}\right. } \end{aligned}$$

Hence

$$\begin{aligned} \mathbb {P}(D >\rho ^*)&\ge \int _0^1 \mathbf {1}_{(\rho ^*,\infty )}\big (\lfloor 2 \root k \of {t-tu}/t\rfloor -1 \big ) \, du \\ {}&\ge \int _0^1 \mathbf {1}_{(0,\frac{1}{3})}(u) \, du =\frac{1}{3} \end{aligned}$$

for \(\rho ^*= 2\root k \of {\frac{2}{3}t}/t - 2\) and, similarly,

$$\begin{aligned} \mathbb {P}( D < \rho _*) \ge \frac{1}{3} \end{aligned}$$

for \(\rho _* = 2\root k \of {\frac{1}{3}t}/t\).

With \(\mu := \mathbb {E} D\) we get

$$\begin{aligned} \frac{1}{3}&\le \mathbb {P}\Big ( |D-\mu | >\frac{\rho ^*-\rho _*}{2} \Big ) \\ {}&\le \frac{4{{\,\mathrm{\mathsf {Var}}\,}}D}{(\rho ^*-\rho _*)^2} \\ {}&= \frac{ {{\,\mathrm{\mathsf {Var}}\,}}D}{\Big ( \Big (\root k \of {\tfrac{2}{3}}-\root k \of {\tfrac{1}{3}} \Big ) \cdot t^{-1+\frac{1}{k}} -1 \Big )^2} \end{aligned}$$

and therefore \({{\,\mathrm{\mathsf {Var}}\,}}D\ge c_k \cdot t^{-2+2/k}\) for sufficiently small \(t>0\) for an appropriate constant \(c_k>0\). This yields that \({{\,\mathrm{\mathsf {Var}}\,}}N_{t,j}(K+tU)\) is (at least) of order \(t^{-2+\frac{2}{k}}\) for the two pixel configurations \((B_j,W_j)\) that consists of one black row and one white row. The resulting estimator has a variance of order \(t^{2/k}\) (unless the weights of these two pixel configurations sum up to zero or (2) is violated, which is not the case for any reasonable surface area estimator).

It is not clear whether Theorem 1 still holds without the regularity assumption that the sets \(L_1, \dots , L_m\) in (R2) are either polytopes or have a \(C^2\) boundary with nowhere vanishing Gauss–Kronecker curvature. However, our method of proof breaks down without this assumption. In fact, the following example shows that Lemma 2 does not hold for an arbitrary compact and convex set K.

Example 2

Let \(K\subseteq \mathbb {R}^3\) be (see Fig. 7) the convex hull of

$$\begin{aligned} \big \{ (\sin \big (\tfrac{1}{2k}\big ),&\cos \big (\tfrac{1}{2k}\big ),1\big ) \mid k\in \mathbb {N} \big \} \cup \\&\big \{ (\sin \big (\tfrac{1}{2k-1}\big ),\cos \big (\tfrac{1}{2k-1}\big ),0\big ) \mid k\in \mathbb {N} \big \}. \end{aligned}$$
Fig. 7
figure 7

The set K of Example 2. The intersection of the set K with the level \(z=1\) is plotted gray, while the intersection of K with the level \(z=0\) is displayed shaded. The vertices at level \(z=1\) are marked by solid gray dots, while the vertices at level \(z=0\) are marked with empty black dots

Consider the homothetic image rK of K. It has edges l(rk), \(k\in \mathbb {N},\) linking \(\big (r\sin \big (\tfrac{1}{2k}\big ),r\cos \big (\tfrac{1}{2k}\big ),r\big )\) to \(\big (r\sin \big (\tfrac{1}{2k-1}\big ),r\cos \big (\tfrac{1}{2k-1}\big ),0\big )\). Each edge l(rk) separates two different facets of rK. Since one of these facets has an exterior normal vector \(\nu _1\) with \(\langle \nu _1,e_3\rangle >0\), while the other one has an exterior normal vector \(\nu _2\) satisfying \(\langle \nu _2,e_3\rangle <0\), they belong to different boundary components \(H_p\) and \(H_{p'}\), \(p\ne p'\). Thus, a cell whose interior intersects an edge l(rk) belongs to \(\mathcal {C}'(rK)\). Moreover, the numbers of cells necessary to cover one edge l(rk) grows asymptotically linear in r. If r is large enough depending on k, then a cell intersecting one edge of the form l(rk) cannot intersect any other edge \(l(r,k')\), \(k'\ne k\). Thus, the number of cells necessary to cover all lines \(l(r,k), k\in \mathbb {N},\) must grow faster than linear. We conclude that \(N'(rK)\) grows faster than linear.

4 Simulations

In this section we evaluate the variances of local estimators based on simulations. We use the weights obtained from discretizing the Crofton formula, see [21] or [18, Sec. 5.2], since they are often used in practice.

We consider three different objects: A cuboid with axes parallel to the coordinate axes and side lengths \(\frac{1}{2}\), 1 and 1, a parallelepiped whose vertices are \((1, -1, 0)\), (0, 0, 0), \((-1, 2, 0)\), (0, 1, 0), (0, 0, 1), \((1, -1, 1)\), (0, 1, 1), \((-1, 2, 1)\) and a ball of radius 1. We evaluate the variance at lattice distances of the form \(0.1 \cdot 0.999^k\) for integers k. However, we replace for each integer l the largest grid size which is smaller than 1/l by 1/l, since we expect the variance to have local minimum at these points for reasons explained below. For each object at each grid size, we determine the variance of the surface area estimator using 400 simulation runs. The results are reported in Fig. 8.

Fig. 8
figure 8

The standard deviation of the surface area estimator. The standard deviation of \(\hat{S}_t(K+tU)\) in dependence of the grid size t. In the upper picture K is the cuboid mentioned at the beginning of Sect. 4, in the middle picture K is the skewed parallelepiped and in the lower picture K is the ball. For further details see the text

For both parallelepipeds we see a highly oscillatory behavior of the standard deviation of \(\hat{S}_t(K+tU)\). It drops down to zero if \(t=2/l\) resp. \(t=1/l\). This is explained by the fact that for such t the distance of two opposite sides of the parallelepiped is an integer multiple of the grid size; hence, a point of the pixel lattice enters the set \(K+tU\) exactly at the time another point leaves at the opposite side (we imagine that U is varying) and thus the pixel configuration counts \(N_{t,j}(K+tU)\) do not depend on U. We see that the upper bound is a linear function—as we would expect from Theorem 1 (in the pictures it does not look linearly, since the x-axis is logarithmically scaled).

For the ball we do not see regular oscillations anymore but instead we see a zitterbewegung. This is not surprising, since a similar behavior of the variance is known for volume estimates based on pixel counts, see, e.g., [15, 16]. As already observed by Lindblad [14], both the upper and the lower bound behave approximately as some constant times \(t^{3/2}\). This indicates that Theorem 1 does not provide the best possible bound in the case that K is a ball.

The surface area is (up to a factor \(\frac{1}{2}\)) the \((d-1)\)-st intrinsic volumes. The intrinsic volumes (or Minkowski functionals) on \(\mathbb {R}^d\) are a family of \(d+1\) geometric functionals, including beside the surface area also the volume, the integral of mean curvature and the Euler characteristic. In \(\mathbb {R}^2\) and \(\mathbb {R}^3\) there are no further intrinsic volumes and in \(\mathbb {R}^2\) the surface area and the integral of mean curvature coincide. The variances of volume estimators have been studied intensively, see [7] for an overview and [3] for a more recent development. The Euler characteristic is a purely topological quantity. A sufficiently smooth set K can be reconstructed up to homeomorphism from a pixel image of sufficiently fine resolution [20, 23], and thus, it is possible to construct an estimator for the Euler characteristic that returns the correct value with probability one. A natural question is how estimators for the remaining intrinsic volume in \(\mathbb {R}^3\), i.e., the integral of mean curvature, behave. One motivation for the estimation of the integral of mean curvature is that for one-dimensional sets it coincides with the length. Local estimators for the length have a long history; see [2, Sec. 2]. In [28] it is shown that these estimators cannot be multigrid convergent. While in [28] this is only proven in \(\mathbb {R}^2\) for the Bresenham discretization, it can be expected that this holds in general \(\mathbb {R}^d\) and that it holds also for the Gauss discretization, if the observed one-dimensional sets are thickened in an appropriate way.

Local estimators for the integral of mean curvature in \(\mathbb {R}^3\) have the form

$$ \sum _{j=1}^{2^{n^3}} t\tilde{w}_j N_{t,j}(A). $$

So the differences to the estimators of the surface area are that \(t^2\) is replaced by t and, of course, that the weights \(\tilde{w}_j\) producing good results for the estimation of the integral of mean curvature are different from the weights \(w_j\) that produce good results for the estimation of the surface area. We have simulated the standard deviation of the estimator for the integral of mean curvature with the weights from [18, 21] under the same setup as above. The results are shown in Fig. 9.

Fig. 9
figure 9

The standard deviation of the estimator of the integral of mean curvature. The standard deviation of the estimator of the integral of mean curvature from [21] applied to \(K+tU\) in dependence of the grid size t. In the upper picture K is the cuboid mentioned at the beginning of Sect. 4, in the middle picture K is the skewed parallelepiped and in the lower picture K is the ball. For further details see the text

For the parallelepipeds the plots in Fig. 9 look quite similar to the plots in Fig. 8. This is partially explained by the fact that the breakdowns to zero of the standard deviation are caused by the same effects and therefore take place at the same lattice distances. However, one sees that even the scales are the same. This is definitely coincidence—if one replaces K by a homothetic image \(\lambda K\) the scales change differently for the estimator of the integral of mean curvature than for the surface area estimator. Again, one sees a linear decrease of the maximal standard deviation as the lattice distance tends to zero—however, the maximal standard deviation now decreases only linearly for the ball as well.

5 Discussion and Open Questions

We have shown that the variances of local estimators for the surface area from binary pixel images are of order \(O(t^2)\) as the lattice distance t tends to zero. So they are asymptotically neglectable compared to the biases.

While the situation somewhat reminds of a dart player hitting in every trial approximately the same point which is, however, far from the middle of the target, this is essentially good news: In \(\mathbb {R}^3\) it was clear from the results of [29] that we cannot derive an upper bound of less than \(0.04^2\) for the relative asymptotic mean squared error of any local surface area estimator. Now we have shown that this lowest imaginable upper bound is indeed correct for some estimators.

It is instructional to review what we have done in the light of the article of Kiderlen and Rataj [9].

Remark 1

From Corollary 1 we conclude with help of Lemmas 1 and 2 that

$$ \lim _{t\rightarrow 0} \mathbb {E}\, \hat{S}_t(K+tU) = \sum _{j=1}^{2^{(n^d)}} w_j \sum _{\kappa =1}^\mu \sum _{i=1}^d (\epsilon ^+_{i,j,p(\kappa )} - \epsilon ^-_{i,j,p(\kappa )}) \cdot I_{\kappa ,i}. $$

According to [9, Theorem 5] this limit equals (in the case that U is distributed uniformly on \([0,1]^d\))

$$ \sum _{j=1}^{2^{(n^d)}} w_j \int _{S^{d-1}} (- h(B_j\oplus \check{W}_j, u))^+ S_{d-1}(K,u), $$

where \(S_{d-1}(K,\cdot )\) is the surface area measure of K and \(\check{W}:=\{-w \mid w \in W \}\). This shows that the two expressions are equal, but of course this is not the most efficient way of deriving this equality.

Comparing local estimators for binary images to the local estimators based on grayscale images proposed by Svane, one sees that the biases of Svane’s estimators converge to zero [26], while the biases of the local estimators for binary images converge to positive values. The variances of the estimators from [26] converge to zero of order \(O(t^{d-1})\) as \(t\rightarrow 0\) [27], while the variance of the estimators studied in the present paper converge to zero of order \(O(t^2)\). So in \(\mathbb {R}^2\) we have a bias-variance trade-off, while in \(\mathbb {R}^3\) the variances of both kinds of estimators have the same order of convergence. Moreover, according to the mean squared error Svane’s estimators perform better in any dimension. However, these estimators rely on quite severe assumptions as we explained in the Introduction. So the overall recommendation for practitioners is the following: If the severe assumptions on which the estimators from [26] rely are fulfilled, then use one of them. However, if these assumptions are not fulfilled, then binarize the image and use an estimator for binary images.

An interesting question is how the variance of a local estimator of the surface area behaves under other model assumptions. When additionally to the random shift a random rotation is applied to the observed set, the relative mean squared error stays bounded, but does not converge to zero, as the grid distance tends to zero [14]. At least for asymptotically unbiased local estimators—under these model assumptions they exist—the variance behaves the same way. The question how the variance of a local estimator behaves when it is applied to a Boolean model is open.

The results of Sect. 4 show that the asymptotic variances of estimators for the integral of curvature in \(\mathbb {R}^3\) tend to zero of order \(O(t^2)\) as \(t\rightarrow 0\) as well. However, a proof following the proof of Theorem 1 shows only that this variance stays bounded. The reason is that beside (2) there are several other equalities that weights for any reasonable estimator of the integral of mean curvature have to fulfill. Clearly, these relations would have to be exploited in a proof of the optimal bound. However, up to now they are only known in \(\mathbb {R}^2\); see [24]. Of course, a theoretical determination of the optimal O-class of \({{\,\mathrm{\mathsf {Var}}\,}}\hat{S}_t(K+tU)\) in the special case that K is a ball is desirable as well. Also the variance of the surface area estimator applied to bodies with boundary components that intersect under an angle of zero should be further investigated.

The result that the asymptotic variance of an estimator \(\hat{S}_t\) of the form (1) is asymptotically neglectable compared to its bias can also be interpreted as \(\hat{S}_t\) being in fact not an estimator for the surface area, but for some other geometric quantity. For compact, convex sets \(K\subseteq \mathbb {R}^d\) with interior points this quantity is the difference of mixed volumes

$$ V(\mathcal {L}_1[1], K[d-1]) - V(\mathcal {L}_2[1], K[d-1]) $$

for

$$\begin{aligned} \mathcal {L}_1 := \bigoplus _{j=1}^{2^{n^d}} w_j{{\,\mathrm{conv}\,}}\big (\{0\} \cup (B_j\oplus \check{W}_j) \big ) \end{aligned}$$

and

$$ \mathcal {L}_2 := \bigoplus _{j=1}^{2^{n^d}} w_j{{\,\mathrm{conv}\,}}(B_j\oplus \check{W}_j), $$

where \(\bigoplus \) denotes the Minkowski sum and \({{\,\mathrm{conv}\,}}S\) denotes the convex hull of \(S\subseteq \mathbb {R}^d\). A Miles-type formula for this quantity has been obtained in [19]. Moreover, it also satisfies the assumptions of [5], and thus, we have central limit theorems for it applied to germ-grain models. We expect that also the local estimators for the other intrinsic volumes are in fact estimators for new geometric quantities.