Parameterization

advertisement
Parameterization
Introduction
• The goal of parameterization is to attach a
coordinate system to the object
– In particular, assign (2D) texture coordinates to the
3D vertices
• One application of mesh parameterization is
texture mapping
2
UVMapper in Blender
3
Introduction (cont)
• Another class of application concerns remeshing
algorithm
– converting from a mesh representation into an
alternative one
4
Introduction (cont)
• In summary, constructing a parameterization of
a triangulated surface means finding a set of
coordinates (ui,vi) associated to each vertex i.
• Moreover, the parameter space does not selfintersect.
Self-intersect
5
Mappings in the PMP Book
• 5.3 Barycentric mapping
Tutte-Floater
Discrete Laplacian (Laplace-Beltrami)
• 5.4 Conformal mapping
5.4.2 Least square conformal maps
5.4.4 (Geometric-based) ABF (angle-based
flattening)
• [5.5 Distortion analysis based methods]
6
Barycentric Mapping
• One of the most widely used
• Based on Tutte’s barycentric mapping
theorem from graph theory [Tutte60]
7
Wikipedia
Convex combination
Barycentric coordinate system
8
Barycentric Mapping (cont)
• Fixing the vertices of the boundary on a convex polygon.
The coordinates at the internal vertices are found by
solving the equation.
One simple way:
(without considering mesh geometry)
9
7
6
Example
3
2
0
1
4
5
 u0 
 u5 
 u3 
 u4 
 u1 
 u2 
a0,0    a0, 4    a0,5    a0,1    a0, 2    a0,3    0
 v4 
 v1 
 v2 
 v0 
 v5 
 v3 
 a0 , 4  u4  a0 , 5  u5  a0 ,1  u1  a0 , 2  u2  a0 , 3  u3  
 u0 
    a0 , 0    a0 , 0    a0 , 0    a0 , 0    a0 , 0   
 v1 
 v2 
 v0 
 v5 
 v3  
  v4 
a0, 4  a0,5  a0,1  a0, 2  a0,3  1
a0, 0   a0, j  5
j 0
10
ai ,i   ai , j
Internal: 0,1,2,3 Boundary: 4,5,6,7
j i
a0,0u0  a0,1u1  a0, 2u2  a0,3u3  a0, 4u4  a0,5u5  a0, 6u6  a0, 7u7  0
a1, 0u0  a1,1u1  a1, 2u2  a1,3u3  a1, 4u4  a1,5u5  a1, 6u6  a1, 7u7  0
a2, 0u0  a2,1u1  a2, 2u2  a2,3u3  a2, 4u4  a2,5u5  a2,6u6  a2, 7u7  0
a3, 0u0  a3,1u1  a3, 2u2  a3,3u3  a3, 4u4  a3,5u5  a3,6u6  a3, 7u7  0
 a0 , 0
a
 1, 0
 a2 , 0

 a3, 0
a0,1
a0 , 2
a1,1
a2,1
a1, 2
a2 , 2
0
a3, 2
a0,3  u0 
 a0 , 4
 0
0   u1 
   
 0
a2,3  u2 
 

a3,3  u3 
 a3, 4
a0 , 5
0
a1,5
a2 , 5
0
a2 , 6
0
0
0  u4 
a0 , 4 u 4  a0 , 5 u 5




0  u5 
a
u
1
,
5
5

   
 a2 , 5u5  a 2 , 6 u 6  a 2 , 7 u 7 
a2,7  u6 
 


a3,7  u7 
a
u

a
u
3
,
4
4
3
,
7
7


Ax = b, Solved by Gauss Seidel
DETAILS
11
Other Alternatives
Discrete harmonic coordinates
[Eck et al 1995]
Mean value coordinates
[Floater 2003]
12
Mean Value Coordinate
13
For some surfaces, fixing the boundary on a
convex polygon may be problematic
“Free” boundary
14
Conformal Mapping
• Iso-u and iso-v lines are orthogonal
• Minimize mesh distorsion
x, y, z T  X u, v
A conformal parameterization transforms a small circle into a small circle.
It is locally a similarity transform.
15
Types of Distortion
• L stretch, L shear, AngD
– Isometric (length-preserving)
– Conformal (angle-preserving)
– Equi-areal (area-preserving)
• Global isometric paramterization only exists for
developable surfaces, with vanishing Gaussian
curvature K(p) = 0 at all surface points
a developable surface is a surface with zero Gaussian
curvature. That is, it is a "surface" that can be flattened onto
a plane without distortion (i.e. "stretching" or "compressing").
16
[Differential Geometry Primer]
• Gaussian curvature
17
Gradient in a Triangle
X, Y: orthonormal basis
of the triangle
xi, xj, xk: vertex coordinates
in the XY basis
Study the inverse of parameterization: maps (X,Y) of the triangle to a point (u,v)
DETAILS
u intersects the iso-u lines; v intersects the iso-v lines
Conformality condition
iso-u lines  iso-v lines

u  v
18
19
Least Square Conformal Map
Only developable surfaces admit a conformal paramterization.
For general (non-developable) surface, LSCM minimizes an energy ELSCM
that corresponds to the non-conformality of the application
Mimizing a
quadratic
form
ELSCM is invariant to translation and rotation in the parametric space. To
have a unique minimizer, it is required to fixed at least two vertices.
From [Levy et al.2002], if the pinned vertices are chosen on the boundary,
all the triangles are consistently oriented (no flips).
20
Quadratic Optimization
Quadratic form:
a polynomial function that the degree is not larger than two.
G is symmetric
Minimizer occurs at its stationary point:
21
Least Square
(m > n)
Minimize the sum of residuals:
F is a quadratic form
Minimizer found at stationary point
22
Least Square with Reduced D.O.F.
Free parameters x  x  x 
 x 
Lock parameters x  x
f
1
l
nf 1
nf
n
23
0
3
0
0
a
b
1
1
2
2
2
2









-AaRMa
ELSCM
AaMa
0
c
3
2
3
1
 v0 
 u0 
 v0 
 u0 
 v0 
 u0 
 
 
 
 
 
 
 Aa M a  v1   RM a  u1   Ab M b  v2   RM b  u2   Ac M c  v3   RM c  u3 
v 
u 
v 
u 
v 
u 
 2
 2
 3
 3
 1
 1
u0 
 
  u1 
 u 
 2 
 u3 
   0
  v0 
  v1 
 
 v2
 
 v3 
Fixed vertices 1 & 2
(u1,v1) & (u2,v2) locked
2
u0 
 

 u3 

 v 

 0 

  v3 

   0

  u1 

 u2 

 

 v1
 24
Variable change columns swap 
 v2 


















Af
Af
Al


 u

 0 



 u3



 

  v0 



  v3 





u0 
 
 u3 
 v 
 0 
  v3 
   0
  u1 
 u2 
 
 v1
 
 v2 
Al

 u
 1 
 u 2 
 
  v1 
  v2 


25
ELSCM is invariant to translation and rotation in the parametric space. To
have a unique minimizer, it is required to fixed at least two vertices.
26
27
Angle-Based Flattening (ABF)
[Sheffer & de Sturler 2000]
Constraints:
Constrained quadratic
optimization with equality
constraints
Nonlinear optimization
(wheel consistency)
Finding (ui,vi) coordinates, in terms of angles, a
Stable (ui,vi) to ai conversion
28
Wheel Consistency
sin b1 sin b 2 sin b 3  sin g 1 sin g 2 sin g 3  0
b3
sin b1 sin b 2 sin b 3  sin g 1 sin g 2 sin g 3
g2
sin b1 sin b 2 sin b 3


1
sin g 1 sin g 2 sin g 3
c
g3
a
b1
b b
2
g1
a
b
Sine law :

sin g 1 sin b1
sin b1 b

sin g 1 a
sin b1 sin b 2 sin b 3 b c a


   1
sin g 1 sin g 2 sin g 3 a b c
29
1963
1995
2003
2002
30
Other Issues
Segmentation and atlas
32
Model Segmentation
• Planar parameterization is only applicable to surfaces
with disk topology
• Closed surfaces and surfaces with genus greater than
zero have to be cut prior to planar parameterization
• Cut to reduce complexity (to reduce distortion)
• Cut introduce cross-cut discontinuities
• Segmentation technique (partition the surface into
multiple charts) and seam generaton technique
(introduce cuts into the surface but keep it as a single
chart)
33
Numerical Optimization
From “Mesh Parameterization,
Theory and Practice”,
Siggraph 2007 Coursenote
Sparse Linear System
SOR (successive over-relaxation)
• Simplest, both from the conceptual and the
implementation points of view
35
SOR (cont)
New Update Scheme:
Successive Over-Relaxation
1w<2
36
Other Methods
• Conjugate gradient method
• Sparse direct solvers (LU)
Summary
• SOR-like methods are easy to understand and
implement, but do not perform well for more than
10K variables
• Direct methods are most efficient, but consume
considerable amounts of memory
37
References
• “Polygon Mesh Processing”, Mario Botsch, Leif
Kobbelt, Mark Pauly, Pierre Alliez and Bruno
Levy, AK Peters, 2010
• “Mesh Parameterization: Theory and Practice”,
Kai Hormann, Bruno Lévy and Alla Sheffer, ACM
SIGGRAPH Course Notes, 2007
• “Least Squares Conformal Maps for Automatic
Texture Atlas Generation”, Bruno Lévy, Sylvain
Petitjean, Nicolas Ray and Jérome Maillot, ACM
SIGGRAPH conference proceedings, 2002
38
a0,0u0  a0,1u1  a0, 2u2  a0,3u3  a0, 4u4  a0,5u5  a0, 6u6  a0, 7u7  0
a1, 0u0  a1,1u1  a1, 2u2  a1,3u3  a1, 4u4  a1,5u5  a1, 6u6  a1, 7u7  0
a2, 0u0  a2,1u1  a2, 2u2  a2,3u3  a2, 4u4  a2,5u5  a2,6u6  a2, 7u7  0
a3, 0u0  a3,1u1  a3, 2u2  a3,3u3  a3, 4u4  a3,5u5  a3,6u6  a3, 7u7  0












Ai
BACK
Ab
 u0 
 u 
 1 
 u2 
 
 u3   0
 u4 
 
 u 5 
 u 
 6 
 u7 






Ai
 u0 

 u 

1
    
 u2 

 

u
 3 

Ab
 u4 
 u 
 5 
 u6 
 
 u7 
39
[From Siggraph Course 2007]
Study inverse of parameterization (X,Y)  (u,v)
u ( X , Y )  li ui  l j u j  lk uk

 v( X , Y )  li vi  l j v j  lk vk
(li, lj, lk) barycentric coordinates, computed as:
40

u ( X , Y )  li ui  l j u j  lk uk  ui

u
 ui
X
uj

1 
uk
2T 


Similarly, we can get

 1 
 2T

uj
 li 
uk l j   ui
lk 
 ui 
u j 
uk 


uj

1 
uk
2T 


 X 
Y 
 
  1 
u
Y
u=
MT solely depends on the geometry of the triangle T
BACK
41
Download