mesh processing course : geodesic sampling

42
Geodesic Sampling and Meshing Gabriel Peyré CEREMADE, Université Paris Dauphine http://www.ceremade.dauphine.fr/~peyre/

Upload: gabriel-peyre

Post on 05-Dec-2014

785 views

Category:

Documents


1 download

DESCRIPTION

Slides for a course on mesh processing.

TRANSCRIPT

Page 1: Mesh Processing Course : Geodesic Sampling

Geodesic Sampling and Meshing

Gabriel PeyréCEREMADE, Université Paris Dauphine

http://www.ceremade.dauphine.fr/~peyre/

Page 2: Mesh Processing Course : Geodesic Sampling

Overview

•Riemannian Metrics.

•Riemannian Voronoi and Delaunay.

•Farthest Point Sampling.

•Anisotropic Triangulations.

•Anisotropic Delaunay Refinement.

2

Page 3: Mesh Processing Course : Geodesic Sampling

Riemannian Manifold

3

Riemaniann manifold: abstract parametric spaceM � Rn.Metric: M equiped x ⇥M ⇤� H(x) ⇥ Rn�n positive definite.

Length of a curve �(t) �M: L(�) def.=� 1

0

⇥��(t)TH(�(t))��(t)dt.

W (x)

Examples:Euclidean space: M = Rn and H(x) = Idn.2D shape: M � R2 and H(x) = Id2.Parametric surface: H(x) = Ix first fundamental form.Isotropic metric: H(x) = W (x)Idn, W (x) > 0 weight function.Image processing: I : [0, 1]2 ⇥ R, W (x) = (� + ||⇤xI||)�1.DTI imaging: M = [0, 1]3, H(x) =di�usion tensor.

Page 4: Mesh Processing Course : Geodesic Sampling

Geodesic Distances

4

Geodesic distance metric overM � Rn

⇥ (x, y) �M2, dM(x, y) def.= minT>0,��PT (x,y)

L(�)

where PT (x, y) def.= {� \ �(0) = x and �(T ) = y} .

Geodesic curve: �(t) such that L(�) = dM(x, y).Distance map to a starting point x0 �M: Ux0(x) def.= dM(x0, x).

met

ric

geod

esic

s

2 ECCV-08 submission ID 1057

Euclidean Shape Isotropic Anisotropic Surface

Fig. 1. Examples of Riemannian metrics (top row) and geodesic distances and curves(bottom row). The blue/red colormap indicates the geodesic distance to the startingpoint. From left to right: euclidean (H(x) = Id2 restricted to � = [0, 1]2), planardomain (H(x) = Id2 restricted to � �= [0, 1]2), isotropic (H(x) = W (x)Id2 with Wcomputed from the image), Riemannian manifold metric (H(x) is the structure tensorof the image, see equation (8)) and 3D surface (H(x) corresponds to the first funda-mental form).

1.1 Riemannian Metric and Geodesic Distance40 40

This paper considers 2D Riemannian manifolds that are defined over a com-pact planar domain � � R2. At each point x ⇤ �, one has a tensor H(x) ⇤ R2�2

which is a positive symmetric matrix. This tensor field defines a local metric thatallows to measure the length of a piecewise smooth curve ⇥ : [0, 1]⇥ � as follows

L(⇥) def.=� 1

0

⇥⇥⇥(t)TH(⇥(t))⇥⇥(t)dt.

In image processing and computer vision, the manifold is often the image domain41 41

� = [0, 1]2 equipped with a metric H derived from the image f to process. In42 42

computer graphics and numerical analysis, one often deals with complicated43 43

planar domains � with holes and corners. Figure 1 shows some examples of44 44

Riemannian metrics.45 45

An important issue is thus to design, for a specific application, a tensor46 46

field H(x) that encodes the important information about the problem to solve.47 47

Sections 3 and 4 show computer vision and graphics applications where the48 48

tensor field is derived either from a background image or from some user input.49 49

At each location x ⇤ �, the Riemannian tensor can be diagonalized50 50

H(x) = ⇤1(x)e1(x)e1(x)T + ⇤2(x)e2(x)e2(x)T with 0 < ⇤1 � ⇤2, (1)

and e1, e2 are two orthogonal (un-oriented) eigenvector fields. A curve ⇥ passing51 51

at location ⇥(t) = x with speed ⇥⇥(t) has a shorter local length if ⇥⇥(t) is collinear52 52

to e1(x) rather than to another direction. Hence shortest paths (to be defined53 53

next) tends to be tangent to the direction field e1.54 54

Page 5: Mesh Processing Course : Geodesic Sampling

Overview

•Riemannian Metrics.

•Riemannian Voronoi and Delaunay.

•Farthest Point Sampling.

•Anisotropic Triangulations.

•Anisotropic Delaunay Refinement.

5

Page 6: Mesh Processing Course : Geodesic Sampling

Euclidean Delaunay Triangulation

6

Delaunay graph DS : (xi, xj) ⇤ DS �⇥ Ci ⌃ Cj ⌅= ⇧.

Page 7: Mesh Processing Course : Geodesic Sampling

Euclidean Voronoi Segmentation

7

Page 8: Mesh Processing Course : Geodesic Sampling

Euclidean Delaunay Triangulation

8

Delaunay graph DS : (xi, xj) ⇤ DS �⇥ Ci ⌃ Cj ⌅= ⇧.

Page 9: Mesh Processing Course : Geodesic Sampling

Geodesic Voronoi and Delaunay

9

Voronoi segmentation:

Outer cell: C0 = Closure(�c).

Delaunay graph DS : (xi, xj) ⇤ DS �⇥ Ci ⌃ Cj ⌅= ⇧.

Page 10: Mesh Processing Course : Geodesic Sampling

Voronoi Diagrams on Surfaces

10

Page 11: Mesh Processing Course : Geodesic Sampling

Double and Triple Points

11

S large enough =� DS is a planar triangulation.

Tripple point: si,j,k � Ci ⇥ Cj ⇥ Ck.

Double point: wi,j = argminx�Ci⇥Cj

d(x, xi).

Geometric realization of DS :

xj

xkxi

si,j,k

wi,j

Union of two geodesics starting from wi,j .

Special case: boundary curves if xi � � and xj � �.

Fast computation in O(n log(n))with Fast Marching.

Page 12: Mesh Processing Course : Geodesic Sampling

Anisotropic Voronoi Segmentation

12

ECCV-08 submission ID1057 7

f

� = .1 � = .2 � = .5 � = 1

Fig. 4. Examples of anisotropic distances (top row) and Voronoi diagrams (bottomrow) with an decreasing anisotropy �. The metric tensor is computed using the structuretensor, equation (8).

curves to the whole domain. This metric helps to disambiguates di⇥cult situa-153 153

tions where some curves are close from one to each other. This allows a better154 154

reconstruction with less user intervention.155 155

The idea of using anisotropic information to perform perceptual grouping156 156

is introduced in [9] where the completed contours are local minimizers of a157 157

saliency field. Many variational definitions of perceptual contours have been158 158

proposed using local regularity assumption, for instance with the ellastica model159 159

of Mumford [10]. In contrast, our completed contours are anisotropic shortest160 160

paths that connect Riemannian Voronoi cells, thus being the global minimum of161 161

a length criterion.162 162

3.1 Design of an Anisotropic Tensor Field163 163

The Riemannian metric H(x) needs to be computed from the noisy input164 164

image f . In order to compute robustly the local direction of the features, we165 165

use a local pooling of the gradient information that constitutes a sparse set of166 166

tensors with a confidence measure. This sparse tensor field is then integrated by167 167

di�usion into a dense field.168 168

Structure Tensor. The local orientation of a feature around a pixel x is given169 169

by the vector orthogonal to the gradient v(x) = (⇥xf)�, which is computed170 170

numerically with finite di�erences (using maybe some little smoothing to cancel171 171

noise). This local direction information can be stored in a rank-1 tensor T0(x) =172 172

v(x)v(x)T. In order to evaluate the local anisotropy of the image, one needs to173 173

average this tensor174 174

T (x) = T0 �G�(x) (8)

where the 4 entries of the tensor are smoothed against a gaussian kernel G� of175 175

width � > 0. The metric H corresponds to the so-called structure tensor, see176 176

for instance [11]. This local tensor T is able to extract both the local direction177 177

� = .5 � = 0� = .95 � = .7

Distances

Voronoi

Page 13: Mesh Processing Course : Geodesic Sampling

Overview

•Riemannian Metrics.

•Riemannian Voronoi and Delaunay.

•Farthest Point Sampling.

•Anisotropic Triangulations.

•Anisotropic Delaunay Refinement.

13

Page 14: Mesh Processing Course : Geodesic Sampling

Coverings and Packings

14

Page 15: Mesh Processing Course : Geodesic Sampling

Geodesic Delaunay and Voronoi

15

�xi

xi,jxk

x�

xi,j,k

xi,j,�xj

Page 16: Mesh Processing Course : Geodesic Sampling

Farthest Point Sampling

16

Surface sampling {x1, . . . , xn} �M.

Parametric domain sampling: � : [0, 1]2 ⇥�M, xi,j = �(i/⇤

n, j/⇤

n).

�-covering:�

i B�(xi) = M, where B�(x) def.= {y \ dM(x, y) � �}.

Theorem: The sampling {x1, . . . , xn} is an �-covering that is �-separated for

� = maxi=1,...,n

minj=1,...,n

dM(xi, xj).

1. Initialization: x1 �random, d(x)� dM(x0, x), set i = 1.2. Select point: xi+1 = argmaxx d(x), � = d(xi+1).3. Local update of the distance: d(x)� min(d(x), dM(xi+1, x)).4. Stop: If i < n or � > �0, set i� i + 1 and go back to 2.Fa

rthe

stpo

int

�-separated: min(dM(xi, xj)) � �.

Page 17: Mesh Processing Course : Geodesic Sampling

Farthest Point Sampling

17

# samplesMetric

W (x)

W (x)

W (x) small =� front moves slowly,=� denser sampling.

W (x)

Page 18: Mesh Processing Course : Geodesic Sampling

Farthest Point Triangulation

18# samples

Page 19: Mesh Processing Course : Geodesic Sampling

Meshing a Planar Shape

19

Uni

form

Ada

ptiv

e

Page 20: Mesh Processing Course : Geodesic Sampling

Uniform Remeshing

20

Page 21: Mesh Processing Course : Geodesic Sampling

Remeshing of the David

21

Original:100k vert.

Remeshed:10k vert.

Page 22: Mesh Processing Course : Geodesic Sampling

Adaptive Remeshing

22

# samples

Page 23: Mesh Processing Course : Geodesic Sampling

Density Given by a Texture

23

Parameterized surface: � : D � [0, 1]2 ⇥ S � R3.

Texture: I = [0, 1]2 � R.

||���1(p)I||

⇥ p � S, W (p) = (� + ||⇤��1(p)I||)�1

W = 1 � large � small

I(��1(p))

Page 24: Mesh Processing Course : Geodesic Sampling

Curvature of a Height field

24

Height field: x ⇥ [0, 1]2 � (x, f(x)) ⇥ R3.

f(x + h) = f(x) + �⇤xf, h⇥ + �Hx(f)h, h⇥ + O(||h||2)

f(x + h)� (f(x) + ⇥⌅xf, h⇤) = µ1⇥h, e1⇤2 + µ2⇥h, e2⇤2 + O(h2).

Hx = µ1e1e1T + µ2e2e2

T with |µ1| > |µ2|.

Gaussian curvature: µ1(x)µ2(x) = det(Hx(f)).

Mean curvature: (µ1(x) + µ2(x))/2 = tr(Hx(f))/2.

Total curvature: |µ1(x)| + |µ2(x)|.

Intrinsic

Extrinsic

e1(x)

e2(x)

x

Page 25: Mesh Processing Course : Geodesic Sampling

Curvature of a Surface

25

Numerical estimation:• polynomial fit.• local covariance analysis.

Hx =��⇥2�(x)⇥xi⇥xj

, n(x)⇥⇥

i,j=1,2Second fundamental form:

Normal: n = ⇥�⇥x1

� ⇥�⇥x2

/������ ⇥�⇥x1

� ⇥�⇥x2

������.

Parametric surface: x ⇥ R2 ⇤� �(x) ⇥ R3.

|µ1(x)| + |µ2(x)|.

Page 26: Mesh Processing Course : Geodesic Sampling

Edge-aware Remeshing

26Original mesh W = 1 Small �

W (x) = (� + |µ1(x)| + |µ2(x)|)�1Curvature-driven metric:

Page 27: Mesh Processing Course : Geodesic Sampling

Overview

•Riemannian Metrics.

•Riemannian Voronoi and Delaunay.

•Farthest Point Sampling.

•Anisotropic Triangulations.

•Anisotropic Delaunay Refinement.

27

Page 28: Mesh Processing Course : Geodesic Sampling

Anisotropy is Important

28

Better respect of features.Better approximation of functions.

8 Jonathan Richard Shewchuk

Figure 2: A visual illustration of how large angles, but not small angles, can cause the error !f " !g toexplode. In each triangulation, 200 triangles are used to render a paraboloid.

35

50

65

40 20

20

4040

40

20

Figure 3: As the large angle of the triangle approaches 180!, or the sliver tetrahedron becomes arbitrarilyflat, the magnitude of the vertical component of !g becomes arbitrarily large.

sphere, then perturbing one of the vertices just off the equator so that the sliver has some (but not much)

volume.

Because of this sensitivity, mesh generators usually choose the shapes of elements to control !"f #"g!!, and not !f # g!!, which can be reduced simply by using smaller elements. Section 6.1 presentsquality measures that judge the shape of elements based on their fitness for interpolation.

Table 2 gives two upper bounds on !"f #"g!! over a triangle. The first upper bound is almost tight,

to within a factor of two. The “weaker but simpler upper bound” of 3ctrcirc is not as good an indicator as

the stronger upper bound, but it has the advantages of being smooth almost everywhere (and therefore more

amenable to numerical optimization) and faster to compute. The weaker upper bound is tight to within a

factor of three: for any triangle t, there is a function f such that !"f #"g!! = ctrcirc.

These bounds are interesting because the two-dimensional Delaunay triangulation minimizes the max-

Isotropic Anisotropic, Anisotropic,bad shape good shape

f(x + h) = f(x) + �⇤xf, h⇥ + �Hx(f)h, h⇥ + O(||h||2)

f(x + h)� (f(x) + ⇥⌅xf, h⇤) = µ1⇥h, e1⇤2 + µ2⇥h, e2⇤2 + O(h2).

=� Local optimal shape:

Hx = µ1e1e1T + µ2e2e2

T with |µ1| > |µ2|.

width/length =�

|µ2|/|µ1|

x

e1

� ⇥µ2� ⇥µ1

Page 29: Mesh Processing Course : Geodesic Sampling

Approximation of Images with Edges

29

9.4. Geometric Image Approximation 5

where conv(tj) is the convex envelop of the vertices in tj .The piecewise linear interpolation �fM of f on (V, T ) is such that �fM (xi) = f(xi) and �fM is

linear on each triangular face tj . This is a two-dimensional extension of the spline approximationsstudied in Section ??. This piecewise linear approximation depends on the position of the verticesV and the connectivity T of the triangulation. In order to e⇥ciently approximate a given functionf with M triangles, one needs to find the optimal shape of the triangles.

For a geometrically regular image f , that is C2 outside C2 edges, one can however built anadapted triangulation that enhances significantly the approximation performance of a waveletbasis. The following theorem sketch the construction of such a triangulation.

f ! hf

Figure 9.2: Approximation with finite elements on a triangulation for a function without and withadditional blurring.

Theorem 2. If f is C2 outside a set of C2 contours, then it exists a constant C such that forany M , it exists an adapted triangulation (V, T ) over which the piecewise-linear interpolation �fM

satisfies||f � �fM ||2 � C M�2. (9.2)

Proof. We give here only a sketch of the proof. [todo : show an image of the tubes] Near an edges,the lengths of the triangles should be of order M�1 and their widths should be of order M�2. Wedefine a thin band � of width M�2 around all the edge curves, see figure ??. Since the edge curve areC2, this band can be sub-divided in elongated tubes of length proportional to M�1, each of witch isdecomposed in two elongated triangles. The number of such triangle is 2LM where L is the total lengthof the edges in the image. A special care should be taken near edge corner or edge crossings but weignore these technicalities here. Over these tubes, the function is bounded and thus the approximationerror ||f � ef ||2L2(�) in the tubes is of the order of area(�)||f ||2⇥ = LM�2||f ||2⇥. In the complementary

of the tubes �c, one packs M large equilateral triangles of edge lengths approximatively ⌃ ⇥ M�1/2.Since f is C2 outside the edge curve, the approximation error of a linear interpolation ef over suchtriangles is ||f � ef ||⇥(�c � ||f ||C�⌃2 and thus the error satisfies

||f � ef ||2 = O(LM�2||f ||2⇥ + ||f ||2C�M�2).

M!1

M!2

M!1

M!!

Figure 9.3: Finite elements for the approximation around a singularity curve.

This theorem shows that an adapted triangulation should balance the approximation errorinside and outside the singularity curves. The triangles located far away from these singularitiesshould be large and isotropic, while triangles that cover the edges should be stretched along thesingularity curves. This construction can be generalized by replacing triangles by higher ordergeometric primitives whose boundaries are polynomial curves of degree �, as shown on the rightside of figure ??. The adapted approximation using polynomials defined on M such higher order

9.4. Geometric Image Approximation 5

where conv(tj) is the convex envelop of the vertices in tj .The piecewise linear interpolation ⇥fM of f on (V, T ) is such that ⇥fM (xi) = f(xi) and ⇥fM is

linear on each triangular face tj . This is a two-dimensional extension of the spline approximationsstudied in Section ??. This piecewise linear approximation depends on the position of the verticesV and the connectivity T of the triangulation. In order to e⇥ciently approximate a given functionf with M triangles, one needs to find the optimal shape of the triangles.

For a geometrically regular image f , that is C2 outside C2 edges, one can however built anadapted triangulation that enhances significantly the approximation performance of a waveletbasis. The following theorem sketch the construction of such a triangulation.

f ! hf

Figure 9.2: Approximation with finite elements on a triangulation for a function without and withadditional blurring.

Theorem 2. If f is C2 outside a set of C2 contours, then it exists a constant C such that forany M , it exists an adapted triangulation (V, T ) over which the piecewise-linear interpolation ⇥fM

satisfies||f � ⇥fM ||2 � C M�2. (9.2)

Proof. We give here only a sketch of the proof. [todo : show an image of the tubes] Near an edges,the lengths of the triangles should be of order M�1 and their widths should be of order M�2. Wedefine a thin band � of width M�2 around all the edge curves, see figure ??. Since the edge curve areC2, this band can be sub-divided in elongated tubes of length proportional to M�1, each of witch isdecomposed in two elongated triangles. The number of such triangle is 2LM where L is the total lengthof the edges in the image. A special care should be taken near edge corner or edge crossings but weignore these technicalities here. Over these tubes, the function is bounded and thus the approximationerror ||f � ef ||2L2(�) in the tubes is of the order of area(�)||f ||2⇤ = LM�2||f ||2⇤. In the complementary

of the tubes �c, one packs M large equilateral triangles of edge lengths approximatively � ⇤ M�1/2.Since f is C2 outside the edge curve, the approximation error of a linear interpolation ef over suchtriangles is ||f � ef ||⇤(�c � ||f ||C��2 and thus the error satisfies

||f � ef ||2 = O(LM�2||f ||2⇤ + ||f ||2C�M�2).

M!1

M!2

M!1

M!!

Figure 9.3: Finite elements for the approximation around a singularity curve.

This theorem shows that an adapted triangulation should balance the approximation errorinside and outside the singularity curves. The triangles located far away from these singularitiesshould be large and isotropic, while triangles that cover the edges should be stretched along thesingularity curves. This construction can be generalized by replacing triangles by higher ordergeometric primitives whose boundaries are polynomial curves of degree �, as shown on the rightside of figure ??. The adapted approximation using polynomials defined on M such higher order

9.4. Geometric Image Approximation 7

As already seen in the proof of theorem ??, one can design triangles of width and legnth M�1/2 outsidethe tube so that the error in this area is also of the order of M�2, which concludes the proof.

The proof of this theorem shows that when an image is smoothed by an unknown kernel ofwidth ⇤, the triangulation should depend on ⇤ in order to get a fast decay of the approximationerror. To reach an error decay of O(M�2), in the neighborhood of a contour smoothed by a kernelof width ⇤, the triangle should have a length of order ⇤1/4M�1/2 and a width of order ⇤3/4M�1/2,as shown on figure ??. The scale ⇤ is most of the time unknown and one thus needs an automaticalgorithm to devise the size of the triangles.

s1/ 4

M1/ 2

triangless1/ 4

M!1/ 2

s3/ 4

M!1/ 2

Figure 9.4: Aspect ratio of triangles for the approximation of a blurred contour.

This shows that locally, an optimal triangle should be aligned with the direction µ where thefunction is the most regular. The local behavior of a smooth C2 image is well described up tosecond order by a quadratic approximation

f(x + h) = f(x) + ⌅⌥xf, h⇧+ ⌅Hx(f)h, h⇧+ O(||h||2)

where Hx(f) ⇤ R2⇥2 is the symmetric Hessian tensor of second derivative. If one denote by (e1, e2)the orthonormal eigenvectors of Hx(f) and |�1| � |�2| the corresponding eigenvalues, one has

f(x + h)� (f(x) + ⌅⌥xf, h⇧) = �1⌅h, e1⇧2 + �2⌅h, e2⇧2 + O(h2).

A triangle adapted to the linear approximation of f around x should thus be aligned with thedirection e1, and its shape should obey a scaling width/length =

⇤|�2|/|�1|, in order to equally

balance the approximation error on each direction e1 and e2. This corresponds exactly to thestrategy employed in the proof of theorem ??, where equation (??) gives a bound on the secondderivative of a smoothed geometrically regular function.

This local optimal shape of triangles is well known in the field of finite element approximation,and Babuska and A. K. Aziz [?] where the first to notice the importance of this anisotropic scalingof the triangles. This notion of anisotropic triangulation is of primarily importance to capture withfinite element approximation the solution of equations that create anisotropic regularity [?]. Oneshould however note that this optimality of anisotropic triangulation is purely based on minimizingthe error of approximation, and in many cases, other criterion should be enforced as well. Forinstance, in order to well approximate the gradient, the triangles should not only be stretched,but also should not have large angles [?]. Furthermore, in order to solve some partial di⇥erentialequations (in particular elliptic one like Poisson �f = g), the triangle should be as isotropic aspossible to avoid that the conditioning become to large and the problem ill-posed [?].

Instead of searching for the optimal triangulation to approximate a given function, most existingalgorithm employs greedy strategies that iteratively construct a triangulation by optimizing at eachstep the approximation error. They can be classified in two main families:

Delaunay refinement algorithms [?, ?, ?]: proceed by iteratively inserting point in order toimprove the quality of the triangulation. In order to optimize the shape of the triangles, eachpoint is added at a circumcenter of one triangle, and should be chosen in order to reduce as muchas possible the approximation error. These algorithm have theoretical grantees in terms of shapeof the triangle and can be used to produce isotropic triangulation of images where the size ofthe triangle varies in order to match the local regularity of the image. Extension of these vertexinsertion methods allows to capture anisotropic regularity by locally modifying the notion of

9.4. Geometric Image Approximation 5

where conv(tj) is the convex envelop of the vertices in tj .The piecewise linear interpolation ⇥fM of f on (V, T ) is such that ⇥fM (xi) = f(xi) and ⇥fM is

linear on each triangular face tj . This is a two-dimensional extension of the spline approximationsstudied in Section ??. This piecewise linear approximation depends on the position of the verticesV and the connectivity T of the triangulation. In order to e⇥ciently approximate a given functionf with M triangles, one needs to find the optimal shape of the triangles.

For a geometrically regular image f , that is C2 outside C2 edges, one can however built anadapted triangulation that enhances significantly the approximation performance of a waveletbasis. The following theorem sketch the construction of such a triangulation.

f ! hf

Figure 9.2: Approximation with finite elements on a triangulation for a function without and withadditional blurring.

Theorem 2. If f is C2 outside a set of C2 contours, then it exists a constant C such that forany M , it exists an adapted triangulation (V, T ) over which the piecewise-linear interpolation ⇥fM

satisfies||f � ⇥fM ||2 � C M�2. (9.2)

Proof. We give here only a sketch of the proof. [todo : show an image of the tubes] Near an edges,the lengths of the triangles should be of order M�1 and their widths should be of order M�2. Wedefine a thin band � of width M�2 around all the edge curves, see figure ??. Since the edge curve areC2, this band can be sub-divided in elongated tubes of length proportional to M�1, each of witch isdecomposed in two elongated triangles. The number of such triangle is 2LM where L is the total lengthof the edges in the image. A special care should be taken near edge corner or edge crossings but weignore these technicalities here. Over these tubes, the function is bounded and thus the approximationerror ||f � ef ||2L2(�) in the tubes is of the order of area(�)||f ||2⇤ = LM�2||f ||2⇤. In the complementary

of the tubes �c, one packs M large equilateral triangles of edge lengths approximatively � ⇤ M�1/2.Since f is C2 outside the edge curve, the approximation error of a linear interpolation ef over suchtriangles is ||f � ef ||⇤(�c � ||f ||C��2 and thus the error satisfies

||f � ef ||2 = O(LM�2||f ||2⇤ + ||f ||2C�M�2).

M!1

M!2

M!1

M!!

Figure 9.3: Finite elements for the approximation around a singularity curve.

This theorem shows that an adapted triangulation should balance the approximation errorinside and outside the singularity curves. The triangles located far away from these singularitiesshould be large and isotropic, while triangles that cover the edges should be stretched along thesingularity curves. This construction can be generalized by replacing triangles by higher ordergeometric primitives whose boundaries are polynomial curves of degree �, as shown on the rightside of figure ??. The adapted approximation using polynomials defined on M such higher order

Sharp edges Blurred edges

Sharp edges Blurred edges

Page 30: Mesh Processing Course : Geodesic Sampling

Metric Design for Anisotropic Meshing

30Bossen−Heckbert [1996]Shimada−Yamada−Itoh [1997]

George−Borouchaki [1998]Li−Teng−Üngör [1999]

Generating Anisotropic MeshesHeuristic Algorithms for

x

�2(x)�1(x)

e1(x)Local orientation: e1(x).

Local shape: �1(x)/�2(x).

Idea: design the metric H(x).

Page 31: Mesh Processing Course : Geodesic Sampling

Image Approximation

31

Garland & Heckbert, Approximation of Terrains 19

Figure 16: Mandrill original, a 200!200 raster image. Figure 17: Mandrill approximated with Gouraud

shaded triangles created by subsampling on a uniform

20!20 grid (400 vertices).

Figure 18: Mandrill approximated with Gouraud

shaded triangles created by data-dependent greedy in-

sertion (400 vertices).

Figure 19: Mesh for the image to the left.

Garland & Heckbert, Approximation of Terrains 19

Figure 16: Mandrill original, a 200!200 raster image. Figure 17: Mandrill approximated with Gouraud

shaded triangles created by subsampling on a uniform

20!20 grid (400 vertices).

Figure 18: Mandrill approximated with Gouraud

shaded triangles created by data-dependent greedy in-

sertion (400 vertices).

Figure 19: Mesh for the image to the left.

Original image Isotropic mesh (400 vert)

Anisotropic mesh (400 vert)

Page 32: Mesh Processing Course : Geodesic Sampling

Image Compression

32

16 L. Demaret, N. Dyn, M.S. Floater, A. Iske

(a) (b)

(c) (d)

Fig. 8. Reflex. (a) Original image of size 128!128. Compression at 0.251 bpp andreconstruction by (b) SPIHT with PSNR 30.42 db, (d) AT!

2 with PSNR 41.73 db.(c) The Delaunay triangulation of the 384 most significant pixels output by AT2.

Moreover, the reconstruction by AT!2 provides also a superior visual quality

to that of the reconstructed image by SPIHT, see Figures 8 (b),(d). Indeed,our compression scheme AT!

2 manages to localize the sharp edges of the testimage Reflex. Moreover, it avoids undesired oscillations around the edges,unlike SPIHT. This is due to the well-adapted distribution of the 384 mostsignificant pixels, output by the adaptive thinning algorithm AT2, whose De-launay triangulation is displayed in Figure 8 (c).

We have recorded the results of this example, along with those of thefollowing test case, in Table 1.

A Popular Test Case of a Real Image

We considered also applying our compression scheme AT!2 to one popular test

case of a real image, called Fruits, which is also used as a standard test casein the textbook [22]. The original image Fruits, of size 512!512, is displayedin Figure 9.

16 L. Demaret, N. Dyn, M.S. Floater, A. Iske

(a) (b)

(c) (d)

Fig. 8. Reflex. (a) Original image of size 128!128. Compression at 0.251 bpp andreconstruction by (b) SPIHT with PSNR 30.42 db, (d) AT!

2 with PSNR 41.73 db.(c) The Delaunay triangulation of the 384 most significant pixels output by AT2.

Moreover, the reconstruction by AT!2 provides also a superior visual quality

to that of the reconstructed image by SPIHT, see Figures 8 (b),(d). Indeed,our compression scheme AT!

2 manages to localize the sharp edges of the testimage Reflex. Moreover, it avoids undesired oscillations around the edges,unlike SPIHT. This is due to the well-adapted distribution of the 384 mostsignificant pixels, output by the adaptive thinning algorithm AT2, whose De-launay triangulation is displayed in Figure 8 (c).

We have recorded the results of this example, along with those of thefollowing test case, in Table 1.

A Popular Test Case of a Real Image

We considered also applying our compression scheme AT!2 to one popular test

case of a real image, called Fruits, which is also used as a standard test casein the textbook [22]. The original image Fruits, of size 512!512, is displayedin Figure 9.

Original image Wavelets @.25bpp

Triangulation @.25bpp

Page 33: Mesh Processing Course : Geodesic Sampling

Overview

•Riemannian Metrics.

•Riemannian Voronoi and Delaunay.

•Farthest Point Sampling.

•Anisotropic Triangulations.

•Anisotropic Delaunay Refinement.

33

Page 34: Mesh Processing Course : Geodesic Sampling

Planar Domains

34

ECCV-08 submission ID1057 5

Fig. 3. Examples of anisotropic front propagation (from 9 starting points). The col-ormap indicates the values of the distance functions at a given iteration of the algorithm.The metric is computed using the structure tensor, equation (8), of the texture f shownin the background.

2 Computational Geometry with Riemannian Metric104 104

This section, shows how several tools from computational geometry extend105 105

to the setting of a Riemannian metric.106 106

Starting from a set of points S = {xi}mi=1, one can define graphs and trian-107 107

gulations that reflect the geometry of the Riemannian manifold. These points108 108

and the corresponding graphs are the basic building blocks of the algorithms for109 109

perceptual grouping and planar domain meshing.110 110

In the following, the boundary ⇧� of � isassumed to be a set of closed smooth curves.At least one point of S is located on eachcurve, and these boundary points segment⇧� as a set of sub-curves

⇧� =⇥

i,j

⇥i,j with�

⇥i,j ⇤ P(xi, xj)⇥i,j ↵ S = {xi, xj}.

(one can have xi = xj if there is only onepoint on a curve).

!

!c

x1x2

x3

x4

111 111

2.1 Delaunay and Voronoi Graphs112 112

The segmentation of the domain � in Riemannian Voronoi cells is113 113

� = C0

xi�SCi where Ci = {x ⇤ � \ ⇧ j ⌅= i, d(xi, x) � d(xj , x)} . (7)

The outer Voronoi cell is defined as C0 = Closure(�c).114 114

The Delaunay graph DS of S is a graph where two points are connected iftheir respective Voronoi cells are adjacent

(xi, xj) ⇤ DS �⇥ Ci ↵ Cj ⌅= ⌃.

To each Delaunay edge (xi, xj) ⇤ DS corresponds a double point wi,j , which isthe closest point to xi and xj on the common Voronoi cell boundary

wi,j = argminx�Ci⌅Cj

d(x, xi).

ECCV-08 submission ID1057 11

if a point xk is located too close to the boundary. A boundary sub-curve �i,j is245 245

said to be encroached by xk � S if it exists a triple point wi,k,0 � �i,j , see figure246 246

7. Such an encroached edge cannot be part of the Delaunay triangulation, and247 247

is automatically split by the algorithm by inserting a mid point. Similarly, triple248 248

points are not added if they encroach any boundary sub-curve (the sub-curve is249 249

subdivided instead).250 250

Another di⇥culty is that the Delaunay graph DS of S is not necessarily a251 251

valid triangulation if the sampling S is not dense enough, see [7]. This is because252 252

of some isolated point, that is connected to only one other point of S in DS .253 253

The algorithm automatically add points on the Voronoi cell boundary of such a254 254

point.255 255

x1 x2x3x1 x2

x3

Fig. 7. Left: the vertex x3 encroaches the boundary curve ⇥1,2. Right: the vertex x3

does not encroach anymore because (x1, x2) is a Delaunay edge.

Table 2 details this algorithm. A bound ⇥⇥ on ⇥ enforces the refinement to256 256

reach some quality criterion, while a bound U⇥ enforces a uniform refinement to257 257

match some desired triangle density.258 258

1. Initialization: set S with at least one point on each curve of �, compute US witha Fast Marching.

2. Boundary enforcement: while it exists ⇥i,j � ⌃� encroached by some xk ⇤ S,subdivide: S ⇥ S ⌃ argmax

x⇤⇤i,j

US(x). Update US with a local Fast Marching.

3. Triangulation enforcement: while it exists (xi, xj) ⇤ DS with xi or xj isolated,insert w⇥ = argmax

w⇤Ci⇧Cj

d(xi, w).

4. Select point: s⇧ ⇥ argmins⇤�S�⌃⇥

⇤(s).

– If in S ⌃ {s⇧}, s⇧ encroaches some ⇥i,j � ⌃�, subdivide: S ⇥ S ⌃ argmaxx⇤⇤i,j

US(x).

– Otherwise, add it: S ⇥ S ⌃ s⇧.Update US with a local Fast Marching.

5. Stop: while ⇤(s⇧) > ⇤⇧ or US(s⇧) > U⇧, go back to 2.

Table 2: Anisotropic planar domain meshing algorithm.

ECCV-08 submission ID1057 11

if a point xk is located too close to the boundary. A boundary sub-curve �i,j is245 245

said to be encroached by xk � S if it exists a triple point wi,k,0 � �i,j , see figure246 246

7. Such an encroached edge cannot be part of the Delaunay triangulation, and247 247

is automatically split by the algorithm by inserting a mid point. Similarly, triple248 248

points are not added if they encroach any boundary sub-curve (the sub-curve is249 249

subdivided instead).250 250

Another di⇥culty is that the Delaunay graph DS of S is not necessarily a251 251

valid triangulation if the sampling S is not dense enough, see [7]. This is because252 252

of some isolated point, that is connected to only one other point of S in DS .253 253

The algorithm automatically add points on the Voronoi cell boundary of such a254 254

point.255 255

x1 x2x3x1 x2

x3

Fig. 7. Left: the vertex x3 encroaches the boundary curve ⇥1,2. Right: the vertex x3

does not encroach anymore because (x1, x2) is a Delaunay edge.

Table 2 details this algorithm. A bound ⇥⇥ on ⇥ enforces the refinement to256 256

reach some quality criterion, while a bound U⇥ enforces a uniform refinement to257 257

match some desired triangle density.258 258

1. Initialization: set S with at least one point on each curve of �, compute US witha Fast Marching.

2. Boundary enforcement: while it exists ⇥i,j � ⌃� encroached by some xk ⇤ S,subdivide: S ⇥ S ⌃ argmax

x⇤⇤i,j

US(x). Update US with a local Fast Marching.

3. Triangulation enforcement: while it exists (xi, xj) ⇤ DS with xi or xj isolated,insert w⇥ = argmax

w⇤Ci⇧Cj

d(xi, w).

4. Select point: s⇧ ⇥ argmins⇤�S�⌃⇥

⇤(s).

– If in S ⌃ {s⇧}, s⇧ encroaches some ⇥i,j � ⌃�, subdivide: S ⇥ S ⌃ argmaxx⇤⇤i,j

US(x).

– Otherwise, add it: S ⇥ S ⌃ s⇧.Update US with a local Fast Marching.

5. Stop: while ⇤(s⇧) > ⇤⇧ or US(s⇧) > U⇧, go back to 2.

Table 2: Anisotropic planar domain meshing algorithm.

2D Riemannian manifold: � � [0, 1]2 equipped with H(x) ⇥ R2�2.

Boundaries:

⇥� =⇥

i,j

�i,j with�

�i,j � P(xi, xj)�i,j ⇥ S = {xi, xj}.

Requirement: �� � DS .

Good situation Bad: x3 encroaches �1,2

Page 35: Mesh Processing Course : Geodesic Sampling

Face and Edge Splitting

35

Voronoi edge

Delaunay edgeMissing boundary x3 � x4

Bad quality triangle (x1, x2, x3)

Page 36: Mesh Processing Course : Geodesic Sampling

Riemannian Delaunay Refinement

36

10 ECCV-08 submission ID 1057

Image f Isotropic DS Anisotropic DS

Dense metric T d(x) Isotropic grouping Anisotropic grouping

Fig. 6. Comparison of isotropic and anisotropic Riemannian metric for perceptualgrouping.

Anisotropic meshes can be built using a local modification of the metric [?]228 228

or anisotropic elastic forces [?] and bubble packing [?]. In order to incorporate229 229

global constraints within a provably correct Delaunay refinement scheme, La-230 230

belle and Shewchuk propose in [?] to use the anisotropic distance d(x, y)2 =231 231

(x� y)TH(x)(x� y). This is a simplified anisotropic metric not based on short-232 232

est paths. Several issues arise with such a definition. It is not symmetric and233 233

the Voronoi diagram might not be connected. However it can be used in con-234 234

junction with Ruppert’s Delaunay refinement algorithm to provide anisotropic235 235

triangulation with guaranties on the aspect ratio of the triangles. This algorithm236 236

is extended in 3D by [?] and to domains with curves by [?]. The simplified dis-237 237

tance d has been applied to image sampling [?], optimal samples placement with238 238

centroidal tesselations [?] and surface remeshing [?].239 239

Anisotropic geodesic meshing. We propose a new Delaunay refinement al-240 240

gorithm that extends the algorithm of Ruppert [?] with Riemannian metrics.241 241

It extends the isotropic farthest point seeding strategy of [?] with anisotropic242 242

metrics and domains with arbitrary boundaries.243 243

Our anisotropic meshing algorithm proceeds by iteratively inserting a triplepoint si,j,k ⇥ �S to an already computed set of points S. In order to computean anisotropic mesh with triangles of high quality with respect to the localmetric, one inserts si,j,k for a Delaunay triangle (xi, xj , xk) with the smallestcircumradius to shortest edge ratio

⇥(si,j,k) =d(si,j,k, xi)

min(d(xi, xj), d(xj , xk), d(xk, xi)),

which is a quantity computed for each triple point in parallel to the Fast March-244 244

ing propagation. In the Euclidean domain, a triangle (xi, xj , xk) with a low value245 245

of ⇥(si,j,k) is badly shaped since its smallest angle is close to 0 . As explained in246 246

[?], this property extends to an anisotropic metric H(x) if angles are measured247 247

using the inner product defined by H(x).248 248

� = circumradiusshortest edge

ECCV-08 submission ID1057 11

if a point xk is located too close to the boundary. A boundary sub-curve �i,j is245 245

said to be encroached by xk � S if it exists a triple point wi,k,0 � �i,j , see figure246 246

7. Such an encroached edge cannot be part of the Delaunay triangulation, and247 247

is automatically split by the algorithm by inserting a mid point. Similarly, triple248 248

points are not added if they encroach any boundary sub-curve (the sub-curve is249 249

subdivided instead).250 250

Another di⇥culty is that the Delaunay graph DS of S is not necessarily a251 251

valid triangulation if the sampling S is not dense enough, see [7]. This is because252 252

of some isolated point, that is connected to only one other point of S in DS .253 253

The algorithm automatically add points on the Voronoi cell boundary of such a254 254

point.255 255

x1 x2x3x1 x2

x3

Fig. 7. Left: the vertex x3 encroaches the boundary curve ⇥1,2. Right: the vertex x3

does not encroach anymore because (x1, x2) is a Delaunay edge.

Table 2 details this algorithm. A bound ⇥⇥ on ⇥ enforces the refinement to256 256

reach some quality criterion, while a bound U⇥ enforces a uniform refinement to257 257

match some desired triangle density.258 258

1. Initialization: set S with at least one point on each curve of �, compute US witha Fast Marching.

2. Boundary enforcement: while it exists ⇥i,j � ⌃� encroached by some xk ⇤ S,subdivide: S ⇥ S ⌃ argmax

x⇤⇤i,j

US(x). Update US with a local Fast Marching.

3. Triangulation enforcement: while it exists (xi, xj) ⇤ DS with xi or xj isolated,insert w⇥ = argmax

w⇤Ci⇧Cj

d(xi, w).

4. Select point: s⇧ ⇥ argmins⇤�S�⌃⇥

⇤(s).

– If in S ⌃ {s⇧}, s⇧ encroaches some ⇥i,j � ⌃�, subdivide: S ⇥ S ⌃ argmaxx⇤⇤i,j

US(x).

– Otherwise, add it: S ⇥ S ⌃ s⇧.Update US with a local Fast Marching.

5. Stop: while ⇤(s⇧) > ⇤⇧ or US(s⇧) > U⇧, go back to 2.

Table 2: Anisotropic planar domain meshing algorithm.

x1

x3

s1,2,3

s1,2,3

x3

x2x2

x1

Page 37: Mesh Processing Course : Geodesic Sampling

Isotropic vs. Anisotropic Meshing

37

Isot

ropi

cA

niso

trop

ic

Page 38: Mesh Processing Course : Geodesic Sampling

Examples of Anisotropic Meshing

38

M,Given polygonal domain and metric tensor field

The Anisotropic Mesh Generation Problem

generate anisotropic mesh.

M,Given polygonal domain and metric tensor field

The Anisotropic Mesh Generation Problem

generate anisotropic mesh.If metric tensorderivatives, no triangle has angle < 20° asmeasured by any point in the triangle.

Main Result

M is smooth with bounded

Anisotropic Voronoi Diagrams andGuaranteed-Quality Anisotropic Mesh Generation

Francois Labelle

[email protected]

Jonathan Richard [email protected]

Department of Electrical Engineering and Computer SciencesUniversity of California at Berkeley

Berkeley, California 94720

Abstract

We introduce anisotropic Voronoi diagrams, a generalization ofmultiplicatively weighted Voronoi diagrams suitable for generat-ing guaranteed-quality meshes of domains in which long, skinnytriangles are required, and where the desired anisotropy varies overthe domain. We discuss properties of anisotropic Voronoi diagramsof arbitrary dimensionality—most notably circumstances in whicha site can see its entire Voronoi cell. In two dimensions, the aniso-tropic Voronoi diagram dualizes to a triangulation under these samecircumstances. We use these properties to develop an algorithm foranisotropic triangular mesh generation in which no triangle has anangle smaller than 20!, as measured from the skewed perspectiveof any point in the triangle.

Categories and Subject Descriptors

F.2.2 [Analysis of Algorithms and Problem Complexity]: Non-numerical Algorithms and Problems

General Terms

Algorithms, Theory

Keywords

Anisotropic Voronoi diagram, anisotropic mesh generation

1. IntroductionThe best-performing triangulations for interpolation and numer-

ical modeling have triangles or tetrahedra whose aspect ratios andorientations are chosen to suit the function they interpolate, or thepartial differential equation whose solution they approximate. Tri-angles, tetrahedra, or most generally d-simplices inEd (henceforthelements) that are nearly equilateral are excellent for some applica-tions; for others, elements that are long and thin, like those depicted

Supported in part by the National Science Foundation underAwards ACI-9875170, CMS-9980063, CCR-0204377, and EIA-9802069, and by a gift from the Okawa Foundation.

Permission to make digital or hard copies of all or part of this work forpersonal or classroom use is granted without fee provided that copies arenot made or distributed for profit or commercial advantage and that copiesbear this notice and the full citation on the first page. To copy otherwise, torepublish, to post on servers or to redistribute to lists, requires prior specificpermission and/or a fee.SoCG’03, June 8–10, 2003, San Diego, California, USA.Copyright 2003 ACM 1-58113-663-3/03/0006 ...$5.00.

in Figure 1, can offer better accuracy with fewer elements [3, 9, 12,18]. Applications in the latter class are said to exhibit anisotropicbehavior.The construction of anisotropic triangulations that meet the needs

of these applications is an important problem for which many heur-istic solutions are available [5, 7, 11, 19]. However, these al-gorithms have no guarantee of success. For example, the edgeflip algorithm for constructing the Delaunay triangulation is eas-ily modifi ed to take anisotropy into account. Alternatively, Georgeand Borouchaki [7] suggest an anisotropic version of the Bowyer–Watson algorithm [6, 20] for inserting a site into a Delaunay trian-gulation. But is the fi nal triangulation produced by either of thesealgorithms unique? What are its properties? Will the flip algorithmterminate or loop forever?Here we describe an approach that puts anisotropic meshing on

fi rm theoretical ground. In Section 3 we defi ne anisotropic Voronoidiagrams, a generalization of multiplicatively weighted Voronoi di-agrams [4]. Anisotropic Voronoi diagrams can be defi ned in anydimensionality. The geometric dual of an anisotropic Voronoi di-agram is not generally a triangulation. We describe conditions inwhich the Voronoi cells are guaranteed to be entirely visible fromtheir generating sites in Section 5. For the special case of two di-mensions, the same conditions also guarantee that the planar dualis a geometric triangulation with no inverted triangles.These results make possible an algorithm that generates high-

quality two-dimensional anisotropic meshes by refi ning an aniso-tropic Voronoi diagram to enforce the conditions that guarantee thatthe dual is a triangulation, and to remove any poor-quality elements

Figure 1: Anisotropic meshes generated by Voronoi refinement, and

the anisotropic Voronoi diagrams used to generate them.

Page 39: Mesh Processing Course : Geodesic Sampling

Bonus

• Centroidal Tesselations

39

Page 40: Mesh Processing Course : Geodesic Sampling

Centroidal Tesselation

40

A ⇥ Rn, Euclidean center of gravity: g(A) = argminx

�A ||x� y||2dy.

A �M, geodesic center of gravity: gM(A) = argminx

�A dM(x, y)2dy

Sampling {xi}mi=1, Voronoi tessellation VoronoiM({xi}i) = {Vi}m

i=1.

Centroidal tessellation � i, xi = gM(Vi), local minimizer of

E({xi}, {Vi}i) =m�

i=1

Vi

dM(xi, y)2dy.

1. Initialize: {xi}i � random.2. Update regions: ⇥ i, {Vi}i � VoronoiM({xi}i).3. Update centers: ⇥ i, xi � gM(Vi).4. Stop: while not converged, go back to 2.Lloy

d-M

ax x

y

���⇥nx(y)

EA(x) =�

AdM(x, y)2dy =⇤ ⌅xEA =

AdM(x, y)

���⇥nx(y)dy

Page 41: Mesh Processing Course : Geodesic Sampling

Centroidal Tesselations of the Plane

41

= Delaunay = Voronoi

unifo

rmad

apti

ve

#iterations

Page 42: Mesh Processing Course : Geodesic Sampling

Centroidal Tesselations of Surfaces

42

#iterations