1 numerical geometry of non-rigid shapes shortest path problems numerical geometry of non-rigid...
Post on 15-Jan-2016
224 views
TRANSCRIPT
1Numerical geometry of non-rigid shapes Shortest Path Problems
Numerical geometry of non-rigid shapes
Shortest path problems
Alexander Bronstein, Michael Bronstein, Ron Kimmel© 2007 All rights reserved
2Numerical geometry of non-rigid shapes Shortest Path Problems
Shortest path problem
Paris
Brussels
BernMunich
Prague
Vienna346
183 566
194285
504407
271
943
1146
1542902
3Numerical geometry of non-rigid shapes Shortest Path Problems
Shortest paths in graphs
Object is sampled at vertices
Approximated as undirected graph
Edges represent adjacent samples
Length function measures local length that can be
approximated as
Path in graph between two vertices and given by
Path length – sum of lengths of all edges
4Numerical geometry of non-rigid shapes Shortest Path Problems
Shortest paths in graphs
Approximate the intrinsic metric as the shortest path length in
graph
Alternative formulation: given a source point , compute the
distance function
Bellman’s principle of optimality: if is the shortest path
between and , and is a point on it, then the sub-paths
and are the shortest paths between and ,
and and , respectively.
5Numerical geometry of non-rigid shapes Shortest Path Problems
Shortest paths in graphs
Consequence: there exists some such that
How to select such a point ?
Since has to be the shortest distance,
Problem of computing is reduced to smaller sub-problems
of computing
Dynamic programming
6Numerical geometry of non-rigid shapes Shortest Path Problems
Dijkstra’s algorithm
Dynamic programming successive approximation procedure
Initially, set ; for the rest of the vertices, set
Mark all vertices as unprocessed
While there are still unprocessed vertices
Select with the smallest
Update all adjacent points
Mark as processed
Return the distance function
7Numerical geometry of non-rigid shapes Shortest Path Problems
Dijkstra’s algorithm
Every vertex is processed only once
Update step propagates distance to adjacent vertices
If the previously computed distance is shorter, value is not updated
Typically, there are vertices in the graph
Extraction of the minimum distance can be done in
using a heap
Total algorithm complexity
8Numerical geometry of non-rigid shapes Shortest Path Problems
Metrication error
“True” distance is
Distance measured in graph
Error persists, no matter how the sampling is refined
9Numerical geometry of non-rigid shapes Shortest Path Problems
Metrication error
No flaw in Dijkstra’s algorithm
The graph induced the metric, inconsistent with the Euclidean
metric
Problem can be resolved by changing the sampling
So far the path was restricted to graph edges
Represent the surface as a triangle mesh
Allow the path to pass on mesh faces
Fast marching – a “continuous Dijkstra”
algorithm
Numerical solution of the eikonal equation
10Numerical geometry of non-rigid shapes Shortest Path Problems
Fast marching
Dijkstra
Path restricted to graph
edges
Adjacent vertices are
updated
A vertex is updated from
another vertex
Fast marching
Path can pass on mesh
edges
Adjacent triangles are
updated
A vertex is updated from two
vertices within a triangle
11Numerical geometry of non-rigid shapes Shortest Path Problems
Fast marching update step
Given a triangle with vertices , ,
Given distances and
We need to compute
Model planar source described by
Wavefront propagates from the source
Hits at time
12Numerical geometry of non-rigid shapes Shortest Path Problems
Fast marching update step
From triangle geometry and ,
find the source parameters
Propagation direction: (1 DOF)
Offset: (1 DOF)
Solve
Quadratic equation with two solutions
corresponding to
Smallest solution is inconsistent
and is discarded
Compute
13Numerical geometry of non-rigid shapes Shortest Path Problems
Consistency & monotonicity
Consistency condition:
Wavefront hits and before hitting
Monotonicity condition:
Increase of or increases
14Numerical geometry of non-rigid shapes Shortest Path Problems
Geometric interpretation
Consistency condition: update direction must form acute angles with
normals to triangle edges
Monotonicity condition: update direction must come from within the
triangle
ConsistentMonotoneConsistent & Monotone
15Numerical geometry of non-rigid shapes Shortest Path Problems
Monotonicity
Monotonicity: update must come from within the triangle
If is not within the triangle, force it to lie inside
The update direction will coincide with one of the edges
Dijkstra-type update
16Numerical geometry of non-rigid shapes Shortest Path Problems
Consistency: acute triangle
When triangle is acute, both conditions hold for any direction
17Numerical geometry of non-rigid shapes Shortest Path Problems
Consistency: obtuse triangle
When triangle is obtuse, some consistency condition is violated for
some directions
18Numerical geometry of non-rigid shapes Shortest Path Problems
Fast marching on obtuse meshes
Inconsistent solution if the mesh contains obtuse triangles
Remeshing is costly
Solution: split obtuse triangles by adding virtual connections to
non-adjacent vertices
Done as a pre-processing step in
20Numerical geometry of non-rigid shapes Shortest Path Problems
Fast marching algorithm
Geodesic distances
Minimal geodesics
Voronoi tessellation
21Numerical geometry of non-rigid shapes Shortest Path Problems
Fast marching on parametric surfaces
Object is given as a parametric surface
Parametrization domain is sampled on a regular grid (geometry
image)
Fast marching can be performed entirely in the parametrization domain
Update step accounts for the surface first fundamental form to
measure geodesic distances on the surface
Surface itself is not required, knowledge of the first fundamental form
and grid connectivity is sufficient
Obtuse triangles are split by adding virtual connections to
non-adjacent grid points
22Numerical geometry of non-rigid shapes Shortest Path Problems
Heap-based grid update
Fast marching on triangular meshes and geometric images both use
Dijstra-type heap-based grid update
Update order is unknown and data-dependent
Inefficient use of memory system and cache
Inherently sequential algorithm – next update depends on previous one
23Numerical geometry of non-rigid shapes Shortest Path Problems
Raster scan fast marching
Update the grid in a raster scan order
Dates back to Danielsson’s algorithm
In Euclidean case, geodesics are straight lines
Each raster scan covers ¼ of the possible directions of the geodesics
Four raster scans covering four quadrants are sufficient to compute a
Euclidean distance map
24Numerical geometry of non-rigid shapes Shortest Path Problems
Raster scan fast marching
Generally, geodesics are curved in parametrization domain
Raster scans have to be repeated to produce a convergent solution
Number of iterations depends on geometry and parametrization
Practically, few iterations are required
1 iteration 2 iterations 3 iterations
25Numerical geometry of non-rigid shapes Shortest Path Problems
Raster scan fast marching
What we lost:
No more a one-pass algorithm
Computational complexity is data-dependent
What we gained:
Coherent memory access, efficient use of cache
No heap, each iteration is
Raster scans can be parallelized
26Numerical geometry of non-rigid shapes Shortest Path Problems
Marching even faster
All updates performed on a diagonal
are independent
Can be computed simultaneously
Uneven load
27Numerical geometry of non-rigid shapes Shortest Path Problems
Marching even faster
Rotate scan directions by 45 degrees
All updates performed along a row or
column can be parallelized
Balanced load
Suitable for SIMD architecture and GPUs
x100 speedup with comparable accuracy
28Numerical geometry of non-rigid shapes Shortest Path Problems
We have all numerical tools required to approximate the intrinsic
geometry of objects
Graph representation may introduce metrication error
Intrinsic metric approximated using Dijkstra’s algorithm may be
inconsistent
Fast marching is a consistent numerical tool for measuring
geodesic distances
Fast marching can be parallelized
Conclusions so far…