Download as pdf or txt
Download as pdf or txt
You are on page 1of 65

Surface

Reconstruction:
Part II
Surface Reconstruction
Today:

Scanning
devices

Implicit
Registration
reconstruction

physical acquired reconstructed


model point cloud
p model

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

Connect sample points by triangles


Exact interpolation
p of sample
p p points
Bad for noisy or misaligned data
Can lead to holes or non
non-manifold
manifold situations

10
Implicit
p Reconstruction Methods

Estimate signed distance function (SDF)


Extract zero iso-surface
Approximation of input points
Watertight manifold results by construction
Can have spurious components

11
Input Implicit Explicit

12
Implicit Function Approach

13
Implicit Function Approach

Define a function
f : R3 R

with value < 0 outside


the shape and > 0
inside

<0 0 >0
14
Implicit Function Approach

Define a function
f : R3 R
with value < 0 outside
the shape and > 0 inside

Extract the zero


zero-set
set

{ 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

Use BSP tree


Binaryy space
p partitioningg tree
p
Recursively partition 3D space by planes
Tree should be balanced, put plane at median
log(n) tree levels, complexity O(log n)

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

Quad-tree (oct-tree) Kd-tree


Cells are squares (cubes) Cells are axis-aligned boxes

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)

Propagate normal orientation through graph


For neighbors pi,pj: Flip nj if niTnj < 0
Fails at sharp edges/corners

Propagate along safe paths (parallel normals)


Minimum spanning tree with angle
angle-based
based edge weights
wij = 1- | niTnj |

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) =

Radial basis functions


Well suited for smooth interpolation
Sum of shifted, weighted kernel functions

35
Radial Basis Functions Interpolation

How do we find the weights?

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

Solve the system Kw = d for w


Implicit function is defined as:

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

B-Spline (compact support)

41
How Big is ?

Without normal length With normal length


validation
lid ti validation
lid ti

42
Examples

43
Comparison

Distance Compact RBF Global RBF


to plane Triharmonic

44
Complexity Issues
Solve the linear system for RBF weights
Hard to solve for large number of samples

Compactly supported RBFs


Sparse linear system
Efficient solvers

Greedy RBF fitting


Start with a few RBFs only
Add more RBFs in region of large error
45
Extracting the Surface

F(x) = 0 surface

F(x) < 0 inside

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

Generates HUGE meshes


Millions of polygons

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

You might also like