DOI 10.1007/s00454-008-9126-2
Visible Vectors and Discrete Euclidean Medial Axis
Jérôme Hulin·Edouard Thiel
Received: 14 November 2007 / Revised: 15 September 2008 / Accepted: 20 November 2008 / Published online: 10 December 2008
© Springer Science+Business Media, LLC 2008
Abstract We denote byMRnthe test neighbourhood sufficient to extract the Euclid- ean Medial Axis of anyn-dimensional discrete shape whose inner radius is no greater thanR. In this paper, we study properties of discrete Euclidean disks overlappings so as to prove that in any given dimensionn,MRn tends to the set of visible vectors as Rtends to infinity.
Keywords Medial axis·Look-up table·Squared Euclidean distance transform· Visible points·Disks overlappings
1 Introduction
The Medial Axis (MA) is an important tool in image analysis, shape description, computer vision, robot motion planning, surface reconstruction, etc. It provides a global and centred representation of a shapeS, a shape being for example a discrete set of points or the frontier of a compact, depending on the considered working space.
The medial axis allows one to simplify, compress or compute a reversible skeleton ofS. First proposed by Blum in [2], MA was defined in [11] as the set of centres (and radii) of maximal disks inS, a disk being maximal inS if it is not included in any single other disk included inS. The medial axis is a cover of the input shape, i.e., the union of the balls of MA(S)is exactlyS, and thus MA is a reversible coding.
J. Hulin and E. Thiel research was supported in part by ANR grant BLAN06-1-138894 (projet OPTICOMB).
J. Hulin·E. Thiel (
)Laboratoire d’Informatique Fondamentale de Marseille (LIF, UMR 6166), Université de la Méditerranée, 163 Av. de Luminy, case 901, 13288 Marseille Cedex 9, France
e-mail:[email protected] url:http://www.lif.univ-mrs.fr/~thiel J. Hulin
e-mail:[email protected]
In this paper, we only consider shapes as bitmaps, i.e., a shape is a subset of Zn (without topology considerations). When the disks are distance balls, the MA points can be locally detected on the Distance Transform (DT) of the shape, where each shape point is labelled with the distance to its closest point in the background [16]. Then, a Reverse Distance Transformation (RDT) applied on MA allows one to recover exactly the original shape. Note that a maximal disk can be included in the union of several maximal disks; therefore MA, which is unique by definition, is seldom a minimal cover.
The most important discrete distances used in image analysis for bitmaps (inZn) are the squared Euclidean distancedE2 (squared to store integers) and chamfer dis- tancesdC, also known as weighted distances (introduced in [9]). Note thatdEis also denoted 2 in the literature and that both 1 and∞ are simple cases of chamfer distances. Chamfer DT and RDT are well known [3,9,16] with a simple and fast sequential in two raster scans computation; complexity isO(N.m), whereN is the number of points of the image, andmis the cardinal of the chamfer mask. A number of Squared Euclidean DT algorithms have been proposed over the past 30 years; see for example [12] or the recent one from Hirata [7], which is exact in arbitrary dimen- sion and easily parallelised, with aO(N.n)time complexity,nbeing the dimension.
The same complexity holds for the computation of the Squared Euclidean RDT [6].
The characterisation of MA is simple for distances such as1,∞[16] or 3×3 chamfer masks [1] by detecting the local maxima on DT, possibly lowering some DT labels before. A general approach using look-up tables (LUT for short) has been introduced fordE2 in [4] and for a 5×5 chamfer mask in [5]. The LUT gives for each value read in the DT, the minimum value of the neighbours that forbids a point to be in the MA. The neighbours which are necessary to test for each point of the shape are stored as a setMRn of vectors. The test neighbourhoodMRn is sufficiently large to detect the MA of alln-dimensional shapes whose inner radii are no greater thanR, the inner radius of a shapeSbeing the radius of a largest ball included inS.
The algorithms to compute both LUT and the neighbourhood MRn are given in [15] fordE2 and [14] for chamfer norms, in any dimensionn. The extraction of MA from DT using a precomputedMRn and LUT is linear inN ∗card(MRn). The computation of the LUT is linear inN for each vector inMRn. A fast algorithm to compute the test neighbourhood in the case of 2-dimensional chamfer norms, using the polytope description of discs, is proposed in [10]. The computation ofMRnis time consuming in the case of the Euclidean distance, butMRncan be calculated once for all bounded size images and stored at low memory cost (while LUTs can be huge and might be recomputed each time).
Alternative medial axes were recently proposed. In [13], an efficient algorithm, based on [15], computes the Higher Medial Axis (HMA), a medial axis fordE2 in a doubled resolution grid, which permits the application of further homotopic thinning for the computation of homotopic skeletons. A new linear-time algorithm in [6], in- spired by [7], provides the Reduced Medial Axis (RMA) for dE2; the basic idea is to filter a set of maximal Euclidean paraboloids; while maximal balls and maximal paraboloids coincide in the continuous case, this is not true in the discrete space, and the resulting RMA is generally different from MA.
In the LUT method, experiments in [14,15] show completely different properties ofMRndepending on the distance used. For any given chamfer norm,MRnis bounded
but can have nonvisible vectors (a vector is said to be visible if its coordinates are co- prime). ConcerningdE2,MRn is unbounded; moreover,MRnhas only visible vectors, and progressively, all visible vectors seem to appear inMRn whenR grows. This is summarised by a conjecture in [15], which claims thatMRn tends to the set of visible vectors ofZnasRtends to infinity.
In this paper, we are interested to prove the above conjecture. The difficulty lies in the fact that the algorithm in [15] neither explains why a vector might be selected or not for a radiusR, nor gives information about the order of appearance of vectors in MRn. To our knowledge, there is no closed formula forMRnand LUT. Also, intuition might be distorted by geometry in Euclidean space. We have to deal with discrete Euclidean disks, with overlappings of smallest or largest disks including or excluding discrete points. In order to insure the existence of points in some situation, we will construct a family of shapes, involving sometimes huge disks. The reader does not need to be fully acquainted with the DT and LUT algorithms, since neither of them play a part in our proof.
After some definitions and recalls in Sect.2, we tackle the proof in Sect.3: we show the unicity ofMRn for everyR, then we prove that nonvisible vectors are su- perfluous, and finally, that all visible vectors are gradually necessary whenRgrows.
We conclude after a discussion in Sect.4.
2 Definitions
2.1 The Discrete SpaceZn
In the following, we considerZnboth as ann-dimensionalZ-module (i.e., a discrete vector space) and as its associated affine space; we setZn∗ =Zn\ {0}. A shapeS is a subset of points ofZn. The complement ofS(also called background), denoted by S, isZn\S.
In the remainder of the paper, we only consider the Euclidean distance. Given two pointsx, yand a vectorvinZn, we denote bydE(x, y)orxythe Euclidean distance betweenx andy, and byvthe Euclidean norm ofv. We write(xy)for the line inRn passing through x andy, and[xy]for the line segment inRn joining x and y. The Cartesian coordinates of v are denoted by(v1, . . . , vn). A vector v∈Zn is visible from the origin (visible for short) ifu∈Zn∗andλ >1 such thatv=λu, or equivalently, ifgcd(v1, . . . , vn)=1. The set of all visible vectors ofZnis denoted by Vn(note that0 is not visible).
We callΣn(x)the group of axial and diagonal symmetries inZnabout centrex.
For a givenx, the cardinal of the group is #Σn(x)=2nn!(which is 8, 48 and 384 for n=2, 3 and 4). A shapeS is said to be G-symmetrical if for everyσ∈Σn(O), we haveσ (S)=S. The generator of a setX⊆Zn(orRn) is
G(X)=
(x1, . . . , xn)∈X:0xnxn−1· · ·x1
. (1)
Figure 1 shows G(Rn)for n=2 (an octant) and n=3. A G-cone ofZn is, by definition, the image of G(Zn)by a given symmetryσ inΣn(O).
Fig. 1 G(Rn)forn=2 and 3
For any set of vectors v1, . . . ,vk ∈Zn, C(v1, . . . ,vk) stands for the relation:
v1, . . . ,vk all lie in a common G-cone ofZn. We also denote by¬C(v1, . . . ,vk) the contrary of the relationC(v1, . . . ,vk), i.e.,∃1i < jksuch thatvi andvj do not lie in a same G-cone ofZn.
Finally, given a vectorv∈Zn, we callv the representative ofvin G(Zn), defined to be the vector in G(Zn) verifyingv=σ (v)for some σ ∈Σn(O). According to the definition of the generator (1),v is unique for anyv, and its coordinates can be computed by swapping the absolute values of the Cartesian coordinates ofv until they are decreasing.
2.2 Balls and Medial Axis
The ball of centrex∈Znand radiusr∈Ris B(x, r)=
p∈Zn:dE(x, p)r
. (2)
Since we consider discrete balls, any ball has an infinite number of radii. We denote by∼the equivalence relation
r∼r ⇔ B(O, r)=B(O, r). (3)
The equivalence class of a givenr∈Ris the set of allr∈RsatisfyingB(O, r)= B(O, r). We define the representative radius of a given ballB of centrex∈Znto be the smallest radiusrfor whichB(x, r)=B. As a consequence, the representative radiusris the only radius of its equivalence class for which there exista, b∈Nsuch thatr2=a2+b2.
By definition, the considered balls are ascending by inclusion, i.e., such that
rr ⇒ B(x, r)⊆B(x, r). (4)
LetS be a shape and x∈Zn. We define IS(x) to be the largest ball of centrex included inS(ifx /∈S, we haveIS(x)= ∅). Analogously, we denote byHS(x)the smallest ball of centrexwhich containsS. See an example in Fig.2.
The inner radius of a given shapeS, denoted by rad(S), is the representative radius of a largest ball included inS. We denote by CSn(R)the class of alln-dimensional shapes whose inner radii are less than or equal toR.
A ball included inSis called a maximal ball ofSif it is not included in any other ball included inS. The Medial Axis (MA) of a shapeSis the set of centres (and radii)
Fig. 2 HS(x)andIS(x)for a shapeS(Sis represented by bullets)
of all maximal balls ofS. The balls being ascending by inclusion, we have
x∈MA(S) ⇔ x∈Sand∀x∈S\ {x}, IS(x)IS(x). (5) If there existsv∈Zn∗such thatIS(x)⊆IS(x−v), we say thatvforbidsxto be a medial axis point ofS.
In order to obtain the radii of all largest balls insideS, we first compute the Dis- tance Transform (DT for short) ofSdefined by
∀x∈Zn, DT(x)=min
dE2(x, p):p∈S
. (6)
SincedE2 is a discrete distance (i.e., whose values are inN), DT(x)−1 is a squared radius of the ballIS(x). Although MA is computed on the Squared Euclidean Dis- tance Transform (SEDT), which is stored as integer values, the result is actually the MA fordE, since balls ofdEanddE2 (up to a squared radius) are equivalent.
Compared to the continuous case, no closed formula gives the minimal radius of a discrete ball containing another discrete ball, which is a major difficulty.
2.3 Minimum Test NeighbourhoodMRn
For a given shapeS, we need a test neighbourhoodM⊆Zn∗sufficient to detect, for everyx∈S, ifx is a point of MA(S). Ifx /∈MA(S), thenMmust contain at least one vectorvwhich forbidsx to be an MA point. Otherwise, ifx∈MA(S), there is nov∈Znwhich satisfiesIS(x)⊆IS(x−v). ThusMis sufficient forSiff
∀x∈S,
x∈MA(S)⇒ ∃v∈M, IS(x)⊆IS(x−v)
. (7)
We are interested in computing, for any shape S, a minimum test neighbour- hood M. More generally, we shall look for a minimum test neighbourhood MRn sufficient to detect the MA of all n-dimensional shapes whose inner radii are less than or equal to a givenR, i.e., shapes in CSn(R).
3 Properties of the Test NeighbourhoodMRn
The following observation provides two criterions for excluding a point from the medial axis of a shape, and it will be extensively used in the following proofs. It is a consequence of the fact that the balls are ascending by inclusion, see (4).
Observation 1 Let S ⊆Zn be a shape, x ∈S, v∈Zn∗, and let B =IS(x). The following three sentences are equivalent:
(a) vforbidsxto be an MA point ofS, (b) B⊆IS(x−v),
(c) HB(x−v)⊆S.
The equivalence(a)⇔(b)is the definition ofvforbiddingx from MA(S). We also clearly have(c)⇒(a). Finally we have(b)⇒(c)becauseB⊆IS(x−v)im- plies thatHB(x−v)⊆IS(x−v), and soB⊆HB(x−v)⊆IS(x−v)⊆S.
Remark 1 In figures, we will often represent a discrete ball by the boundary of a continuous counterpart, i.e., a ball inRn having an equivalent radius. These figures might seem counter-intuitive, for if a discrete ball is included in another discrete ball, then their continuous counterparts may not satisfy the inclusion.
3.1 Unicity ofMRn
We begin by proving the following proposition:
Proposition 1 For allR∈Randn2, there exists a unique test neighbourhood MRn which is minimal by cardinality and sufficient to detect the medial axis of any shape in CSn(R).
Proof The existence of MRn is guaranteed by the fact that Zn∗ is a sufficient test neighbourhood for anyn-dimensional shape.
Suppose that for givenR∈Randn2, there exist two different test neighbour- hoodsMRnandMRn, both minimal by cardinality. Hence there is at least one vector uinMRn\MRn. Moreover, there exists a shapeSin CSn(R)and a pointxinSsuch thatuis the only vector inMRn which forbidsx to be in MA(S), for otherwiseu could be removed fromMRn, which would contradict the minimality ofMRn.
We setB=IS(x)andH=HB(x−u), see Fig.3. By Observation1 we have H⊆S, soH∈CSn(R). Since{x−u}is the MA ofH (a ball) andu∈/MRn, there exists a vectoru=uinMRnwhich forbidsxto be in MA(H ).
Now, considerH=HB(x−u). Sinceuforbidsxfrom MA(H ), Observation1 yieldsH⊆H. Furthermore, H and H do not coincide, and therefore H H. Again by Observation1, it follows that udoes not forbid x to be in MA(H). In consequence, there existsv=uinMRn which forbidsx from MA(H). However, such a vectorvinMRnalso forbidsxto be in MA(S), contradicting the fact thatuis
the only one.
Corollary 1 If 0RR, thenMRn⊆MnR.
Proof By definition,MnR is large enough to detect the MA of any shape in CSn(R).
SinceMRn is unique for everyR, it follows easily thatMRn⊆MnR.
Fig. 3 A shapeS, a ball B=IS(x), and two balls H=HB(x−u), H=HB(x−u)
Corollary 2 For allR0 andn2,MRnis G-symmetrical.
Proof By Proposition 1, G(MRn) is unique. Moreover, the Euclidean balls are G-symmetrical, so∀S∈CSn(R),∀σ∈Σn(O), σ (S)∈CSn(R). Therefore,MRn is
also G-symmetrical.
We now proceed in two steps in order to prove thatMRn tends toVnas Rtends to infinity. First, we show in Sect.3.2that everyMRn contains visible vectors only.
Second, we show in Sect.3.3that for each visible vectorv∈Vn, there existsR∈R such thatvbelongs toMRn.
3.2 Nonvisible Vectors Are Superfluous
Proposition 2 Letx be a point in a given shapeS⊆Zn, andu, λube two vectors inZn∗withn2 andλ >1. Ifλuforbidsx to be a point of MA(S), then so doesu.
Proof Setv=λu,x=x−u,x=x−v andB=IS(x)(see Fig.4). Letp,p andpbe points ofB(arbitrarily chosen) that maximise the distance tox,xandx, respectively. So we have1
∀z∈B, xzxp, xzxp and xzxp. (8) Let B =B(x, xp) and B=B(x, xp). By construction, B=HB(x) and B=HB(x).
The hypothesis thatv forbids x from MA(S)is by Observation1 equivalent to B⊆IS(x)orB⊆S. To prove thatuforbidsxfrom MA(S), we have to show that B⊆IS(x), or analogously, thatB⊆S. It is thus sufficient to show thatB⊆B. To complete the proof, we need two preliminary lemmas.
LetP be the hyperplane inRnorthogonal touand containingp, and letP+be the closed half-space delimited byPand which does not containx; we have
P+=
z∈Rn:u·−→
pz0
. (9)
1Remember thatabstands fordE(a, b).
Fig. 4 x,xandxare collinear.Sis not shown. The figure may seem
counter-intuitive, see Remark1
Lemma 1 Ifz∈Bandz∈P+, thenz∈B.
Proof Sincez∈B, we have(xz)2(xp)2. By insertingu=−→
xx we obtain(u+
−
→xz)2(u+−→
xp)2. Hencexz2+2u· −→xzxp2+2u·−→
xp, so xz2+2u·−→
pzxp2. (10)
Sincez∈P+, we haveu·−→
pz0 by (9); therefore (10) givesxz2xp2, soxz xp. Furthermore,p∈Bby definition, soxpxp. Thusxzxp, and soz∈B.
Lemma 2 Suppose thatv=λuwith 1< λ∈R. Ifz∈Bandz /∈B, thenz∈P+. Proof Sincez∈B, we have xzxp. By insertingu=−→
xx we can write (u+
−
→xz)2(u+−→
xp)2, so
xz2+2u· −→xzxp2+2u·−→
xp. (11)
We also suppose thatz /∈B, soxp< xz. Since by definitionp∈B⊆B, we havexpxp, thusxp< xz. By insertingv=−→
xx we have (v+−→
xp)2<
(v+ −→xz)2, and so
xp2+2v·−→
xp< xz2+2v· −→xz. (12) By adding (11) and (12) we obtain u· −→xz+v·−→
xp<u·−→
xp+v· −→xz, and thus u·−→
pz <v·−→
pz. Provided thatv=λu,λ >1, it follows that(λ−1)u·−→
pz >0, so u·−→
pz >0, and thusz∈P+.
These two lemmas allow us to complete the proof of Proposition2; recall that we want to establish the inclusionB⊆B. Suppose that there exists a pointzinB\B. According to Lemma2, we havez∈P+. Soz∈B andz∈P+, and therefore by
Lemma1 we get z∈B. Thus z∈B and z /∈B, but by constructionB ⊆B, a
contradiction.
Proposition 3 NoMRncontains nonvisible vectors.
Proof Letube a visible vector and v=λuwithλ∈N, λ >1. To obtain a con- tradiction, suppose that there exists a radius R for which v∈MRn. According to Proposition2,v can be replaced withu inMRn. Ifuis already inMRn, thenv is useless andMRn is not minimal. Else,MRn=(MRn\ {v})∪ {u}has the same cardi- nality asMRn, and therefore is another minimal neighbourhood, contradicting unicity
in Proposition1.
3.3 All Visible Vectors Are Gradually Necessary
We first need three preliminary lemmas. The first two will help defining the so-called candidates of a given visible vectorv, a set of vectors of finite cardinality which will be sufficient to consider when we will prove thatvappears in someMRn.
Lemma 3 Letu,v∈Zn∗withn2. If¬C(u,v), thenu+v<u+v.
Proof Without loss of generality, we can assume thatu∈G(Zn)andv∈/G(Zn). We define the following transformationg:
If∃insuch thatvi<0, theng(v)=(|v1|, . . . ,|vn|).
Else, if there exist at least two indexesi < jnsuch that vi< vj andui > uj, theng(v)=(v1, . . . , vi−1, vj, vi+1, . . . , vj−1, vi, vj+1, . . . , vn).
Else, we havev∈G(Zn), so we setg(v)=v.
All the coordinates ofuare positive, so if the first case applies, then clearlyu+ v<u+g(v). If the second case applies, then
u+g(v)2− u+v2=(ui+vj)2+(uj+vi)2−(ui+vi)2−(uj+vj)2
=2(ui−uj)(vj−vi),
which is strictly positive.v is constructed fromv by repeated applications of g, at least once. Finally we obtain
u+v<u+g(v)<u+gg(v)<· · ·<u+v. The lemma still holds if we consider three or more vectors, the hypothesis be- ing that at least two of them do not satisfy the relationC. The method of proof is unchanged.
Lemma 4 Letu,v be two vectors inZn∗andB be a discrete ball of centrex∈Zn withn2. Let B=HB(x−u) and B=HB(x−v). If ¬C(u,v,v−u), then BB.
Fig. 5 A pointqinB\B. For the sake of clarity, only a quarter ofBis drawn (black bullets). In general,zmay not be equal toz
Fig. 6 The setA(v)of candidates (represented by bullets) of a visible vectorv
Proof The procedure is to find a pointq inB\B. Letx=x−u,x=x−v, w=v−u=−−→
xx(see Fig.5).
Without loss of generality, we can assume that w∈G(Zn). Let p be a point (arbitrarily chosen) of B which maximises its distance tox, and set z=p−x.
By construction,xp= v+z is the representative radius of B. Now consider q=x+u+z. We havexq= u+zandxq= −−→
xx+−→
xq = w+u+z. Let σ denote the symmetry inΣn(x)satisfyingσ (u)=u, and setB=σ (B). Sinceσ preserves distances,B∈B. Furthermore,q∈B, so q∈B.
The hypothesis¬C(u,v,w)implies thatuandwdo not lie in a common G-cone, for otherwisev would also lie in the same G-cone, since by definitionv=u+w.
So we have¬C(w,u), and thereforew+u+z>w+u+z by extension of Lemma3to three vectors.
Sincew∈G(Zn), we havew=w, and hence
xq= w+u+z>w+u+z =xp.
Sincexp is the representative radius ofB, we deduce thatq /∈B. Consequently,
we have proved thatq∈B\B.
From now on, we call A(v)=
u∈Zn∗ :u=vandC(u,v,v−u)
(13) the set of the candidates of a given visible vectorv. Geometrically speaking, the candidates ofv are a finite set of vectors which are smaller than v and angularly close tov. An example of candidates in the 2-dimensional case is given in Fig.6.
The following lemma will be central to prove that every visible vector belongs to someMRn. LetB be a ball of centrex and radiusr. If the working space wasRn
instead ofZn, we would naturally have rad(HB(x−v))=r+ v. This is generally false in the discrete space. However, the lemma states that in the discrete space, this equality tends to be satisfied asrtends to infinity.
Lemma 5 Letvbe a vector inZn∗(withn2),x∈Znandr∈R+. Letrdenote a radius of the smallest discrete ball of centrex=x−vwhich containsB(x, r). Then we have
r→+∞lim r+ v −r=0.
Proof Letp be the farthest point fromx included inB(x, r)verifyingp=x+λv for someλ∈N(see Fig.7). There exists a vector inZn(sayz) orthogonal tovwhose norm is no greater than that ofv: for instance, takez=(−v2, v1,0, . . . ,0). Letq∈Zn be the farthest point frompincluded inB(x, r)which satisfiesq=p+k.zfor some k∈Z+; and lett∈Rn be the point satisfying bothxt=randt=p+l.zfor some l∈R+. We have
pqpt− zpt− v. (14)
Sincezis orthogonal tov, we have
pt2=xt2−xp2 (15)
and also
r2xq2=xp2+pq2. (16) Substituting (14) and (15) into (16) yields
r2xp2+
xt2−xp2− v2
. (17)
Replacingxpbyxp+ vandxtbyr, we can rewrite (17) as r2
xp+ v2
+
r2−xp2− v2
xp+ v2
+r2−xp2+v2−2v
r2−xp2
v
2xp+ v
+r2+v2−2v
r2−xp2. (18) By construction we havexp > r− v, and hence
r2−xp2< r2−
r− v2
<2vr.
Using the last two inequalities, we can develop (18) into r2v
2r− v
+r2+v2−2v 2vr
r2+2vr−2v 2vr. (19)
Fig. 7 A ballBof centrexand radiusr, and the ball
B=HB(x−v)
With the notation(r)=r+ v −r, we deduce from (19) that (r)r+ v −
r+ v2
−2v 2vr−v2.
A Taylor development at first order of the right-hand side of this expression gives (r)v.√
2v
√r +o 1
r
asr→ +∞.
Consequently, the limit of(r)is 0 asr→ +∞.
Proposition 4 For alln2 andv∈Vn, there existsR∈R+such thatv∈MRn. Proof Letv be a given visible vector inVn, and let x∈Zn. The basic idea of the proof is to construct a shapeS⊆Znsuch thatvis the only vector which forbidsxto be in the medial axis ofS, i.e.,
IS(x)⊆IS(x−v),
∀u∈Zn∗ \ {v}, IS(x)IS(x−u). (20) Equivalently, if we considerB=IS(x), according to Observation1, we have to show
that
HB(x−v)⊆S,
∀u∈Zn∗ \ {v}, HB(x−u)S. (21) For anyk∈N, setpk=x+k.v,Bk=B(x, kv)andSk=B(x−v, (k+1)v).
An example is given in Fig.8. Since rad(HBk(x−v))rad(Bk)+ vandpk∈Sk, we haveSk=HBk(x−v).
Fig. 8 Bk, Bku,Skin the plane W(u), fork=2
For anyu∈Zn∗, letBku=HBk(x−u). According to Lemma4,¬C(u,v,v−u) implies thatBkuSk, and hence udoes not forbidx from MA(Sk). Therefore, to complete the proof, we need only considerA(v)(the candidates ofv) and find an integerγ for which
∀u∈A(v), BγuSγ. (22) For anyu∈A(v), letW(u)denote the 2-dimensional plane inRn containingx,v andu. We also denote byPkthe hyperplane inRnorthogonal tovand which contains pk. By construction,pkis the only point inSk∩Pk. Setx=x−u, letqkdenote the orthogonal projection ofxontoPk, and lettk be the point verifyingxtk=rad(Bku) andtk=pk+λ−−→pkqkfor someλ∈R+. Note that in general,qk andtkare not points ofZn. We can write
(qktk)2=(xtk)2−(xqk)2. (23) By projectinguontovwe can rewritexqkasxpk+ ucos(u,v), and hence
(qktk)2=(xtk)2−
xpk+ ucos(u,v)2
=
xtk+xpk+ ucos(u,v)
xtk−xpk− ucos(u,v)
. (24) Sincexpkandxtk are the radii ofBk andBkurespectively, Lemma5shows that
k→+∞lim xtk−xpk= u. (25) Since u∈A(v), the vectors u andv are not collinear with each other, and 0<
cos(u,v) <1. So, combining (24) and (25), we deduce that
k→+∞lim qktk= +∞. (26)
Each line(pkqk)passes through infinitely many points ofZn, becausepk∈Znand there exists at least one discrete vectorz∈W(u)∩Pk, for example, takez=(u∧
v)∧v. Moreover, the integer points on the line segment[qktk]are inBku\Sk since [qktk] ⊆PkandPk∩Sk=pk. On account of (26) and the above remarks, it follows that
∀u∈A(v), ∃ku∈N, ∀k > ku, BkuSk. (27) Finally, we see that takingγ =max{ku:u∈A(v)}is sufficient to satisfy (22). The existence ofγ is ensured by the fact thatA(v)is bounded for everyv.
We can now formulate our main result. By Propositions3and4, we have shown the following:
Theorem 1 The minimum test neighbourhoodMRn sufficient to detect the discrete Euclidean medial axis of any shape in CSn(R)satisfies limR→+∞MRn=Vn.
4 Discussion
4.1 On the Density ofVn
Letv be a vector inZn, selected at random. The probabilityp(n)that v is visible is given by ζ (n)1 (see [8]), whereζ (n)is the Riemann zeta function defined for any integernby
ζ (n)=
+∞
k=1
1 kn.
For the two-dimensional case, this gives p(2)= 1
ζ (2)= 6
π2≈0.61.
In higher dimensions we havep(3)≈0.83 andp(4)≈0.92. Moreover,p(n)grows withnand tends to 1 asn→ +∞. So we see that the probability that a point (selected at random) belongs to someMRn is quite high.
4.2 On the Appearance Radii
The appearance radius of a given vectorv∈Vn, denoted byR(v), is defined to be the smallest Euclidean radiusR∈Rsatisfyingv∈MRn. We have seen above thatVn is quite dense inZn; however experiments in [15] show that the appearance radius of a given vectorvis much greater than the Euclidean norm ofv. For example, in the 2-dimensional case, it seems that the appearance radius of a given vectorvis always greater than the squared norm ofv.
Future work will be focused on boundingR(v)or card(MRn). For instance, for a given dimensionn, if there exists a functionf such thatvf (R(v))for all v∈Vn, then the set of all visible vectors whose norm is no greater thanf (R)will be a sufficient test neighbourhood to detect the medial axis of anyS∈CSn(R). This way, it will not be necessary to precalculateMRn before extracting the medial axis.
5 Conclusion
In this paper, we have established a relation between the set of visible vectorsVnand the minimum test neighbourhoodMRn able to detect the discrete Euclidean medial axis of any shape inZnwhose inner radius is no greater thanR.
The property that nonvisible vectors are superfluous allows one to speed up the computation ofMRn. The fact thatMRn is unbounded when R grows is specific to the Euclidean distance and seems to be false for all chamfer distances. This must be linked to the fact that the discrete Euclidean balls may have an indefinitely large number of faces, whereas the balls of a given chamfer distance are polyhedra with a constant number of faces.
In future works, we hope to improve the characterisation ofMRn. In particular, we would like to find a lower bound for the appearance radius of any given visible vector.
We are also interested in reducing the set of candidates of a given visible vectorv(a set of vectors sufficient to consider when computing the appearance radius ofv), so as to improve the computation complexity ofMRn.
References
1. Arcelli, C., Sanniti di Baja, G.: Finding local maxima in a pseudo-Euclidean distance transform.
Comput. Vis. Graph. Image Process. 43, 361–367 (1988)
2. Blum, H.: A transformation for extracting new descriptors of shape. In: Wathen-Dunn, W. (ed.) Mod- els for the Perception of Speech and Visual Form, pp. 362–380. MIT Press, Cambridge (1967) 3. Borgefors, G.: Distance transformations in arbitrary dimensions. Comput. Vis. Graph. Image Process.
27, 321–345 (1984)
4. Borgefors, G., Ragnemalm, I., Sanniti di Baja, G.: The Euclidean distance transform: finding the local maxima and reconstructing the shape. In: 7th Scandinavian Conf. on Image Analysis, vol. 2, pp.
974–981. Aalborg, Denmark (1991)
5. Borgefors, G.: Centres of maximal disks in the 5–7–11 distance transform. In: 8th Scandinavian Conf.
on Image Analysis, pp. 105–111. Tromsø, Norway (1993)
6. Coeurjolly, D.:d-Dimensional reverse Euclidean distance transformation and Euclidean medial axis extraction in optimal time. In: 11th DGCI, Naples, Italy, November 2003. Lecture Notes in Computer Sience, vol. 2886, pp. 327–337. Springer, Berlin (2003)
7. Hirata, T.: A unified linear-time algorithm for computing distance maps. Inf. Process. Lett. 58(3), 129–133 (1996)
8. http://mathworld.wolfram.com/VisiblePoint.html
9. Montanari, U.: A method for obtaining skeletons using a quasi-euclidean distance. J. ACM 15, 600–
624 (1968)
10. Normand, N., Évenou, P.: Medial axis LUT computation for chamfer norms using H-polytopes. In:
14th Discrete Geometry for Computer Imagery, Lyon, France, April 2008. Lecture Notes in Computer Sience, vol. 4992, pp. 189–200. Springer, Berlin (2008)
11. Pfaltz, J.L., Rosenfeld, A.: Computer representation of planar regions by their skeletons. Commun.
ACM 10, 119–125 (1967)
12. Saito, T., Toriwaki, J.I.: New algorithms for Euclidean distance transformation of ann-dimensional digitized picture with applications. Pattern Recogn. 27(11), 1551–1565 (1994)
13. Saúde, A.V., Couprie, M., Lotufo, R.: Exact Euclidean medial axis in higher resolution. In: 13th Dis- crete Geometry for Computer Imagery, Szeged, Hungary, October 2006. Lecture Notes in Computer Sience, vol. 4245, pp. 605–616. Springer, Berlin (2006)
14. Rémy, E., Thiel, E.: Medial axis for chamfer distances: computing LUT and neighbourhoods in 2D or 3D. Pattern Recogn. Lett. 23(6), 649–661 (2002)
15. Rémy, E., Thiel, E.: Exact medial axis with Euclidean distance. Image Vis. Comput. 23(2), 167–175 (2005)
16. Rosenfeld, A., Pfaltz, J.L.: Sequential operations in digital picture processing. J. ACM 13(4), 471–494 (1966)