Mesh Processing Course : Differential Calculus

77
Differential Mesh Processing Gabriel Peyré CEREMADE, Université Paris-Dauphine www.numerical-tours.com

description

Slides for a course on mesh processing.

Transcript of Mesh Processing Course : Differential Calculus

Page 1: Mesh Processing Course : Differential Calculus

Differential Mesh Processing

Gabriel PeyréCEREMADE, Université Paris-Dauphine

www.numerical-tours.com

Page 2: Mesh Processing Course : Differential Calculus

Processing: Local vs. Global

2

DifferentialProcessing

GeodesicProcessing

Surface filtering

Fourier on Meshes

Front Propagation on Meshes

Surface Remeshing

Page 3: Mesh Processing Course : Differential Calculus

Overview

•Triangulated Meshes

•Operators on Meshes

•From Discrete to Continuous

•Denoising by Diffusion and Regularization

•Fourier on Meshes

•Spectral Mesh Compression3

Page 4: Mesh Processing Course : Differential Calculus

Triangular Meshes

4

Triangulated mesh: topology M = (V,E, F ) and geometry M = (V, E ,F).

i

j k

Topology M :

(0D) Vertices: V ⌅ {1, . . . , n}.(1D) Edges: E ⇤ V � V .Symmetric: (i, j) ⌥ E ⌃ i ⇥ j ⌃ (j, i) ⌥ E.(2D) Faces: F ⇤ V � V � V .Compatibility: (i, j, k) ⌥ F ⇧ (i, j), (j, k), (k, i) ⌥ E.

⇥ (i, j) � E, ⇤(i, j, k) � F.

Page 5: Mesh Processing Course : Differential Calculus

Triangular Meshes

4

Triangulated mesh: topology M = (V,E, F ) and geometry M = (V, E ,F).

i

j k

Topology M :

(0D) Vertices: V ⌅ {1, . . . , n}.(1D) Edges: E ⇤ V � V .Symmetric: (i, j) ⌥ E ⌃ i ⇥ j ⌃ (j, i) ⌥ E.(2D) Faces: F ⇤ V � V � V .Compatibility: (i, j, k) ⌥ F ⇧ (i, j), (j, k), (k, i) ⌥ E.

⇥ (i, j) � E, ⇤(i, j, k) � F.

Geometric realization M: ⇥ i � V, xi � R3, V def.= {xi \ i � V } .

E def.=�

(i,j)�E

Conv(xi, xj) � R3.

F def.=�

(i,j,k)�F

Conv(xi, xj , xk) � R3.

Piecewise linear mesh:

Page 6: Mesh Processing Course : Differential Calculus

Mesh Acquisitionacquisition

[Digital Michelangelo Project]

Low-poly modeling5

Implicit surface

Page 7: Mesh Processing Course : Differential Calculus

Local Connectivity

6

Vertex 1-ring: Videf.= {j ⇥ V \ (i, j) ⇥ E} � V .

Face 1-ring: Fidef.= {(i, j, k) ⇥ F \ i, j ⇥ V } � F .

i

j k

f = (i, j, k) Vi

�⇥ni

�⇥nf

Page 8: Mesh Processing Course : Differential Calculus

Local Connectivity

6

Vertex 1-ring: Videf.= {j ⇥ V \ (i, j) ⇥ E} � V .

Face 1-ring: Fidef.= {(i, j, k) ⇥ F \ i, j ⇥ V } � F .

Normal Computation:

⌅ f = (i, j, k) ⇤ F, �⇥nfdef.=

(xj � xi) ⇧ (xk � xi)||(xj � xi) ⇧ (xk � xi)||

.

⌅ i ⇤ V, �⇥nidef.=

�f�Fi

�⇥nf

||�

f�Fi

�⇥nf ||

i

j k

f = (i, j, k) Vi

�⇥ni

�⇥nf

Page 9: Mesh Processing Course : Differential Calculus

Mesh Displaying

7

Page 10: Mesh Processing Course : Differential Calculus

Overview

•Triangulated Meshes

•Operators on Meshes

•From Discrete to Continuous

•Denoising by Diffusion and Regularization

•Fourier on Meshes

•Spectral Mesh Compression8

Page 11: Mesh Processing Course : Differential Calculus

Functions on a Mesh

9

Function on a mesh: f ⇥ �2(V) � �2(V ) � Rn.

f :

�V �⇥ Rxi ⌃�⇥ f(xi)

⇤⌅ f :

�V �⇥ Ri ⌃�⇥ fi

⇤⌅ f = (fi)i�V ⇧ Rn.

Page 12: Mesh Processing Course : Differential Calculus

Functions on a Mesh

9

Function on a mesh: f ⇥ �2(V) � �2(V ) � Rn.

f :

�V �⇥ Rxi ⌃�⇥ f(xi)

⇤⌅ f :

�V �⇥ Ri ⌃�⇥ fi

⇤⌅ f = (fi)i�V ⇧ Rn.

Inner product & norm:

�f, g⇥ def.=�

i�V

figi and ||f ||2 = �f, f⇥

Page 13: Mesh Processing Course : Differential Calculus

Functions on a Mesh

9

Function on a mesh: f ⇥ �2(V) � �2(V ) � Rn.

f :

�V �⇥ Rxi ⌃�⇥ f(xi)

⇤⌅ f :

�V �⇥ Ri ⌃�⇥ fi

⇤⌅ f = (fi)i�V ⇧ Rn.

Inner product & norm:

�f, g⇥ def.=�

i�V

figi and ||f ||2 = �f, f⇥

Linear operator A:

A : �2(V )� �2(V ) ⇥⇤ A = (aij)i,j⇥V ⌅ Rn�n (matrix).

(Af)(xi) =�

j�V

aijf(xj)�⇥ (Af)i =�

j�V

aijfj .

Page 14: Mesh Processing Course : Differential Calculus

Functions on a Mesh

9

Function on a mesh: f ⇥ �2(V) � �2(V ) � Rn.

f :

�V �⇥ Rxi ⌃�⇥ f(xi)

⇤⌅ f :

�V �⇥ Ri ⌃�⇥ fi

⇤⌅ f = (fi)i�V ⇧ Rn.

Inner product & norm:

�f, g⇥ def.=�

i�V

figi and ||f ||2 = �f, f⇥

Linear operator A:

A : �2(V )� �2(V ) ⇥⇤ A = (aij)i,j⇥V ⌅ Rn�n (matrix).

(Af)(xi) =�

j�V

aijf(xj)�⇥ (Af)i =�

j�V

aijfj .

Mesh processing:Modify functions f ⇥ �2(V ).Example: denoise a meshM as 3 functions on M .Strategy : apply a linear operator f ⇤� Af .Remark: A can computed from M only or from (M,M).

f Af

Page 15: Mesh Processing Course : Differential Calculus

Functions on Meshes

10

Examples:Coordinates: xi = (x1

i , x2i , x

3i ) ⌅ R3.

X-coordinate: f : i ⌅ V ⇧� x1i ⌅ R.

Geometric meshM ⇥⇤ 3 functions defined on M .

f(xi) = x1i f(xi) = cos(2�x1

i )

Page 16: Mesh Processing Course : Differential Calculus

Local Averaging

11

Local operator: W = (wij)i,j�V where wij =

�> 0 if j � Vi,

0 otherwise.(Wf)i =

(i,j)�E

wijfj .

Page 17: Mesh Processing Course : Differential Calculus

Local Averaging

11

Local operator: W = (wij)i,j�V where wij =

�> 0 if j � Vi,

0 otherwise.(Wf)i =

(i,j)�E

wijfj .

Examples: for i � j,

wij = 1combinatorial

wij = 1||xj�xi||2

distancewij = cot(�ij) + cot(⇥ij)

conformal(explanations later)

Page 18: Mesh Processing Course : Differential Calculus

Local Averaging

11

Local operator: W = (wij)i,j�V where wij =

�> 0 if j � Vi,

0 otherwise.(Wf)i =

(i,j)�E

wijfj .

Examples: for i � j,

wij = 1combinatorial

wij = 1||xj�xi||2

distancewij = cot(�ij) + cot(⇥ij)

conformal

Local averaging operator W = (wij)i,j�V : ⇥ (i, j) � E, wij =wij�

(i,j)�E wij.

W = D�1W with D = diagi(di) where di =�

(i,j)⇥E

wij .

Averaging: W1 = 1.

(explanations later)

Page 19: Mesh Processing Course : Differential Calculus

Iterative Smoothing

12

Iterative smoothing: Wf, W 2, . . . , W kf smoothed version of f .

f Wf W 4f W 8f

Page 20: Mesh Processing Course : Differential Calculus

On a Regular Grid

13

Regular grid: Wf = w � f .

Example in 2D: (Wf)i = 14

�4k=1 fjk .

Vi = {j1, j2, j3, j4}

Page 21: Mesh Processing Course : Differential Calculus

On a Regular Grid

13

Regular grid: Wf = w � f .

Discrete Fourier transform:

�(W kf) = �(w � . . . � w � f) =⇥ �(W kf)(�) = �w(�)k f(�).

Convolution and Fourier: �(f � g) = f · g

�(f)(�) = f(�) def.=�

k

fke2i�n k�.

Example in 2D: (Wf)i = 14

�4k=1 fjk .

Vi = {j1, j2, j3, j4}

Page 22: Mesh Processing Course : Differential Calculus

On a Regular Grid

13

Regular grid: Wf = w � f .

Discrete Fourier transform:

Convergence:

�(W kf) = �(w � . . . � w � f) =⇥ �(W kf)(�) = �w(�)k f(�).

Convolution and Fourier: �(f � g) = f · g

�(f)(�) = f(�) def.=�

k

fke2i�n k�.

Example in 2D: (Wf)i = 14

�4k=1 fjk .

Vi = {j1, j2, j3, j4}

If n is odd, W kfk�+⇥�⇥ 1

|V |�

i⇤V

fi

Page 23: Mesh Processing Course : Differential Calculus

Gradient

14

⇤ (i, j) ⇥ E, i < j, (Gf)(i,j)def.= ⌅

wij(fj � fi) ⇥ R.

⇥ Derivative along direction ��⇥xixj .

G : �2(V ) �⇥ �2(E0), ⇤⌅ G : Rn �⇥ Rp where p = |E0|,⇤⌅ G ⇧ Rn�p matrix.

Gradient operator: oriented edges E0def.= {(i, j) � E \ i < j},

Page 24: Mesh Processing Course : Differential Calculus

Gradient

14

⇤ (i, j) ⇥ E, i < j, (Gf)(i,j)def.= ⌅

wij(fj � fi) ⇥ R.

⇥ Derivative along direction ��⇥xixj .

Example: wij = ||xi � xj ||�2, (Gf)(i,j) = f(xj)�f(xi)||xi�xj || .

G : �2(V ) �⇥ �2(E0), ⇤⌅ G : Rn �⇥ Rp where p = |E0|,⇤⌅ G ⇧ Rn�p matrix.

Regular grid:Gf discretize �f =

��f�x , �f

�y

⇥.

GTv discretize div(v) = �v1�x + �v2

�y .

Gradient operator: oriented edges E0def.= {(i, j) � E \ i < j},

Page 25: Mesh Processing Course : Differential Calculus

Laplacian

15

Ldef.= D �W, where D = diagi(di), with di =

j

wij .

Remarks:symmetric operators L, L � Rn�n.L1 = 0: acts like a (second order) derivative.L1 ⇥= 0.

Normalized Laplacian:

Ldef.= D�1/2LD�1/2 = Idn �D�1/2WD1/2 = Idn �D1/2WD�1/2.

Page 26: Mesh Processing Course : Differential Calculus

Laplacian Positivity

16

Theorem: L = GTG and L = (GD�1/2)T(GD�1/2).

=� L and L are symmetric positive definite.

⇥Lf, f⇤ = ||Gf ||2 =�

(i,j)�E0

wij ||fi � fj ||2

⇥Lf, f⇤ = ||GD�1/2f ||2 =⇥

(i,j)⇥E0

wij

�����

�����fi⌅di

� fj⇤dj

�����

�����

2

Theorem: if M is connected, then

ker(L) = span(1) and ker(L) = span(D1/2).

Page 27: Mesh Processing Course : Differential Calculus

Proof

17

||Gf ||2 =�

(i,j)�E0

wi,j |fi � fj |2

=�

i>j

wi,jf2i

=�

i<j

wi,jf2i +

i<j

wi,jf2j � 2

i<j

wi,jfifj

=�

j

f2i

i�j

wi,j ��

i

j

wi,jfj

= �Df, f� � �Wf, f� = �Lf, f�

=� �f � Rn, �(L�G�G)f, f� = 0 =� L = G�G

=�

i�j

wi,jfifj

Page 28: Mesh Processing Course : Differential Calculus

Overview

•Triangulated Meshes

•Operators on Meshes

•From Discrete to Continuous

•Denoising by Diffusion and Regularization

•Fourier on Meshes

•Spectral Mesh Compression18

Page 29: Mesh Processing Course : Differential Calculus

Examples of Laplacians

19

Example in 1D: (Lf)i =1h2

(2fi � fi+1 � fi�1) =1h2

f ⇥ (�1, 2,�1)

Lh�0�⇥ �d2f

dx2(xi)

Page 30: Mesh Processing Course : Differential Calculus

Examples of Laplacians

19

(Lf)i =1h2

(4fi � fj1 � fj2 � fj3 � fj4) =1h2

f ⇥

⇧⇤0 -1 0-1 4 -10 -1 0

⌃⌅

Example in 2D:

L = GTGf discretize �f = div(�f).

Example in 1D: (Lf)i =1h2

(2fi � fi+1 � fi�1) =1h2

f ⇥ (�1, 2,�1)

Lh�0�⇥ �d2f

dx2(xi)

Lh�0�⇥ ��2f

�x2(xi)�

�2f

�y2(xi) = �f(xi).

Page 31: Mesh Processing Course : Differential Calculus

Parameterized Surface

First fundamental form: I� =�� ⇥�

⇥ui,

⇥�

⇥uj⇥⇥

i,j=1,2

.

Parameterized surfaceM:

�D ⇥ R2 �⇤ M

u ⌅�⇤ �(x)

u1

u2 �⇥�

⇥u1

⇥�

⇥u2

Curve �(t) � D, length: L(�) =� 10

⇥��(t)I�(t)��(t)dt

Page 32: Mesh Processing Course : Differential Calculus

Parameterized Surface

First fundamental form: I� =�� ⇥�

⇥ui,

⇥�

⇥uj⇥⇥

i,j=1,2

.

M is locally isometric to plane: I� = Id.Exemple: M =cylinder.

⇥ is conformal: I�(u) = �(u)Id.

Exemple: stereographic mapping plane�sphere.

Parameterized surfaceM:

�D ⇥ R2 �⇤ M

u ⌅�⇤ �(x)

u1

u2 �⇥�

⇥u1

⇥�

⇥u2

Curve �(t) � D, length: L(�) =� 10

⇥��(t)I�(t)��(t)dt

Page 33: Mesh Processing Course : Differential Calculus

Laplace-Beltrami

21

Laplace operator on the plane: � =�2

�x2+

�2

�y2.

Laplace Beltrami operator on a surfaceM:⇥

g�Mdef.=

�u1

�g22⇥

g

�u1� g12⇥

g

�u2

⇥+

�u2

�g11⇥

g

�u2� g12⇥

g

�u1

where g = det(I�) and I� = (gij)i,j=1,2.

Page 34: Mesh Processing Course : Differential Calculus

Laplace-Beltrami

21

Laplace operator on the plane: � =�2

�x2+

�2

�y2.

Laplace Beltrami operator on a surfaceM:⇥

g�Mdef.=

�u1

�g22⇥

g

�u1� g12⇥

g

�u2

⇥+

�u2

�g11⇥

g

�u2� g12⇥

g

�u1

where g = det(I�) and I� = (gij)i,j=1,2.

Remark:

where dM is the geodesic distance onM.

where Bh(x) = {y \ dM(x, y) � h}

�Mf(x) = limh�0

1h2

(Lhf)(x)

(Lhf)(x) = f(x)� 1|Bh(x)|

y�Bh(x)f(y)dy

Page 35: Mesh Processing Course : Differential Calculus

Voronoi and Dual Mesh

22

Definition for a planar triangulation M of a meshM � R2.

Voronoi for vertices: ⇧ i ⇤ V, Ei = {x ⇤M \ ⇧ j ⌅= i, ||x� xi|| ⇥ ||x� xj ||}

i

j

Ai

cf

Dual mesh

Page 36: Mesh Processing Course : Differential Calculus

Voronoi and Dual Mesh

22

Definition for a planar triangulation M of a meshM � R2.

Voronoi for vertices: ⇧ i ⇤ V, Ei = {x ⇤M \ ⇧ j ⌅= i, ||x� xi|| ⇥ ||x� xj ||}

Voronoi for edges: ⌅ e = (i, j) ⇥ E, Ee = {x ⇥M \ ⌅ e� ⇤= e, d(x, e) � d(x, e�)}

Partition of the mesh: M =�

i�V

Ei =�

e�E

Ee.

i

j

Ai

cf

i

j

A(ij)cf

Dual mesh 1:3 subdivided mesh

Page 37: Mesh Processing Course : Differential Calculus

Approximating Integrals on MeshesApproximation of integrals on vertices and edges:

Mf(x)dx �

i�V

Ai f(xi) ��

e=(i,j)�E

Ae f([xi, xj ]).

Theorem : ⇥ e = (i, j) � E,

Ae = Area(Ee) =12

||xi � xj ||2 (cot(�ij) + cot(⇥ij))

i

j

A(ij)cf

Page 38: Mesh Processing Course : Differential Calculus

Approximating Integrals on MeshesApproximation of integrals on vertices and edges:

Mf(x)dx �

i�V

Ai f(xi) ��

e=(i,j)�E

Ae f([xi, xj ]).

Theorem : ⇥ e = (i, j) � E,

Ae = Area(Ee) =12

||xi � xj ||2 (cot(�ij) + cot(⇥ij))

i

j

A(ij)cf

A

B

C

O

��

h

� + � + � =�

2

A(ABO) = ||AB||� h = ||AB||� ||AB||2

tan(�)

A(ABO) =||AB||2

2tan

�⇤

2� (� + ⇥)

Proof:

Page 39: Mesh Processing Course : Differential Calculus

Cotangent WeightsSobolev norm (Dirichlet energy): J(f) =

M||�f(x)||dx

Page 40: Mesh Processing Course : Differential Calculus

1.2 Linear Mesh Processing

The smoothing property corresponds to W1 = 1 which means that the unit vector is an eigen-vector of W with eigenvalue 1.Example 3. In practice, we use three popular kinds of averaging operators.

Combinatorial weights: they depends only on the topology (V,E) of the vertex graph

⇧ (i, j) ⇤ E, wij = 1.

Distance weights: they depends both on the geometry and the topology of the mesh, but do notrequire faces information,

⇧ (i, j) ⇤ E, wij =1

||xj � xi||2.

Conformal weights: they depends on the full geometrical realization of the 3D mesh since theyrequire the face information

⇧ (i, j) ⇤ E, wij = cot(�ij) + cot(⇥ij). (1.3)

Figure 1.2 shows the geometrical meaning of the angles �ij and ⇥ij

�ij = ⇥(xi, xj , xk1) and ⇥ij = ⇥(xi, xj , xk2),

where (i, j, k1) ⇤ F and (i, j, k2) ⇤ F are the two faces adjacent to edge (i, j) ⇤ E. We will seein the next section the explanation of these celebrated cotangent weights.

xi

xj

xk1

xk2

�ij

�ij

Figure 1.2: One ring around a vertex i, together with the geometrical angles �ij and ⇥ij used tocompute the conformal weights.

One can use iteratively a smoothing in order to further filter a function on a mesh. The resultingvectors Wf, W 2, . . . , W kf are increasingly smoothed version of f . Figure 1.3 shows an example ofsuch iterations applied to the three coordinates of mesh. The sharp features of the mesh tend todisappear during iterations. We will make this statement more precise in the following, by studyingthe convergence of these iterations.

1.2.3 Approximating Integrals on a Mesh

Before investigating algebraically the properties of smoothing operators, one should be carefulabout what are these discrete operators really approximating. In order for the derivation to besimple, we make computation for a planar triangulation M of a mesh M ⇥ R2.

In the continuous domain, filtering is defined through integration of functions over the mesh. Inorder to descretize integrals, one needs to define a partition of the plane into small cells centeredaround a vertex or an edge.

Definition 10 (Vertices Voronoi). The Voronoi diagram associated to the vertices is

⇧ i ⇤ V, Ei = {x ⇤M \ ⇧ j ⌅= i, ||x� xi|| � ||x� xj ||}

5

Cotangent Weights

24

Approximation of Dirichelet energy:

where wij = cot(�ij) + cot(⇥ij).

M||⇤xf ||2dx ⇥

e�E

Ae|(Gf)e|2 =�

(i,j)�E

Ae|f(xj)� f(xi)|2

||xj � xi||2

=�

(i,j)�E

wij |f(xj)� f(xi)|2

Sobolev norm (Dirichlet energy): J(f) =�

M||�f(x)||dx

Page 41: Mesh Processing Course : Differential Calculus

1.2 Linear Mesh Processing

The smoothing property corresponds to W1 = 1 which means that the unit vector is an eigen-vector of W with eigenvalue 1.Example 3. In practice, we use three popular kinds of averaging operators.

Combinatorial weights: they depends only on the topology (V,E) of the vertex graph

⇧ (i, j) ⇤ E, wij = 1.

Distance weights: they depends both on the geometry and the topology of the mesh, but do notrequire faces information,

⇧ (i, j) ⇤ E, wij =1

||xj � xi||2.

Conformal weights: they depends on the full geometrical realization of the 3D mesh since theyrequire the face information

⇧ (i, j) ⇤ E, wij = cot(�ij) + cot(⇥ij). (1.3)

Figure 1.2 shows the geometrical meaning of the angles �ij and ⇥ij

�ij = ⇥(xi, xj , xk1) and ⇥ij = ⇥(xi, xj , xk2),

where (i, j, k1) ⇤ F and (i, j, k2) ⇤ F are the two faces adjacent to edge (i, j) ⇤ E. We will seein the next section the explanation of these celebrated cotangent weights.

xi

xj

xk1

xk2

�ij

�ij

Figure 1.2: One ring around a vertex i, together with the geometrical angles �ij and ⇥ij used tocompute the conformal weights.

One can use iteratively a smoothing in order to further filter a function on a mesh. The resultingvectors Wf, W 2, . . . , W kf are increasingly smoothed version of f . Figure 1.3 shows an example ofsuch iterations applied to the three coordinates of mesh. The sharp features of the mesh tend todisappear during iterations. We will make this statement more precise in the following, by studyingthe convergence of these iterations.

1.2.3 Approximating Integrals on a Mesh

Before investigating algebraically the properties of smoothing operators, one should be carefulabout what are these discrete operators really approximating. In order for the derivation to besimple, we make computation for a planar triangulation M of a mesh M ⇥ R2.

In the continuous domain, filtering is defined through integration of functions over the mesh. Inorder to descretize integrals, one needs to define a partition of the plane into small cells centeredaround a vertex or an edge.

Definition 10 (Vertices Voronoi). The Voronoi diagram associated to the vertices is

⇧ i ⇤ V, Ei = {x ⇤M \ ⇧ j ⌅= i, ||x� xi|| � ||x� xj ||}

5

Cotangent Weights

24

Approximation of Dirichelet energy:

Theorem : wij > 0�⇥ �ij + ⇥ij < ⇤

where wij = cot(�ij) + cot(⇥ij).

M||⇤xf ||2dx ⇥

e�E

Ae|(Gf)e|2 =�

(i,j)�E

Ae|f(xj)� f(xi)|2

||xj � xi||2

=�

(i,j)�E

wij |f(xj)� f(xi)|2

Sobolev norm (Dirichlet energy): J(f) =�

M||�f(x)||dx

Page 42: Mesh Processing Course : Differential Calculus

Overview

•Triangulated Meshes

•Operators on Meshes

•From Discrete to Continuous

•Denoising by Diffusion and Regularization

•Fourier on Meshes

•Spectral Mesh Compression25

Page 43: Mesh Processing Course : Differential Calculus

Mesh DenoisingNormal displacement: xi = x0

i + (�W )�⇥ni , W white noise.

Noisy input: scanning error, imperfect material, etc.

Page 44: Mesh Processing Course : Differential Calculus

Mesh DenoisingNormal displacement: xi = x0

i + (�W )�⇥ni , W white noise.

Mesh: 3 functions X/Y/Z: xi = (f1(i), f2(i), f3(i)) � R3.

Denoising: smooth each function fk(i), k = 1, 2, 3.

{xi}i = {(f1(i), f2(i), f3(i))}i {(f1(i), f2(i), f3(i))}i = {xi}ismoothing

Noisy input: scanning error, imperfect material, etc.

Page 45: Mesh Processing Course : Differential Calculus

Mesh Denoising

26

Normal displacement: xi = x0i + (�W )�⇥ni , W white noise.

Mesh: 3 functions X/Y/Z: xi = (f1(i), f2(i), f3(i)) � R3.

Denoising error (oracle):3�

k=1

i�V|fk(i)� f0

k (i)|2 =�

i�V||xi � x0

i ||2

Denoising: smooth each function fk(i), k = 1, 2, 3.

{xi}i = {(f1(i), f2(i), f3(i))}i {(f1(i), f2(i), f3(i))}i = {xi}ismoothing

Noisy input: scanning error, imperfect material, etc.

{x0i }i {xi}i {xi}i

smoothingaddingnoise

SNR(x0, x) = �20 log10

i

||xi � x0i ||/

i

||x0i ||

Page 46: Mesh Processing Course : Differential Calculus

Iterative Smoothing

27

Initialization: k = 1, 2, 3, f (0)k = fk.

Iteration: k = 1, 2, 3, f (s+1)k = Wf (s)

k , f (s+1)k (i) =

1|Vi|

(j,i)�Vi

f (s)k (i)

Denoised: choose s, and xi = (f (s)1 , f (s)

2 , f (s)3 )

Page 47: Mesh Processing Course : Differential Calculus

Iterative Smoothing

27

Initialization: k = 1, 2, 3, f (0)k = fk.

Iteration: k = 1, 2, 3, f (s+1)k = Wf (s)

k , f (s+1)k (i) =

1|Vi|

(j,i)�Vi

f (s)k (i)

s = 0 s = 1 s = 2 s = 3 s = 4

s

SNR

(x0,x

)Denoised: choose s, and xi = (f (s)1 , f (s)

2 , f (s)3 )

Problem: optimal choice of s

Oracle: maxs

SNR(x0, x(s)).

Page 48: Mesh Processing Course : Differential Calculus

Heat Diffusion

28

Heat di�usion: ⇥ t > 0, F (t) : V � R solving

�F (t)

�t= �D�1LF (t) = (Idn � W )F (t) and ⇤ i ⇥ V, F (0)(i) = f(i)

Page 49: Mesh Processing Course : Differential Calculus

Heat Diffusion

28

Discretization: time step �, #iterations Kdef.= t/�.

Heat di�usion: ⇥ t > 0, F (t) : V � R solving

�F (t)

�t= �D�1LF (t) = (Idn � W )F (t) and ⇤ i ⇥ V, F (0)(i) = f(i)

1�

�f (s+1) � f (s)

⇥= �D�1Lf (s) =⇥ f (s+1) = f (s)��D�1Lf (s) = (1��)f (s)+�Wf (s).

Page 50: Mesh Processing Course : Differential Calculus

Heat Diffusion

28

�⇥ see later for a proof.

Discretization: time step �, #iterations Kdef.= t/�.

Theorem: stable and convergent scheme if � < 1 (CFL condition)

Heat di�usion: ⇥ t > 0, F (t) : V � R solving

�F (t)

�t= �D�1LF (t) = (Idn � W )F (t) and ⇤ i ⇥ V, F (0)(i) = f(i)

1�

�f (s+1) � f (s)

⇥= �D�1Lf (s) =⇥ f (s+1) = f (s)��D�1Lf (s) = (1��)f (s)+�Wf (s).

f (t/�) ��0�⇥ F (t)

Page 51: Mesh Processing Course : Differential Calculus

Heat Diffusion

28

�⇥ see later for a proof.

�⇥ still stable in most cases (see later).

Discretization: time step �, #iterations Kdef.= t/�.

Theorem: stable and convergent scheme if � < 1 (CFL condition)

Heat di�usion: ⇥ t > 0, F (t) : V � R solving

�F (t)

�t= �D�1LF (t) = (Idn � W )F (t) and ⇤ i ⇥ V, F (0)(i) = f(i)

1�

�f (s+1) � f (s)

⇥= �D�1Lf (s) =⇥ f (s+1) = f (s)��D�1Lf (s) = (1��)f (s)+�Wf (s).

f (t/�) ��0�⇥ F (t)

Remark: if � = 1, f (s) = W kf .

Page 52: Mesh Processing Course : Differential Calculus

PDEs on Meshes

t

Heat di�usion:�f

�t= �f and f(x, 0) = f0(x)

Page 53: Mesh Processing Course : Differential Calculus

PDEs on Meshes

t

Heat di�usion:�f

�t= �f and f(x, 0) = f0(x)

Di�usion of X/Y/Z coordinates:

Page 54: Mesh Processing Course : Differential Calculus

PDEs on Meshes

t

Heat di�usion:�f

�t= �f and f(x, 0) = f0(x)

% Laplacian matrixL=D-W;% initializationf1 = f;

for i=1:3 f1 = f1 + tau*L*f1;end

Initialization: Explicit Euler:

Di�usion of X/Y/Z coordinates:

Page 55: Mesh Processing Course : Differential Calculus

Mesh Denoising with Heat Diffusion

30

t = 0 t increases

Page 56: Mesh Processing Course : Differential Calculus

Optimal Stopping Time

31

Mesh: 3 functions X/Y/Z: xi = (f1(i), f2(i), f3(i)) � R3.

Problem: optimal choice of t

Denoised: x(t) = (f (s)1 , f (s)

2 , f (s)3 ) for t = s�.

Oracle: t� = maxt

SNR(x0, x(t)).

{xi}i {x(t�)i }i

SNR

(x0,x

(t) )

t

Page 57: Mesh Processing Course : Differential Calculus

Quadratic Regularization

32

for [i, j] ⇥ E0, (Gf)[i, j] = f(i)� f(j)

||Gf ||2 =�

(i,j)�E0

|f(i)� f(j)|2

f (�) = argming�Rn

||f � g||2 + �||Gg||2

�⇥ replaces f ⇤ Rn by f (�) ⇤ Rn with small gradient.

Page 58: Mesh Processing Course : Differential Calculus

Quadratic Regularization

32

for [i, j] ⇥ E0, (Gf)[i, j] = f(i)� f(j)

||Gf ||2 =�

(i,j)�E0

|f(i)� f(j)|2

f (�) = argming�Rn

||f � g||2 + �||Gg||2

�⇥ replaces f ⇤ Rn by f (�) ⇤ Rn with small gradient.

Theorem: f (�) is unique and f = (Idn + tL)�1f

where L = D �W = G�G

Page 59: Mesh Processing Course : Differential Calculus

Quadratic Regularization

32

for [i, j] ⇥ E0, (Gf)[i, j] = f(i)� f(j)

||Gf ||2 =�

(i,j)�E0

|f(i)� f(j)|2

f (�) = argming�Rn

||f � g||2 + �||Gg||2

�⇥ replaces f ⇤ Rn by f (�) ⇤ Rn with small gradient.

Theorem: f (�) is unique and f = (Idn + tL)�1f

where L = D �W = G�G

When �� +⇥: f (�) = argminGg=0

||f � g|| = Projspan(1)(f)

Theorem: f (�) ��+⇥�⇥ 1|V |

i

f(i)

Page 60: Mesh Processing Course : Differential Calculus

Choosing Optimal Regularization

33

Mesh: 3 functions X/Y/Z: xi = (f1(i), f2(i), f3(i)) � R3.

{xi}i

Denoised: x(�) = (f (�)1 , f (�)

2 , f (�)3 ).

Problem: optimal choice of �

Oracle: �⇥ = max�

SNR(x0, x(�)).

{x(��)i }i

SNR

(x0,x

(t) )

Page 61: Mesh Processing Course : Differential Calculus

Wave Propagation

34

1 Linear Mesh Processing

Other di�erential equations. One can solve other partial di⇥erential equations involving theLaplacian over a 3D mesh M = (V,E, F ). For instance, one can consider the wave equation, whichdefines, for all t > 0, a vector Ft ⇤ ⇣2(V ) as the solution of

⌥2Ft

⌥t2= �D�1LFt and

⇤F0 = f ⇤ Rn,ddtF0 = g ⇤ Rn,

(1.8)

In order to compute numerically the solution of this PDE, one can fix a time step � > 0 and usean explicit discretization in time Fk as F0 = f , F1 = F0 + �g and for k > 1

1�2

�Fk+1 + Fk�1 � 2Fk

⇥= �D�1LFk =⇥ Fk+1 = 2Fk � Fk�1 � �2D�1LFk.

Figure 1.6 shows examples of the resolution of the wave equation on 3D meshes.

Figure 1.6: Example of evolution of the wave equation on 3D mesh. The initial condition f is asuperposition of small positive and negative gaussians.

1.3.2 Spectral Decomposition

In order to better understand the behavior of linear smoothing on meshes, one needs to studythe spectral content of Laplacian operators. This leads to the definition of a Fourier theory formeshes. The decomposition L = (GD�1/2)

T(GD�1/2) of the Laplacian implies that it is a positive

semi-definite operator. One can thus introduce the following orthogonal factorization.

Theorem 6 (Eigen-decomposition of the Laplacian). It exists a matrix U, UTU = Idn such that

L = U�UT where � = diag�(⇥�), ⇥1 � . . . � ⇥n.

The eigenvalues ⇥� correspond to a frequency index that ranks the eigenvectors u� of U = (u�)�.One can first state some bounds on these eigenvalues.

Theorem 7 (Spectral bounds). ⌅ i, ⇥i ⇤ [0, 2] and

If M is connected then 0 = ⇥1 < ⇥2.⇥n = 2 if and only if M is 2-colorable.

We recall the definition of a colorable graph next.

12

t = 0 t increases

�2Ft

�t2= �D�1LFt and

�F0 = f ⇥ Rn,ddtF0 = g ⇥ Rn,

Discretization: 1�2

�Fk+1 + Fk�1 � 2Fk

⇥= �D�1LFk

=⇥ Fk+1 = 2Fk � Fk�1 � �2D�1LFk.

Page 62: Mesh Processing Course : Differential Calculus

Overview

•Triangulated Meshes

•Operators on Meshes

•From Discrete to Continuous

•Denoising by Diffusion and Regularization

•Fourier on Meshes

•Spectral Mesh Compression35

Page 63: Mesh Processing Course : Differential Calculus

Laplacian Eigen-decomposition

36

L = (GD�1/2)T(GD�1/2) =� L is positive semi-definite.

Eigen-decomposition of the Laplacian: �U, UTU = Idn,

L = U�UT where � = diag�(��) and �1 � . . . � �n.

L = D�1/2LD�1/2 = Idn �D�1/2WD�1/2

Page 64: Mesh Processing Course : Differential Calculus

Laplacian Eigen-decomposition

36

L = (GD�1/2)T(GD�1/2) =� L is positive semi-definite.

Eigen-decomposition of the Laplacian: �U, UTU = Idn,

Theorem: ⇥ i, �i � [0, 2] and

If M is connected then 0 = �1 < �2.�n = 2 if and only if M is 2-colorable.

L = U�UT where � = diag�(��) and �1 � . . . � �n.

L = D�1/2LD�1/2 = Idn �D�1/2WD�1/2

Page 65: Mesh Processing Course : Differential Calculus

Laplacian Eigen-decomposition

36

L = (GD�1/2)T(GD�1/2) =� L is positive semi-definite.

Eigen-decomposition of the Laplacian: �U, UTU = Idn,

Theorem: ⇥ i, �i � [0, 2] and

If M is connected then 0 = �1 < �2.�n = 2 if and only if M is 2-colorable.

L = U�UT where � = diag�(��) and �1 � . . . � �n.

Orthogonal expansion: �u�, u��⇥ = ���

� ,

⇥ f � �2(V ), f =�

⇤f, u�⌅u�.

Eigen-basis: U = (u�)� orthogonal basis of Rn � �2(V ).

u� :

�V �⇥ Ri ⇤�⇥ u�(i)

L = D�1/2LD�1/2 = Idn �D�1/2WD�1/2

Page 66: Mesh Processing Course : Differential Calculus

Proof

37

Lu� = ��u� =�

D�1(D �W )u� = ��u�

D�1/2(D �W )D�1/2u� = �u�

where u� = D�1/2u�

� 2

using (a� b)2 � 2(a2 + b2)

=�

Equality i� � (i, j) � E, u�(i) = �u�(j)

i.e. the graph is 2-colorable.

� =�Lu�, u���Du�, u��

=�

i<j wi,j(u�(i)� u�(j))2�

i diu�(i)2

Page 67: Mesh Processing Course : Differential Calculus

Eigenvectors of the Laplacian

38

Page 68: Mesh Processing Course : Differential Calculus

Examples of Eigen-decompositions

39

Theorem (in 1D):

Laplacian in 1-D:

u�(k) = n�1/2e2i�n k� �� = sin2

�⇥

n⇤�

Lf = (�1/2, 1,�1/2) � f

Page 69: Mesh Processing Course : Differential Calculus

Examples of Eigen-decompositions

39

Theorem (in 1D):

Theorem (in 2D): n = n1n2, � = (�1,�2)

On a 3D mesh: (u�)� is the extension of the Fourier basis.

Laplacian in 1-D:

u�(k) = n�1/2e2i�n k� �� = sin2

�⇥

n⇤�

�� =12

sin2�⇥

n⇤1

�+

12

sin2�⇥

n⇤2

�u�(k) = n�1e

2i�n �k, ��

Lf =

�0 �1/4 0

�1/4 1 �1/40 �1/4 0

� � fLaplacian in 2-D:

Lf = (�1/2, 1,�1/2) � f

Page 70: Mesh Processing Course : Differential Calculus

Fourier Transform on MeshesManifold-Fourier transform: for f � �2(V ),

�(f)(�) = f(�) def.= ⇤D1/2f, u�⌅ �⇥�

�(f) = f = UTD1/2f,

��1(f) = D�1/2Uf.

Proof: ⇥W⇥�1 = U�D1/2WD�1/2U = Idn � �

Idn � L

�Wf(⇥) = (1� ��)f(⇥)

Theorem: ⇥W⇥�1 = Idn � �,

=�

Page 71: Mesh Processing Course : Differential Calculus

Fourier Transform on Meshes

Theorem: if �n < 2 (i.e. M is not 2-colorable),

Manifold-Fourier transform: for f � �2(V ),

�(f)(�) = f(�) def.= ⇤D1/2f, u�⌅ �⇥�

�(f) = f = UTD1/2f,

��1(f) = D�1/2Uf.

Proof: ⇥W⇥�1 = U�D1/2WD�1/2U = Idn � �

Idn � L

�Wf(⇥) = (1� ��)f(⇥)

Theorem: ⇥W⇥�1 = Idn � �,

=�

W kfk�+��� f� = �f, d�d�1

W kf = ⇥�1(Idn � �)k⇥(f) �� f�

k

Page 72: Mesh Processing Course : Differential Calculus

Spectral DiffusionHeat di�usion: ⇥ t > 0,

�Ft

�t= �D�1LFt = (Idn � W )Ft

Manifold-Fourier expansion: Ftdef.= UTD1/2Ft.

⇤Ft(⇥)⇤t

= ���Ft(⇥) =⇥ Ft(⇥) = exp(���t)f(⇥).

Theorem: Ftt�+��� f� = �f, d�d�1

t

Page 73: Mesh Processing Course : Differential Calculus

Spectral DiffusionHeat di�usion: ⇥ t > 0,

�Ft

�t= �D�1LFt = (Idn � W )Ft

Manifold-Fourier expansion: Ftdef.= UTD1/2Ft.

Discretization: Fk+1 = Fk � �D�1LFk = (1� �)Fk + �W Fk.

�Fk(⇤) = (1� �⇥�)kf(⇤)

⇤Ft(⇥)⇤t

= ���Ft(⇥) =⇥ Ft(⇥) = exp(���t)f(⇥).

Theorem: Ft/���0�⇥ Ft, with stability if � < 1.

Theorem: Ftt�+��� f� = �f, d�d�1

t

Page 74: Mesh Processing Course : Differential Calculus

Mesh Approximation and Compression

42

Orthogonal basis U = (u�)� of �2(V ) � Rn, where L = U�UT.

f =n�

�=1

⇥f, u�⇤u�M-term approx.=� fM

def.=M�

�=1

⇥f, u�⇤u�.

Error decay: E(M) def.= ||f � fM ||2 =�

�>M |⇥f, u�⇤|2.

Page 75: Mesh Processing Course : Differential Calculus

Intuition: �� � |�|2.

Mesh Approximation and Compression

42

Orthogonal basis U = (u�)� of �2(V ) � Rn, where L = U�UT.

f =n�

�=1

⇥f, u�⇤u�M-term approx.=� fM

def.=M�

�=1

⇥f, u�⇤u�.

Good basis �⇥ E(M) decays fast.

Example in 1D: if f is C� on R/(2�Z), |f(�)| � ||f (�)||⇥|�|��.

Example on a mesh: f is smooth if ||Lf || is small.

|�f, u�⇥| =1��

|�f, Lu�⇥| � 1��

||Lf ||

Error decay: E(M) def.= ||f � fM ||2 =�

�>M |⇥f, u�⇤|2.

Page 76: Mesh Processing Course : Differential Calculus

Laplace Spectrum

43

f(�)

f(�) f(�)

f(�)

� �

Page 77: Mesh Processing Course : Differential Calculus

Mesh Compression

44

M increasing