04 Surface Reconstruction
04 Surface Reconstruction
Reconstruction:
Part II
Surface Reconstruction
Today:
Scanning
devices
Implicit
Registration
reconstruction
2
Input
p Data
Set of range scans
Each scan is a regular quad- or tri-
mesh
Normal vectors are well defined
Scans registered in common
coordinate system
Set of irregular
g sample
p p points
Typically without normal vectors
More general
3
Shape Representations
Explicit
p representation
p
Image of parametrization
Implicit representation
Zero set of distance function
4
Implicit Representations
Level set of 2D function defines 1D curve
5
Explicit / Implicit
Explicit representation
Image of parameterization
Easy to find points on shape
Can
C d defer
f problems
bl to param
domain
Implicit representation
Zero set of distance function
Easy in/out/distance test
Easy to handle different topologies
6
Implicit Representations
Easy to handle different topologies
7
8
Implicit Representations
General implicit
p
function:
Interior: F(x,y,z)
( ,y, ) < 0
Exterior:F(x,y,z) > 0
Surface: F(x,y,z) = 0
Special case
Signed distance function
(SDF)
9
Explicit
p Reconstruction Methods
10
Implicit
p Reconstruction Methods
11
Input Implicit Explicit
12
Implicit Function Approach
13
Implicit Function Approach
Define a function
f : R3 R
<0 0 >0
14
Implicit Function Approach
Define a function
f : R3 R
with value < 0 outside
the shape and > 0 inside
{ x : f ( x) = 0}
<0 0 >0
15
Signed Distance Function
Construct SDF from p
point samples
p
Distance to points is not enough
Need inside/outside
/ information
Reconstruct normal vectors first
+ -
16
Normal Estimation
To find normal ni for each sample point pi
1. Examine local neighborhood for each point
Set of k nearest neighbors
2. Compute best approximating tangent plane
Covariance analysis
3. Determine normal orientation
pi
MST propagation
17
Normal Estimation
To find normal ni for each sample point pi
1. Examine local neighborhood for each point
Set of k nearest neighbors
2. Compute best approximating tangent plane
Covariance analysis
3. Determine normal orientation
MST propagation
18
Local Neighborhood
Find k nearest neighbors (kNN) of a point
Brute force: O(n) complexity
19
BSP Closest Points
PA A
D
F B C
D E F G
PB
PC
E
G
20
BSP Closest Points
A
PA
D
F B C
D E F G
PB
PC
E
G
21
BSP Closest Points
A
PA
D
F B C
D E F G
PB
PC
E
G
22
BSP Closest Points
A
PA
D
F B C
D E F G
PB
PC
E
G
23
BSP Closest Points
A
PA
D
F B C
D E F G
PB
PC
E
G
24
BSP Closest Points
Node::dist(Point
( x, Scalar& dmin))
{
if (leaf_node())
for each sample point p[i]
dmin = min(dmin, dist(x, p[i]));
else
{
d = dist_to_plane(x);
if (d < 0)
{
left_child->dist(x, dmin);
if (|d| < dmin) right_child->dist(x, dmin);
}
else
{
right_child->dist(x, dmin);
if (|d| < dmin) left_child->dist(x, dmin);
}
}
}
25
More Trees
26
Normal Estimation
Find normal ni for each sample point pi
1. Examine local neighborhood for each point
Set of k nearest neighbors
2. Compute best approximating tangent plane
Covariance analysis
3. Determine normal orientation
MST propagation
27
Principal Component Analysis
Fit a plane with center c and normal n to a set of
points {p1, ..., pm}
Minimize
Mi i i lleastt squares error
n
Subject to non
non-linear
linear constraint
c
pi
28
Principal Component Analysis
Plane center is barycenter
y of p
points
Normal is eigenvector
g w.r.t. smallest
eigenvalue of point covariance matrix
29
Normal Estimation
Find normal ni for each sample point pi
1. Examine local neighborhood for each point
Set of k nearest neighbors
2. Compute best approximating tangent plane
Covariance analysis
3. Determine normal orientation
MST propagation
30
Nave Orientation Propagation
31
Normal Orientation
Build
u d ggraph
ap co
connecting
ec g neighboring
e g bo g points
po s
Edge (ij) exists if pi kNN(pj) or pj kNN(pi)
32
SDF from Point & Normals
Signed distance from tangent planes
Points + normals determine local tangent planes
Use distance from closest centers tangent
g plane
p
Linear approximation in Voronoi cell
Simple and efficient, but SDF is only C-1
x
F ( x)
33
Smooth SDF Approximation
Scattered data interpolation problem
On-surface constraints dist(pi) = 0
Avoid trivial solution dist 0
Off-surface constraints dist(pi + ni) =
1
1
1
0 0
0
1
0
34
Smooth SDF Approximation
Scattered data interpolation problem
On-surface constraints dist(pi) = 0
Avoid trivial solution dist 0
Off-surface constraints dist(pi + ni) =
35
Radial Basis Functions Interpolation
36
Radial Basis Functions
2n equations
2n variables
The on- and off-surface points are the centers ci
37
Radial Basis Functions
2n equations
2n variables
The on- and off-surface points are the centers ci
0
K w d
38
Radial Basis Functions
39
RBF Basis Functions
Tri-harmonic basis functions
Globally supported
Leads to dense symmetric
y linear system
y
C2 smoothness
Provably smooth
Works well for highly irregular sampling
40
Other Radial Basis Functions
Polyharmonic spline
Multiquadratic
Gaussian
41
How Big is ?
42
Examples
43
Comparison
44
Complexity Issues
Solve the linear system for RBF weights
Hard to solve for large number of samples
F(x) = 0 surface
ology.com
Imagee from: www.farfieldtechno
F(x) > 0 outside
46
Sample the SDF
47
Sample the SDF
48
2D: Marching Squares
49
3D: Marching Cubes
Classify grid nodes as inside/outside
Classify cell: 28 configurations
Linear
i iinterpolation
l i along
l edges
d
Look-up table for patch configuration
Disambiguation more complicated
50
Marching Cubes
Cell classification:
Inside
Outside
Intersecting
51
256 cases 15 cases
Inversion
Marching Cubes Rotation
52
Marching Cubes
53
Marching Cubes Problems
Ambiguity
Holes
H l
54
Ambiguity
Separate pink
Separate blue
55
The Inversion Problem
Reduction from 256 to 15 cases includes
inversion
56
The Inversion Problem
Inversion
Mismatch Inversion
57
Ambiguity Solution
256 cases 23 cases
Rotation only
Always separate same color
Ambiguous faces triangulated consistently
8 new cases
58
Without Inversion
Match
59
Ambiguity
No
Ambiguity
60
Ambiguity No Ambiguity
61
Marching Cubes Issues
Grid not adaptive
Many polygons required to represent small
features
62
Images from: Dual Marching Cubes: Primal Contouring of Dual Grids by Schaeffer et al.
63
Beyond RBF
Poisson reconstruction
[Kazhdan 06]
64
Beyond RBF
Interactive approach
[Sharf, 2007]
65