Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
04 - Normal Estimation, Curves
Acknowledgements: Olga Sorkine-Hornung
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Implicit Surface Reconstruction
• Implicit function from point clouds
• Need consistently oriented normals
< 0 > 00
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Estimation
• 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)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
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:
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
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:
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Linear Least Squares?
x
y
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Linear Least Squares?
• Find a line y = ax+b s.t.
x
y
• But we would like true orthogonal distances!
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Best Fit with SSD
x
y
xʹ
yʹ
SSD = sum of squared distances (or differences)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
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)
x y
z
x
yxʹ
yʹ
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Notations
• Input points:
• Looking for a (hyper) plane passing through c with normal n s.t.
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Notations
• Input points:
• Centroid:
• Vectors from the centroid:
m
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Centroid: 0-dim Approximation
• It can be shown that:
• m minimizes SSD • m will be the origin of
the (hyper)-plane • Our problem becomes:
m
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Hyperplane Normal
• Minimize!
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Hyperplane Normal
• Minimize!
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Hyperplane Normal
• Constrained minimization – Lagrange multipliers
Matrix Cookbook! https://archive.org/details/imm3274
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Hyperplane Normal
• Constrained minimization – Lagrange multipliers
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Hyperplane Normal
• Constrained minimization – Lagrange multipliers
What can be said about n ??
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Hyperplane Normal
• Constrained minimization – Lagrange multipliers
n is the eigenvector of S with the smallest eigenvalue
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
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
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
What does the 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 xʹi is:
Original set Small variance Large variance
l l l l
vm
xi
xʹil
yi
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
What does the Scatter Matrix do?
Original set Small variance Large variance
l l l l
vm
xi
xʹil
yi
● The scatter matrix measures the variance of our data points along the direction v
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
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.
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Principal Components
• There’s no preferable direction • S looks like this:
• Any vector is an eigenvector
● There’s a clear preferable direction
● S looks like this:
▪ µ is close to zero, much smaller than λ
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Orientation
• PCA may return arbitrarily oriented eigenvectors
• Wish to orient consistently
• Neighboring points should have similar normals
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Normal Orientation
• Build graph connecting neighboring points • Edge (i,j) exists if xi ∈ kNN(xj) or xj ∈ kNN(xi)
• Propagate normal orientation through graph • For neighbors xi, xj : Flip nj if niTnj < 0 • Fails at sharp edges/corners
• Propagate along “safe” paths (parallel tangent planes) • Minimum spanning tree with angle-based edge weights
“Surface reconstruction from unorganized points”, Hoppe et al., SIGGRAPH 1992http://research.microsoft.com/en-us/um/people/hoppe/recon.pdf
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Elementary Differential Geometry
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Differential Geometry – Motivation
• Describe and analyze geometric characteristics of shapes • e.g. how smooth?
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Differential Geometry – Motivation
• Describe and analyze geometric characteristics of shapes • e.g. how smooth? • how shapes deform
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Differential Geometry Basics
• Geometry of manifolds
• Things that can be discovered by local observation: point + neighborhood
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Differential Geometry Basics
• Geometry of manifolds
• Things that can be discovered by local observation: point + neighborhood
manifold point
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Differential Geometry Basics
• Geometry of manifolds
• Things that can be discovered by local observation: point + neighborhood
manifold point
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Differential Geometry Basics
• Geometry of manifolds
• Things that can be discovered by local observation: point + neighborhood
manifold pointcontinuous 1-1 mapping
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Differential Geometry Basics
• Geometry of manifolds
• Things that can be discovered by local observation: point + neighborhood
manifold pointcontinuous 1-1 mapping non-manifold point
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Differential Geometry Basics
• Geometry of manifolds
• Things that can be discovered by local observation: point + neighborhood
manifold pointcontinuous 1-1 mapping non-manifold point
x
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Differential Geometry Basics
• Geometry of manifolds
• Things that can be discovered by local observation: point + neighborhood
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Differential Geometry Basics
• Geometry of manifolds
• Things that can be discovered by local observation: point + neighborhood
continuous 1-1 mapping
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Differential Geometry Basics
• Geometry of manifolds
• Things that can be discovered by local observation: point + neighborhood
continuous 1-1 mapping
u
v
If a sufficiently smooth mapping can be constructed, we can look at its first and second derivatives
Tangents, normals, curvatures, curve angles
Distances, topology
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Curves
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
How do we model shapes?
Delcam Plc. [CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0) or GFDL (http://www.gnu.org/copyleft/fdl.html)], via Wikimedia Commons
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Building blocks: curves and surfaces
By Wojciech mula at Polish Wikipedia, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=9853555
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Keynote Demo
CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo
Blender Demo
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Modeling curves• We need mathematical concepts to characterize the desired curve
properties
• Notions from curve geometry help with designing user interfaces for curve creation and editing
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
2D parametric curve• must be continuous
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
A curve can be parameterized in many different ways
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Tangent vector
Parametrizat
ion-indepen
dent!
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Arc length• How long is the curve between and ? How far does the particle
travel?
• Speed is , so:
• Speed is nonnegative, so is non-decreasing
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Arc length parameterization• Every curve has a natural parameterization:
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Arc length parameterization• Every curve has a natural parameterization:
• Isometry between parameter domain and curve
• Tangent vector is unit-length:
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Curvature• How much does the curve turn per unit ?
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Curvature• How much does the curve turn per unit ?
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Curvature profile
• Given , we can get up to a constant by integration. Integrating
reconstructs the curve up to rigid motion.
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Curvature of a circle• Curvature of a circle:
Osculating circle
= Unit Normal
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Frenet Frame
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Curvature normal• Points inward
• useful for evaluating curve quality
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
SmoothnessTwo kinds, parametric and geometric:
Parametrization-Independent
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Smoothness example
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Recap on parametric curves
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Turning• Angle from start tangent to end tangent:
• If curve is closed, the tangent at the beginning is the same as the tangent at the end
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Turning numbers
• measures how many full turns the tangent makes.
1 –1 2 0
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Gauss map
• Point on curve maps to point on unit circle.
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Space curves (3D)• In 3D, many vectors are orthogonal to T
• are the “Frenet frame”
• is torsion: non-planarity
N
T
B
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Discrete Differential Geometry of Curves
Some references: see http://ddg.cs.columbia.edu/
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Discrete Planar Curves
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Discrete Planar Curves
• Piecewise linear curves • Not smooth at vertices • Can’t take derivatives
• Generalize notions fromthe smooth world forthe discrete case!
• There is no one single way
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Tangents, Normals
• For any point on the edge, the tangent is simply the unit vector along the edge and the normal is the perpendicular vector
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Tangents, Normals
• For vertices, we have many options
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Tangents, Normals
• Can choose to average the adjacent edge normals
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Tangents, Normals
• Weight by edge lengths
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Inscribed Polygon, p• Connection between discrete and smooth
• Finite number of verticeseach lying on the curve, connected by straight edges.
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
p1
p2p3
p4
The Length of a Discrete Curve
• Sum of edge lengths
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
The Length of a Continuous Curve
• Take limit over a refinement sequence
h = max edge length
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Curvature of a Discrete Curve
• Curvature is the change in normal direction as we travel along the curve
no change along each edge – curvature is zero along edges
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Curvature of a Discrete Curve
• Curvature is the change in normal direction as we travel along the curve
normal changes at vertices – record the turning angle!
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Curvature of a Discrete Curve
• Curvature is the change in normal direction as we travel along the curve
normal changes at vertices – record the turning angle!
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Curvature of a Discrete Curve
• Curvature is the change in normal direction as we travel along the curve
same as the turning anglebetween the edges
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Curvature of a Discrete Curve
• Zero along the edges
• Turning angle at the vertices = the change in normal direction
α1, α2 > 0, α3 < 0
α1 α2
α3
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Total Signed Curvature
• Sum of turning angles
α1 α2
α3
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Discrete Gauss Map
• Edges map to points, vertices map to arcs.
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Discrete Gauss Map
• Turning number well-defined for discrete curves.
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Discrete Turning Number Theorem
• For a closed curve, the total signed curvature is an integer multiple of 2π. • proof: sum of exterior angles
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Turning Number TheoremContinuous world Discrete world
k:
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Curvature is scale dependent
is scale-independent
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Discrete Curvature – Integrated Quantity!
• Cannot view αi as pointwise curvature
• It is integrated curvature over a local area associated with vertex i
α1 α2
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Discrete Curvature – Integrated Quantity!
• Integrated over a local area associated with vertex i α1 α2
A1
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Discrete Curvature – Integrated Quantity!
• Integrated over a local area associated with vertex i α1 α2
A1 A2
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Discrete Curvature – Integrated Quantity!
• Integrated over a local area associated with vertex i α1 α2
A1 A2
The vertex areas Ai form a covering of the curve.They are pairwise disjoint (except endpoints).
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Structure Preservation
• Arbitrary discrete curve • total signed curvature obeys
discrete turning number theorem • even coarse mesh (curve) • which continuous theorems to preserve?
• that depends on the application…
discrete analogue of continuous theorem
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Convergence
• Consider refinement sequence • length of inscribed polygon approaches length of smooth curve • in general, discrete measure approaches continuous analogue • which refinement sequence?
• depends on discrete operator • pathological sequences may exist
• in what sense does the operator converge? (pointwise, L2; linear, quadratic)
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Recap
ConvergenceStructure- preservation
In the limit of a refinement sequence, discrete measures of length and curvature agree with continuous measures.
For an arbitrary (even coarse) discrete curve, the discrete measure of curvature obeys the discrete turning number theorem.
CSCI-GA.3033-018 - Geometric Modeling - Daniele Panozzo
Thank you