shape modeling and geometry processing
TRANSCRIPT
![Page 1: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/1.jpg)
Shape Modeling and
Geometry Processing
Surface Reconstruction
252-0538-00L, Spring 2017
3/1/2018
![Page 2: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/2.jpg)
Scanning:results in
range images
Registration:bring all range
images to one
coordinate
system
Reconstruction:Integration of scans into a
single mesh
Postprocess:• Topological and
geometric
filtering
• Remeshing
• Compression
Geometry Acquisition Pipeline
3/1/2018 Roi Poranne 2
![Page 3: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/3.jpg)
Problem Statement
𝑀1 ≈ 𝑇 𝑀2
𝑇: Translation + Rotation
𝑀1 𝑀2
3/1/2018 Roi Poranne 3
![Page 4: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/4.jpg)
Problem Statement
𝑀1 ≈ 𝑇 𝑀2
𝑇: Translation + Rotation
𝑀1 𝑀2
3/1/2018 Roi Poranne 4
![Page 5: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/5.jpg)
Problem Statement
𝑀1 𝑀2
Given 𝑀1, … ,𝑀𝑛 find 𝑇2, … , 𝑇𝑛 such that
𝑀1 ≈ 𝑇2 𝑀2 ≈⋯ ≈ 𝑇𝑛 𝑀𝑛
3/1/2018 Roi Poranne 5
![Page 6: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/6.jpg)
Correspondences
How many points are needed to define a
unique rigid transformation?
The first problem is finding pairs!
3/1/2018 Roi Poranne 6
![Page 7: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/7.jpg)
ICP: Iterative Closest Point
Intuition:
Correct correspondences ⇒ problem solved!
Idea:
(1) Find correspondences
(2) Use them to find a transformation
3/1/2018 Roi Poranne 7
![Page 8: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/8.jpg)
ICP: Iterative Closest Point
Intuition:
Correct correspondences ⇒ problem solved!
Idea:
(1) Find correspondences
(2) Use them to find a transformation
3/1/2018 Roi Poranne 8
![Page 9: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/9.jpg)
ICP: Iterative Closest Point
Intuition:
Correct correspondences ⇒ problem solved!
Idea:
(1) Find correspondences
(2) Use them to find a transformation
3/1/2018 Roi Poranne 9
![Page 10: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/10.jpg)
ICP: Iterative Closest Point
Intuition:
Correct correspondences ⇒ problem solved!
Idea:
Iterate
(1) Find correspondences
(2) Use them to find a transformation
3/1/2018 Roi Poranne 10
![Page 11: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/11.jpg)
ICP: Iterative Closest Point
This algorithm converges to the correct solution
if the starting scans are “close enough”
3/1/2018 Roi Poranne 11
![Page 12: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/12.jpg)
Basic Algorithm
Select (e.g., 1000) random points
Match each to closest point on other scan
Reject pairs with distance too big
Minimize
closed form solution in:
http://dl.acm.org/citation.cfm?id=250160
3/1/2018 Roi Poranne 12
![Page 13: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/13.jpg)
Scanning:results in
range images
Registration:bring all range
images to one
coordinate
system
Reconstruction:Integration of scans into a
single mesh
Postprocess:• Topological and
geometric
filtering
• Remeshing
• Compression
Geometry Acquisition Pipeline
# 133/1/2018 Roi Poranne
![Page 14: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/14.jpg)
4G sample points → 8M triangles1G sample points → 8M triangles
Digital Michelangelo Project
# 143/1/2018 Roi Poranne
![Page 15: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/15.jpg)
Input to Reconstruction Process
Point cloud Point cloudOriented
3/1/2018 Roi Poranne # 15
![Page 16: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/16.jpg)
How to Connect the Dots?
Explicit reconstruction:
Connect sample points by triangles
# 16
“Zippered Polygon Meshes from Range Images”, Greg Turk and Marc Levoy, ACM SIGGRAPH 1994
3/1/2018 Roi Poranne
![Page 17: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/17.jpg)
How to Connect the Dots?
Explicit reconstruction:
Connect sample points by triangles
# 17
“Zippered Polygon Meshes from Range Images”, Greg Turk and Marc Levoy, ACM SIGGRAPH 1994
3/1/2018 Roi Poranne
![Page 18: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/18.jpg)
How to Connect the Dots?
Explicit reconstruction:
Connect sample points by triangles
# 18
Problems:
▪ Bad for noisy or
misaligned data
▪ Can lead to holes or
non-manifold
situations
3/1/2018 Roi Poranne
![Page 19: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/19.jpg)
How to Connect the Dots?
Implicit reconstruction:
estimate a signed distance function (SDF)
extract zero set
# 193/1/2018 Roi Poranne
![Page 20: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/20.jpg)
How to Connect the Dots?
Implicit reconstruction:
estimate a signed distance function (SDF)
extract zero set
# 203/1/2018 Roi Poranne
![Page 21: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/21.jpg)
Implicit Curves and Surfaces
3/1/2018 Roi Poranne 21
![Page 22: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/22.jpg)
Implicit Curves and Surfaces
● Zero set of a scalar function
▪ Curve in 2D:
▪ Surface in 3D:
● Space partitioning
3/1/2018 Roi Poranne 22
Outside
Curve/Surface
Inside
![Page 23: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/23.jpg)
Implicit Curves and Surfaces
● Zero set of a scalar function
▪ Curve in 2D:
▪ Surface in 3D:
● Zero level set of
signed distance function
3/1/2018 Roi Poranne 23
![Page 24: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/24.jpg)
Implicit Curves and Surfaces
● Implicit circle and sphere
3/1/2018 Roi Poranne 24
![Page 25: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/25.jpg)
How to Connect the Dots?
Implicit reconstruction:
estimate a signed distance function (SDF)
extract zero set
# 253/1/2018 Roi Poranne
![Page 26: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/26.jpg)
How to Connect the Dots?
Implicit reconstruction:
estimate a signed distance function (SDF)
extract zero set
# 263/1/2018 Roi Poranne
![Page 27: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/27.jpg)
How to Connect the Dots?
Implicit reconstruction:
estimate a signed distance function (SDF)
extract zero set
# 27
< 0 > 00
Advantages:
▪ Approximation of input
points
▪ Watertight manifold
results by construction
3/1/2018 Roi Poranne
![Page 28: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/28.jpg)
Implicit vs. Explicit
# 28
Input ImplicitExplicit
3/1/2018 Roi Poranne
![Page 29: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/29.jpg)
SDF from Points and Normals
Compute signed distance to the tangent
plane of the closest point
# 29
- +
“Surface reconstruction from unorganized points”, Hoppe et al., ACM SIGGRAPH 1992
http://research.microsoft.com/en-us/um/people/hoppe/proj/recon/
Normals will help to
distinguish between
inside and outside
3/1/2018 Roi Poranne
![Page 30: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/30.jpg)
SDF from Points and Normals
Compute signed distance to the tangent
plane of the closest point
# 303/1/2018 Roi Poranne
![Page 31: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/31.jpg)
SDF from Points and Normals
Compute signed distance to the tangent
plane of the closest point
# 31
Problem?
The function will be discontinuous
Note: The Hoppe92 paper computes the tangent planes slightly
differently (by PCA on k-nearest-neighbors of each data point, see next
class), but the consequences are still the same. 3/1/2018 Roi Poranne
![Page 32: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/32.jpg)
Approximate SDF
Pose problem as scattered data interpolation
Find a smooth 𝐹
𝐹 𝐩𝑖 = 0
Avoid trivial solution 𝐹 𝐱 = 0
0
0
0 0
“Reconstruction and representation of 3D objects with radial basis functions”, Carr et al., ACM SIGGRAPH 2001
# 32
Add more constraints𝐹 𝐱
3/1/2018 Roi Poranne
![Page 33: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/33.jpg)
Approximate SDF
Pose problem as scattered data interpolation
Fina a smooth 𝐹
𝐹 𝐩𝑖 = 0
Avoid trivial solution 𝐹 𝐱 = 0
0
0
0 0
“Reconstruction and representation of 3D objects with radial basis functions”, Carr et al., ACM SIGGRAPH 2001
# 33
Add more constraints𝐹 𝐱
3/1/2018 Roi Poranne
![Page 34: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/34.jpg)
Radial Basis Function Interpolation
RBF
Weighted sum of shifted kernels
Scalar weights
Unknowns
Kernel /basis function
# 34
Centers
3/1/2018 Roi Poranne
![Page 35: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/35.jpg)
Radial Basis Function Interpolation
Interpolate the constraints:
0
0
0 0
# 35
Set centers at:
Find 𝑤𝑚
where
3/1/2018 Roi Poranne
![Page 36: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/36.jpg)
Radial Basis Function Interpolation
Solve linear system to get the weights:
# 363/1/2018 Roi Poranne
![Page 37: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/37.jpg)
RBF Kernels
Triharmonic:
Globally supported
Leads to dense symmetric linear system
C2 smoothness
Works well for highly irregular sampling
# 373/1/2018 Roi Poranne
![Page 38: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/38.jpg)
RBF Kernels
Thin plate spline (polyharmonic)
Multiquadratic
Gaussian
B-Spline (compact support)
# 383/1/2018 Roi Poranne
![Page 39: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/39.jpg)
Distance
to plane
Local RBF Global RBF
Triharmonic
Comparison of the various SDFs so far
# 393/1/2018 Roi Poranne
![Page 40: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/40.jpg)
RBF Reconstruction Examples
“Reconstruction and representation of 3D objects with radial basis functions”, Carr et al., ACM SIGGRAPH 2001
# 403/1/2018 Roi Poranne
![Page 41: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/41.jpg)
Off-Surface Points
Insufficient number/
badly placed off-surface points
Properly chosen off-surface points
“Reconstruction and representation of 3D objects with radial basis functions”, Carr et al., ACM SIGGRAPH 2001
# 41
Must pick the correct 𝜀
3/1/2018 Roi Poranne
![Page 42: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/42.jpg)
RBF – Discussion
Pros: Global definition
● Single function
● Globally optimal
Cons: Global definition
● Global optimization – slow
● Why is global better?
# 423/1/2018 Roi Poranne
![Page 43: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/43.jpg)
Moving Least Squares (MLS)
Do purely local approximation of the SDF
Weights change depending on where we are evaluating
0
0
0 0
“Interpolating and Approximating Implicit Surfaces from Polygon Soup”, Shen et al.,
ACM SIGGRAPH 2004
http://graphics.berkeley.edu/papers/Shen-IAI-2004-08/index.html # 433/1/2018 Roi Poranne
![Page 44: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/44.jpg)
Moving Least Squares (MLS)
Do purely local approximation of the SDF
Weights change depending on where we are evaluating
0
0
0 0
“Interpolating and Approximating Implicit Surfaces from Polygon Soup”, Shen et al.,
ACM SIGGRAPH 2004
http://graphics.berkeley.edu/papers/Shen-IAI-2004-08/index.html # 443/1/2018 Roi Poranne
![Page 45: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/45.jpg)
Moving Least Squares (MLS)
Do purely local approximation of the SDF
Weights change depending on where we are evaluating
0
0
0 0
“Interpolating and Approximating Implicit Surfaces from Polygon Soup”, Shen et al.,
ACM SIGGRAPH 2004
http://graphics.berkeley.edu/papers/Shen-IAI-2004-08/index.html # 453/1/2018 Roi Poranne
![Page 46: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/46.jpg)
Moving Least Squares (MLS)
Do purely local approximation of the SDF
Weights change depending on where we are evaluating
0
0
0 0
“Interpolating and Approximating Implicit Surfaces from Polygon Soup”, Shen et al.,
ACM SIGGRAPH 2004
http://graphics.berkeley.edu/papers/Shen-IAI-2004-08/index.html # 463/1/2018 Roi Poranne
![Page 47: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/47.jpg)
Moving Least Squares (MLS)
Do purely local approximation of the SDF
Weights change depending on where we are evaluating
0
0
0 0
“Interpolating and Approximating Implicit Surfaces from Polygon Soup”, Shen et al.,
ACM SIGGRAPH 2004
http://graphics.berkeley.edu/papers/Shen-IAI-2004-08/index.html # 47
The challenge: Make it smooth
3/1/2018 Roi Poranne
![Page 48: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/48.jpg)
Least-Squares Approximation
Polynomial least-squares approximation
Find a that minimizes sum of squared differences
# 483/1/2018 Roi Poranne
![Page 49: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/49.jpg)
MLS – 1D Example
● Global approximation in
# 493/1/2018 Roi Poranne
![Page 50: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/50.jpg)
Least-Squares Approximation
Polynomial least-squares approximation
# 50
Find a that minimizes sum of squared differencesweighted
3/1/2018 Roi Poranne
![Page 51: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/51.jpg)
MLS – 1D Example
● MLS approximation using functions in
# 513/1/2018 Roi Poranne
![Page 52: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/52.jpg)
Weight Functions
Gaussianh is a smoothing parameter
Wendland functionDefined in [0, h] and
Singular function
For small ε, weights are large near r=0 (interpolation)
# 523/1/2018 Roi Poranne
![Page 53: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/53.jpg)
Dependence on Weight Function
Global least squares
with linear basis
MLS with (nearly)
singular weight function
MLS with approximating
weight function
# 533/1/2018 Roi Poranne
![Page 54: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/54.jpg)
Dependence on Weight Function
The MLS function F is continuously
differentiable if and only if the weight
function θ is continuously differentiable
In general, F is as smooth as θ
# 543/1/2018 Roi Poranne
![Page 55: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/55.jpg)
Example: Reconstruction
# 553/1/2018 Roi Poranne
![Page 56: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/56.jpg)
MLS SDF – Possible Improvement
● Point constraints vs. true normal constraints
● Details: see [Shen et al. SIGGRAPH 2004] and the bonus
assignment in Ex2
# 563/1/2018 Roi Poranne
![Page 57: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/57.jpg)
Extracting the Surface
How to find a mesh of the level set?
Imag
e fr
om
:
ww
w.f
arfi
eld
techno
logy.c
om
F(x) > 0
outside
F(x) = 0
surface
F(x) < 0
inside
# 573/1/2018 Roi Poranne
![Page 58: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/58.jpg)
Sample the SDF
# 583/1/2018 Roi Poranne
![Page 59: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/59.jpg)
Sample the SDF
# 593/1/2018 Roi Poranne
![Page 60: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/60.jpg)
+
- -
-
3/1/2018 Roi Poranne
![Page 61: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/61.jpg)
3/1/2018 Roi Poranne
![Page 62: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/62.jpg)
Sample the SDF
# 623/1/2018 Roi Poranne
![Page 63: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/63.jpg)
Marching Squares
16 different configurations in 2D
4 classes (rotation, reflection, negation)
… …
# 633/1/2018 Roi Poranne
![Page 64: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/64.jpg)
Tessellation in 2D
4 classes (rotation, reflection, negation)
?
# 643/1/2018 Roi Poranne
![Page 65: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/65.jpg)
Tessellation in 2D
Case 4 is ambiguious:
Always pick consistently
# 653/1/2018 Roi Poranne
![Page 66: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/66.jpg)
3D: Marching Cubes
Layer k+1
Layer k
# 663/1/2018 Roi Poranne
![Page 67: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/67.jpg)
Layer k+1
Layer k
Marching Cubes
● Marching Cubes (Lorensen and Cline 1987)
1. Load 4 layers of the grid
into memory
2. Create a cube whose
vertices lie on the two
middle layers
3. Classify the vertices of
the cube according to the
implicit function (inside,
outside or on the surface)
# 673/1/2018 Roi Poranne
![Page 68: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/68.jpg)
Marching Cubes
4. Compute case index. We have 28= 256 cases (0/1 for
each of the eight vertices) – can store as 8 bit (1 byte)
index.
e1
e4
e9 e10
e5
e6
v1
v6
0 0 0 0 0 01 1index = = 33
e1
e4
e9 e10
e5
e6
v2
v6
e2
e3
e7
e8
e11e12
v3v4
v1
v5
v7v8
v1index = v2 v3 v4 v5 v6 v7 v8
# 683/1/2018 Roi Poranne
![Page 69: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/69.jpg)
Marching Cubes
● Unique cases (by rotation, reflection and negation)
# 693/1/2018 Roi Poranne
![Page 70: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/70.jpg)
Tessellation3D – Marching Cubes
5. Using the case index, retrieve the connectivity in the
look-up table
● Example: the entry for index 33 in the look-up table
indicates that the cut edges are e1; e4; e5; e6; e9 and
e10 ; the output triangles are (e1; e9; e4) and (e5; e10;
e6).
e1
e4
e9 e10
e5
e6
v1
v6
0 0 0 0 0 01 1index = = 33
# 703/1/2018 Roi Poranne
![Page 71: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/71.jpg)
Marching Cubes
6. Compute the position of the cut vertices by linear
interpolation:
7. Move to the next cube
# 713/1/2018 Roi Poranne
![Page 72: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/72.jpg)
Marching Cubes – Problems
● Have to make consistent choices for
neighboring cubes – otherwise get holes
3 3–
# 723/1/2018 Roi Poranne
![Page 73: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/73.jpg)
Marching Cubes – Problems
● Resolving ambiguities
Ambiguity No Ambiguity
# 733/1/2018 Roi Poranne
![Page 74: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/74.jpg)
Images from: “Dual Marching Cubes: Primal Contouring of Dual Grids”by Schaeffer et al.
Marching Cubes – Problems
● Grid not adaptive
● Many polygons required to represent
small features
# 743/1/2018 Roi Poranne
![Page 76: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/76.jpg)
Marching Cubes – Problems
Problems with short triangle edges
When the surface intersects the cube close to a corner, the
resulting tiny triangle doesn‘t contribute much area to the mesh
When the intersection is close to an edge of the cube, we get
skinny triangles (bad aspect ratio)
Triangles with short edges waste resources but don‘t
contribute to the surface mesh representation
# 763/1/2018 Roi Poranne
![Page 77: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/77.jpg)
Grid Snapping
Solution: threshold the distances between the created
vertices and the cube corners
When the distance is smaller than dsnap we snap the vertex
to the cube corner
If more than one vertex of a triangle is snapped to the
same point, we discard that triangle altogether
3/1/2018 Roi Poranne 77
![Page 78: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/78.jpg)
Grid Snapping
With grid snapping one can obtain significant reduction of
space consumption
dsnap 0 0,1 0,2 0,3 0,4 0,46 0,495
Vertices 1446 1398 1254 1182 1074 830 830
Reduction (%) 0 3,3 13,3 18,3 25,7 42,6 42,6
# 783/1/2018 Roi Poranne
![Page 79: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/79.jpg)
Global RBF vs. Local MLS
RBF:
sees the whole data set, can make for very
smooth surfaces
global (dense) system to solve – expensive
MLS:
sees only a small part of the dataset, can get
confused by noise
local linear solves – cheap
# 793/1/2018 Roi Poranne
![Page 80: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/80.jpg)
Poisson Surface Reconstruction
Very popular modern method, code available: M.
Kazhdan, M. Bolitho and H. Hoppe, Symposium on
Geometry Processing 2006http://www.cs.jhu.edu/~misha/Code/PoissonRecon/
Global fitting of an indicator function using PDE
Robust to noise, sparse, computationally tractable
You will try out the code in Ex2 and compare with
MLS results
# 803/1/2018 Roi Poranne
![Page 81: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/81.jpg)
Poisson Surface Reconstruction
Oriented points Indicator function
0
1
0
00
0
1
1
# 813/1/2018 Roi Poranne
![Page 82: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/82.jpg)
Poisson Surface Reconstruction
Oriented points Indicator function
0
1
0
00
0
1
1
We don’t know the indicator function
# 823/1/2018 Roi Poranne
![Page 83: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/83.jpg)
Poisson Surface Reconstruction
Oriented points Indicator gradient
0 0
0
0
0
0
Indicator function
0
1
0
00
0
1
1
But we can estimate its gradient! ☺
# 833/1/2018 Roi Poranne
![Page 84: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/84.jpg)
Poisson Surface Reconstruction
Oriented points Indicator gradient
0 0
0
0
0
0
Indicator function
0
1
0
00
0
1
1
Reconstruct χ by solving
the Poisson equation
# 843/1/2018 Roi Poranne
![Page 85: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/85.jpg)
Michelangelo’s David
• 215 million data points from
1000 scans
• 22 million triangle
reconstruction
• Compute time: 2.1 hours
(this was in year 2006)
• Peak Memory: 6600MB
# 853/1/2018 Roi Poranne
![Page 86: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/86.jpg)
David – Chisel marks
# 863/1/2018 Roi Poranne
![Page 87: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/87.jpg)
David – Drill Marks
# 873/1/2018 Roi Poranne
![Page 88: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/88.jpg)
David – Eye
# 883/1/2018 Roi Poranne
![Page 89: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/89.jpg)
Normal Estimation
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
Roi Poranne 893/1/2018
![Page 90: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/90.jpg)
Normal Estimation
Roi Poranne 90
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
3/1/2018
![Page 91: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/91.jpg)
Normal Estimation
Roi Poranne 91
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
3/1/2018
![Page 92: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/92.jpg)
Normal Estimation
Roi Poranne 92
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
3/1/2018
![Page 93: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/93.jpg)
Normal Estimation
Roi Poranne 93
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
3/1/2018
![Page 94: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/94.jpg)
Normal Estimation
Roi Poranne 94
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
3/1/2018
![Page 95: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/95.jpg)
Normal Estimation
Roi Poranne 95
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
3/1/2018
![Page 96: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/96.jpg)
Normal Estimation
Roi Poranne 96
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
3/1/2018
![Page 97: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/97.jpg)
Normal Estimation
Roi Poranne 97
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
3/1/2018
![Page 98: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/98.jpg)
Normal Estimation
Roi Poranne 98
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
3/1/2018
![Page 99: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/99.jpg)
Normal Estimation
Roi Poranne 99
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
3/1/2018
![Page 100: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/100.jpg)
Normal Estimation
Roi Poranne 100
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
3/1/2018
![Page 101: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/101.jpg)
Normal Estimation
Roi Poranne 101
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
3/1/2018
![Page 102: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/102.jpg)
Normal Estimation
Roi Poranne 102
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
Find consistent global
orientation by propagation
(spanning tree)
3/1/2018
![Page 103: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/103.jpg)
Normal Estimation
Roi Poranne 103
Assign a normal vector n at
each point cloud
point x
Estimate the direction by
fitting a local plane
Find consistent global
orientation by propagation
(spanning tree)
3/1/2018
![Page 104: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/104.jpg)
Local Plane Fitting
● For each point x in the
cloud, pick k nearest
neighbors or all points in
r-ball:
● Find a plane Π that
minimizes the sum of
square distances:
Roi Poranne 1043/1/2018
![Page 105: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/105.jpg)
Local Plane Fitting
● For each point x in the
cloud, pick k nearest
neighbors or all points in
r-ball:
● Find a plane Π that
minimizes the sum of
square distances:
Roi Poranne 1053/1/2018
![Page 106: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/106.jpg)
Linear Least Squares?
Roi Poranne 106
x
y
Find a line 𝑦 = 𝑎𝑥 + 𝑏 s.t.
3/1/2018
![Page 107: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/107.jpg)
Linear Least Squares?
Find a line 𝑦 = 𝑎𝑥 + 𝑏 s.t.
Roi Poranne 107
x
y
But we would like true orthogonal distances!
3/1/2018
![Page 108: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/108.jpg)
Roi Poranne 108
x
y
x
y
3/1/2018
Principle Component Analysis (PCA)
![Page 109: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/109.jpg)
Principle Component Analysis (PCA)
PCA finds an orthogonal basis that best represents
a given data set
PCA finds the best approximating
line/plane/orientation… (in terms of distances2)
Roi Poranne 109
x y
z
x
y
x
y
3/1/2018
![Page 110: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/110.jpg)
Notations
Input points:
Looking for a (hyper) plane passing through c with normal n s.t.
c and n are variables
Roi Poranne 1103/1/2018
![Page 111: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/111.jpg)
Notations
Input points:
Centroid:
Vectors from the centroid:
Roi Poranne 111
m
3/1/2018
![Page 112: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/112.jpg)
Centroid: 0-dim Approximation
It can be shown that:
m will be the origin of the (hyper)-plane
Our problem becomes:
Roi Poranne 112
m
3/1/2018
![Page 113: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/113.jpg)
Hyperplane Normal
Minimize!
Roi Poranne 1133/1/2018
![Page 114: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/114.jpg)
Hyperplane Normal
Minimize!
Roi Poranne 1143/1/2018
![Page 115: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/115.jpg)
Hyperplane Normal
Constrained minimization – Lagrange multipliers
Roi Poranne 1153/1/2018
![Page 116: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/116.jpg)
Hyperplane Normal
Constrained minimization – Lagrange multipliers
Roi Poranne 1163/1/2018
![Page 117: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/117.jpg)
Hyperplane Normal
Constrained minimization – Lagrange multipliers
Roi Poranne 117
What can be said about n ??
3/1/2018
![Page 118: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/118.jpg)
Hyperplane Normal
Constrained minimization – Lagrange multipliers
Roi Poranne 118
n is the eigenvector of S
with the smallest
eigenvalue
3/1/2018
![Page 119: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/119.jpg)
Summary – Best Fitting Plane Recipe
● Input:
● Compute centroid = plane origin
● Compute scatter matrix
● The plane normal n is the eigenvector of S with
the smallest eigenvalue
Roi Poranne 1193/1/2018
![Page 120: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/120.jpg)
What does Scatter Matrix do?
● Let’s look at a line l through the center of mass m with direction
vector v, and project our points xi onto it. The variance of the
projected points xi is:
Roi Poranne 120
Original set Small variance Large variance
l l l l
vm
xi
xil
yi
3/1/2018
![Page 121: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/121.jpg)
What does Scatter Matrix do?
Roi Poranne 121
Original set Small variance Large variance
l l l l
vm
xi
xil
yi
● The scatter matrix measures the variance of
our data points along the direction v
3/1/2018
![Page 122: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/122.jpg)
Principal Components
Eigenvectors of S that correspond to big
eigenvalues are the directions in which the data
has strong components (= large variance).
If the eigenvalues are more or less the same,
there is no preferable direction.
Roi Poranne 122
The scatter matrix measures the variance of
the data points along the direction v
3/1/2018
![Page 123: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/123.jpg)
Principal Components
● There’s no preferable
direction
● S looks like this:
● Any vector is an
eigenvector
Roi Poranne 123
● There’s a clear preferable
direction
● S looks like this:
▪ is close to zero, much
smaller than
3/1/2018
![Page 124: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/124.jpg)
Normal Orientation
PCA may return arbitrarily
oriented eigenvectors
Need to orient consistently
Neighboring points should
have similar normals
Roi Poranne 1243/1/2018
![Page 125: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/125.jpg)
Build graph connecting neighboring pointsEdge (i,j) exists if xi ∈ kNN(xj) or xj∈ kNN(xi)
Propagate normal orientation through graphFor neighbors xi, xj : Flip nj if ni
Tnj < 0
▪ Fails at sharp edges/corners
● Propagate along “safe” paths (parallel normals)▪ Minimum spanning tree with angle-based edge
weights wij = 1- | niTnj |
Normal Orientation
Roi Poranne 125
“Surface reconstruction from unorganized points”, Hoppe et al., SIGGRAPH 1992
http://research.microsoft.com/en-us/um/people/hoppe/recon.pdf
3/1/2018
![Page 126: Shape Modeling and Geometry Processing](https://reader030.vdocuments.site/reader030/viewer/2022011923/61d8ad3df5a3f95de15973f1/html5/thumbnails/126.jpg)
Normal Orientation
Build graph connecting neighboring pointsEdge (i,j) exists if xi ∈ kNN(xj) or xj∈ kNN(xi)
Propagate normal orientation through graphFor neighbors xi, xj : Flip nj if ni
Tnj < 0
Fails at sharp edges/corners
Propagate along “safe” paths (parallel tangent planes)
Minimum spanning tree with angle-based edge weights
Roi Poranne 126
http://research.microsoft.com/en-us/um/people/hoppe/recon.pdf
3/1/2018