Medial Axis LUT Computation for Chamfer Norms Using H-Polytopes Nicolas Normand, Pierre Évenou
Total Page:16
File Type:pdf, Size:1020Kb
Medial Axis LUT Computation for Chamfer Norms Using H-Polytopes Nicolas Normand, Pierre Évenou To cite this version: Nicolas Normand, Pierre Évenou. Medial Axis LUT Computation for Chamfer Norms Using H- Polytopes. Discrete Geometry for Computer Imagery, Apr 2008, Lyon, France. pp.189-200, 10.1007/978-3-540-79126-3_18. hal-00272432 HAL Id: hal-00272432 https://hal.archives-ouvertes.fr/hal-00272432 Submitted on 11 Apr 2008 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Medial Axis LUT Computation for Chamfer Norms Using -Polytopes H Nicolas Normand, Pierre Evenou´ IRCCyN/IVC UMR CNRS 6597 Abstract. Chamfer distances are discrete distances based on the propagation of local distances, or weights defined in a mask. The medial axis, i.e. the centers of the maximal disks (disks which are not contained in any other disk), is a powerful tool for shape representation and analysis. The extraction of maximal disks is performed in the general case with comparison tests involving look-up tables rep- resenting the covering relation of disks in a local neighborhood. Although look-up table values can be computed efficiently, the computation of the look-up table neighborhood tend to be very time- consuming. By using polytope descriptions of the chamfer disks, the necessary operations to extract the look-up tables are greatly reduced. @inproceedings{normand2008dgci, Title = {Medial Axis {LUT} Computation for Chamfer Norms Using {H}-Polytopes}, Author = {Normand, Nicolas and {\’E}venou, Pierre}, Booktitle = {Discrete Geometry for Computer Imagery}, Editor = {Coeurjolly, David and Sivignon, Isabelle and Tougne, Laure and Dupont, Florent}, Doi = {10.1007/978-3-540-79126-3_18}, Keywords = {Discrete distance, chamfer distance, weighted distance, polytope, medial axis}, Month = apr, Pages = {189-200}, Publisher = {Springer Berlin / Heidelberg}, Series = {Lecture Notes in Computer Science}, Volume = {4992}, Year = {2008}} The original publication is available at www.springerlink.com Medial Axis LUT Computation for Chamfer Norms Using -Polytopes H Nicolas Normand and Pierre Evenou´ [email protected] [email protected] IRCCyN UMR CNRS 6597, Ecole´ polytechnique de l’Universit´ede Nantes, Rue Christian Pauc, La Chantrerie, 44306 Nantes Cedex 3, FRANCE. Abstract. Chamfer distances are discrete distances based on the prop- agation of local distances, or weights defined in a mask. The medial axis, i.e. the centers of the maximal disks (disks which are not contained in any other disk), is a powerful tool for shape representation and analysis. The extraction of maximal disks is performed in the general case with comparison tests involving look-up tables representing the covering re- lation of disks in a local neighborhood. Although look-up table values can be computed efficiently [1], the computation of the look-up table neighborhood tend to be very time-consuming. By using polytope [2] de- scriptions of the chamfer disks, the necessary operations to extract the look-up tables are greatly reduced. 1 Introduction The distance transform DTX of a binary image X is a function that maps each point x with its distance to the background i.e. with the radius of the largest open disk centered in x included in the image. Such a disk is said to be maximal if no other disk included in X contains it. The set of centers of maximal disks, the medial axis, is a convenient description of binary images for many applications ranging from image coding to shape recognition. Its attractive properties are reversibility and (relative) compactness. Algorithms for computing the distance transform are known for various dis- crete distances [3–6]. In this paper, we will focus on chamfer (or weighted) dis- tances. The classical medial axis extraction method is based on the removal of non maximal disks in the distance transform. It is thus mandatory to describe the covering relation of disks, or at least the transitive reduction of this relation. For simple distances this knowledge is summarized in a local maximum criterion [3]. The most general method for chamfer distances uses look-up tables for that purpose [7]. In this paper we propose a method to both compute the look-up tables and the look-up table mask based on geometric properties of the balls of chamfer norms. Basic notions, definitions and known results about chamfer disks and medial axis look-up tables are recalled in section 2. Then section 3 justifies the use of polytope formalism in our context and presents the principles of the method. In section 4, algorithms for the 2D case are given. 2 Chamfer Medial Axis 2.1 Chamfer Distances Definition 1 (Discrete distance, metric and norm). Consider a function d : Zn Zn N and the following properties x, y, z Zn, λ Z: × → ∀ ∈ ∀ ∈ 1. positive definiteness d(x, y) 0 and d(x, y) = 0 x = y , ≥ ⇔ 2. symmetry d(x, y)=d(y, x) , 3. triangle inequality d(x, z) d(x, y)+d(y, z) , ≤ 4. translation invariance d(x + z, y + z)=d(x, y) , 5. positive homogeneity d(λx, λy)= λ d(x, y) . | |· d is called a distance if it verifies conditions 1 and 2,ametric with conditions 1 to 3 and a norm if it also satisfies conditions 4 and 5. Most discrete distances are built from a definition of neighborhood and con- nected paths (path-generated distances), the distance from x to y being equal to the length of the shortest path between the two points [8]. Distance functions differ by the way path lengths are measured: as the number of displacements in the path for simple distances like d4 and d8, as a weighted sum of displace- ments for chamfer distances [4] or by the displacements allowed at each step for neighborhood sequence distances [8, 4], or even by a mixed approach of weighted neighborhood sequence paths [6]. For a given distance d, the closed ball Bc and open ball Bo of center c and radius r are the sets of points of Zn: Bo(c, r)= p : d(c, p) <r . (1) Bc(c, r)={p : d(c, p) r} { ≤ } Since the codomain of d is N: r N,d(c, p) r d(c, p) <r+ 1. So: ∀ ∈ ≤ ⇔ c o r N,B (c, r)=B (c, r + 1) . (2) ∀ ∈ In the following, the notation B will be used to refer to closed balls. Definition 2 (Chamfer mask [9]). A weighting M =(−→v ; w) is a vector −→v of Zn associated with a weight w (or local distance). A chamfer mask is a central-symmetric set of weightings having positive weights and non-nullM dis- n n placements, and containing at least one basis of Z : = Mi Z N∗ 1 i m M { ∈ × } ≤ ≤ The grid Zn is symmetric with respect to the hyperplanes normal to the axes and to the bisectors (G-symmetry). This divides Zn in 2n.n! sub-spaces (8 octants for Z2). Chamfer masks are usually G-symmetric so that weightings may only be given in the sub-space 0 x ... x . ≤ n ≤ ≤ 1 Paths between two points x and y can be produced by chaining displacements. The length of a path is the sum of the weights associated with the displacements and the distance between x and y is the length of the shortest path. n Definition 3 (Chamfer distance [9]). Let = (−→vi ,wi) Z N∗ 1 i m be a chamfer mask. The chamfer (or weighted)M distance{ between∈ two× points} ≤ ≤ x and y is: d(x, y) = min λiwi : x + λi vi = y,λi N, 1 i m . (3) −→ ∈ ≤ ≤ !" " # Any chamfer masks define a metric [10]. However a chamfer mask only generates a norm when some conditions on the mask neighbors and on the corresponding weights permits a triangulation of the ball in influence cones [9, 11]. When a mask defines a norm then all its balls are convex. 2.2 Geometry of the Chamfer Ball We can deduce from (1) and (3) a recursive construction of chamfer balls: B(O, r)=B(O, r 1) B(O + v ,r w ) . (4) − ∪ −→ i − i 0 i m ≤$≤ n Definition 4 (Influence cone [12]). Let = (−→vi ,wi) Z N∗ 1 i m be a chamfer mask generating a norm. An influenceM { cone is∈ a cone× from} ≤ ≤ the origin spanned by a subset of the mask vectors v , v , v ,... in which only the {−→ i −→ j −→ k } weightings Mi,Mj,Mk,... of the mask are involved in the computation of the distance from O to any point of the cone. In each influence cone, the discrete gradient of the distance function is constant and equal to [9]: 1 (w ,w ,w ,...) (v v v ...)− , (5) i j k · −→ i |−→ j |−→ k| where (v v v ...) stands for the column matrix of the vectors spanning the −→ i |−→ j |−→ k| cone. The distance dC (O, p) from the origin to any point p of this cone C is then: 1 d (O, p)=(w ,w ,w ,...) v v v ... − p. (6) C i j k · −→ i −→ j −→ k · % & For instance, with chamfer norm d5,7,11, the point (3, 1) is in the cone spanned by the vectors a = (1, 0) and c = (2, 1) and the weights involved are 5 and 11. The distance between the origin and the point (3, 1) is then: 1 12 − 3 3 d (O, (3, 1)) = 5 11 = 51 = 16 .