processing and analysis of geometric shapes...
TRANSCRIPT
3/17/2010
1
Processing and Analysis of Geometric Shapes Discrete Geometry
Discrete geometry
© Alexander & Michael Bronstein, 2006-2009© Michael Bronstein, 2010tosca.cs.technion.ac.il/book
048921 Advanced topics in visionProcessing and Analysis of Geometric Shapes
EE Technion, Spring 2010
Processing and Analysis of Geometric Shapes Discrete Geometry
The world is continuous,
but the mind is discrete
David Mumford
‘‘‘‘
3Processing and Analysis of Geometric Shapes Discrete Geometry
Discretization
� Surface
� Metric
� Topology
� Sampling
� Discrete metric (matrix of
distances)
� Discrete topology (connectivity)
Continuous world Discrete world
4Processing and Analysis of Geometric Shapes Discrete Geometry
How good is a sampling?
5Processing and Analysis of Geometric Shapes Discrete Geometry
Sampling density
� How to quantify density of sampling?
� is an -covering of if
Alternatively:
for all , where
is the point-to-set distance .
6Processing and Analysis of Geometric Shapes Discrete Geometry
Sampling efficiency
Also an r-covering!
� Are all points necessary ?
� An -covering may be unnecessarily
dense (may even not be a discrete set).
� Quantify how well the
samples are separated .
� is -separated if
for all .
� For , an -separated
set is finite if is compact .
3/17/2010
2
7Processing and Analysis of Geometric Shapes Discrete Geometry
Farthest point sampling
� Good sampling has to be dense and efficient at the same time.
� Find and -separated -covering of .
� Achieved using farthest point sampling .
� We defer the discussion on
� How to select ?
� How to compute ?
8Processing and Analysis of Geometric Shapes Discrete Geometry
Farthest point sampling
Farthest point
9Processing and Analysis of Geometric Shapes Discrete Geometry
Farthest point sampling
� Start with some .
� Determine sampling radius
� If stop .
� Find the farthest point from
� Add to
10Processing and Analysis of Geometric Shapes Discrete Geometry
Farthest point sampling
� Outcome: -separated -covering of .
� Produces sampling with progressively increasing density.
� A greedy algorithm : previously added points remain in .
� There might be another -separated -covering containing less points.
� In practice used to sub-sample a densely sampled shape.
� Straightforward time complexity:
number of points in dense sampling, number of points in .
� Using efficient data structures can be reduced to .
11Processing and Analysis of Geometric Shapes Discrete Geometry
Sampling as representation
� Sampling represents a region on as a single point .
� Region of points on closer to than to any other
� Voronoi region (a.k.a. Dirichlet or Voronoi-Dirichlet region, Thiessen
polytope or polygon, Wigner-Seitz zone, domain of action).
� To avoid degenerate cases, assume points in in general position :
� No three points lie on the same geodesic .
(Euclidean case: no three collinear points).
� No four points lie on the boundary of the same metric ball .
(Euclidean case: no four cocircular points).
12Processing and Analysis of Geometric Shapes Discrete Geometry
Voronoi decomposition
� A point can belong to one of the following
� Voronoi region ( is closer to than to any other ).
� Voronoi edge ( is equidistant from and ).
� Voronoi vertex ( is equidistant from
three points ).
Voronoi region Voronoi edge Voronoi vertex
3/17/2010
3
13Processing and Analysis of Geometric Shapes Discrete Geometry
Voronoi decomposition
14Processing and Analysis of Geometric Shapes Discrete Geometry
Voronoi decomposition
� Voronoi regions are disjoint .
� Their closure
covers the entire .
� Cutting along Voronoi edges produces
a collection of tiles .
� In the Euclidean case, the tiles are
convex polygons .
� Hence, the tiles are topological disks
(are homeomorphic to a disk).
15Processing and Analysis of Geometric Shapes Discrete Geometry
Voronoi tesellation
� Tessellation of (a.k.a. cell complex ):
a finite collection of disjoint open topological
disks, whose closure cover the entire .
� In the Euclidean case, Voronoi
decomposition is always a tessellation.
� In the general case, Voronoi regions might
not be topological disks.
� A valid tessellation is obtained is the
sampling is sufficiently dense .
16Processing and Analysis of Geometric Shapes Discrete Geometry
Non-Euclidean Voronoi tessellations
� Convexity radius at a point is the largest for which the
closed ball is convex in , i.e., minimal geodesics between
every lie in .
� Convexity radius of = infimum of convexity radii over all .
� Theorem (Leibon & Letscher, 2000):
An -separated -covering of with convexity radius of
is guaranteed to produce a valid Voronoi tessellation.
� Gives sufficient sampling density conditions.
17Processing and Analysis of Geometric Shapes Discrete Geometry
Sufficient sampling density conditions
Invalid tessellation Valid tessellation
18Processing and Analysis of Geometric Shapes Discrete Geometry
Voronoi tessellations in Nature
3/17/2010
4
19Processing and Analysis of Geometric Shapes Discrete Geometry
Farthest point samplingand Voronoi decomposition
MATLAB ® intermezzo
20Processing and Analysis of Geometric Shapes Discrete Geometry
Representation error
� Voronoi decomposition replaces with the closest point .
� Mapping copying each into .
� Quantify the representation error introduced by .
� Let be picked randomly with uniform distribution on .
� Representation error = variance of
21Processing and Analysis of Geometric Shapes Discrete Geometry
Optimal sampling
� In the Euclidean case:
(mean squared error ).
� Optimal sampling : given a fixed sampling size , minimize error
Alternatively: Given a fixed representation error , minimize sampling
size
22Processing and Analysis of Geometric Shapes Discrete Geometry
Centroidal Voronoi tessellation
� In a sampling minimizing , each has to satisfy
(intrinsic centroid )
� In the Euclidean case – center of mass
� In general case: intrinsic centroid of .
� Centroidal Voronoi tessellation (CVT) : Voronoi tessellation generated
by in which each is the intrinsic centroid of .
23Processing and Analysis of Geometric Shapes Discrete Geometry
Lloyd-Max algorithm
� Start with some sampling (e.g., produced by FPS)
� Construct Voronoi decomposition
� For each , compute intrinsic centroids
� Update
� In the limit , approaches the hexagonal
honeycomb shape – the densest possible tessellation.
� Lloyd-Max algorithms is known under many other names: vector
quantization, k-means, etc.
24Processing and Analysis of Geometric Shapes Discrete Geometry
Sampling as clustering
Partition the space into clusters with centers
to minimize some cost function
� Maximum cluster radius
� Average cluster radius
In the discrete setting, both problems are NP-hard
Lloyd-Max algorithm, a.k.a. k-means is a heuristic, sometimes minimizing
average cluster radius (if converges globally – not guaranteed)
3/17/2010
5
25Processing and Analysis of Geometric Shapes Discrete Geometry
Farthest point sampling encore
� Start with some ,
� For
� Find the farthest point
� Compute the sampling radius
Lemma
� .
�
26Processing and Analysis of Geometric Shapes Discrete Geometry
Proof
For any
�
27Processing and Analysis of Geometric Shapes Discrete Geometry
Proof (cont)
Since , we have
�
28Processing and Analysis of Geometric Shapes Discrete Geometry
Almost optimal sampling
Theorem (Hochbaum & Shmoys, 1985)
Let be the result of the FPS algorithm. Then
In other words: FPS is worse than optimal sampling by at most 2.
29Processing and Analysis of Geometric Shapes Discrete Geometry
Idea of the proof
Let denote the optimal clusters, with centers
Distinguish between two cases
One of the clusters contains two
or more of the points
Each cluster contains exactly
one of the points
30Processing and Analysis of Geometric Shapes Discrete Geometry
Proof (first case)
Assume one of the clusters contains
two or more of the points ,
e.g.
triangle inequality
Hence:
3/17/2010
6
31Processing and Analysis of Geometric Shapes Discrete Geometry
Proof (second case)
Assume each of the clusters
contains exactly one of the points
, e.g.
triangle inequality
Then, for any point
32Processing and Analysis of Geometric Shapes Discrete Geometry
Proof (second case, cont)
We have: for any , for any point
In particular, for
33Processing and Analysis of Geometric Shapes Discrete Geometry
Connectivity
� The connectivity structure can be
represented as an undirected graph
with vertices and
edges
Vertices
Edges
� Connectivity graph can be represented as a matrix
� Neighborhood is a topological definition
independent of a metric
� Two points are adjacent (directly connected )
if they belong to the same neighborhood
34Processing and Analysis of Geometric Shapes Discrete Geometry
Shape representation
Cloud of pointsGraph
35Processing and Analysis of Geometric Shapes Discrete Geometry
Connectivity in the plane
Four-neighbor Six-neighbor Eight-neighbor
36Processing and Analysis of Geometric Shapes Discrete Geometry
Delaunay tessellation
Voronoi regions Connectivity Delaunay tesselation
Boris Delaunay(1890-1980)
The obtained connectivity graph is dual to the
Voronoi diagram and is called Delaunay tesselation
Define connectivity as follows: a pair of points
whose Voronoi cells are adjacent are connected
3/17/2010
7
37Processing and Analysis of Geometric Shapes Discrete Geometry
Delaunay tessellation
Geodesic triangles Euclidean triangles
For surfaces, the triangles are replaced by geodesic triangles
[Leibon & Letscher]: under conditions that guarantee the existence of
Voronoi tessellation, Delaunay triangles form a valid tessellation
Replacing geodesic triangles by planar ones gives Delaunay triangulation
38Processing and Analysis of Geometric Shapes Discrete Geometry
Shape representation
Cloud of pointsGraph
Triangular mesh
39Processing and Analysis of Geometric Shapes Discrete Geometry
Triangular meshes
A structure of the form consisting of
� Vertices
� Edges
� Faces
is called a triangular mesh
The mesh is a purely topological object and does not contain any geometric
properties
The faces can be represented as an matrix of indices, where each
row is a vector of the form , and
40Processing and Analysis of Geometric Shapes Discrete Geometry
Triangular meshes
The geometric realization of the mesh is defined by specifying the
coordinates of the vertices for all
The coordinates can be represented as an matrix
The mesh is a piece-wise planar approximation obtained by gluing the
triangular faces together,
Triangular face
41Processing and Analysis of Geometric Shapes Discrete Geometry
Example of a triangular mesh
Topological Geometric
Vertices
Edges
Faces
Coordinates
42Processing and Analysis of Geometric Shapes Discrete Geometry
Barycentric coordinates
Any point on the mesh can be represented providing
� index of the triangle enclosing it;
� coefficients of the convex combination of the triangle vertices
Vector is called barycentric coordinates
3/17/2010
8
43Processing and Analysis of Geometric Shapes Discrete Geometry
Manifold meshes
� is a manifold
� Neighborhood of each interior
vertex is homeomorphic to a disc
� Neighborhood of each boundary
vertex is homeomorphic to a half-disc
� Each interior edge belongs to two triangles
� Each boundary edge belongs to one triangle
44Processing and Analysis of Geometric Shapes Discrete Geometry
Non-manifold meshes
Non-manifold mesh
Edge shared by
four triangles
45Processing and Analysis of Geometric Shapes Discrete Geometry
Geometry images
Surface Geometry image
Global parametrization
Sampling of parametrization domain on a Cartesian grid
46Processing and Analysis of Geometric Shapes Discrete Geometry
Geometry images
Manifold mesh Non-manifold mesh
Six-neighbor Eight-neighbor
47Processing and Analysis of Geometric Shapes Discrete Geometry
Geometric validity
Topological validity (manifold mesh) is insufficient!
Geometric validity means that the realization of the triangular mesh does
not contain self-intersections
Topologically valid
Geometrically invalid
48Processing and Analysis of Geometric Shapes Discrete Geometry
Skeleton
Problem when is equidistant from two points on
(such points are called medial axis or skeleton of )
For a smooth compact surface , there exists an envelope (open set in
containing ) such that every point is continuously mappable to
a unique point on
The mapping is realized as the closest point on
from
If the mesh is contained in the envelope
(does not intersect the medial axis), it is valid
3/17/2010
9
49Processing and Analysis of Geometric Shapes Discrete Geometry
Skeleton
Points equidistant from the boundary
form the skeleton of a shape
50Processing and Analysis of Geometric Shapes Discrete Geometry
Local feature size
Distance from point on to the medial axis of is called the local
feature size , denoted
Local feature size related to curvature
(not an intrinsic property!)
[Amenta&Bern, Leibon&Letscher]: if the surface is sampled such that for
every an open ball of radius contains a point of , it is guaranteed
that does not intersect the medial axis of
Conclusion: there exists sufficiently dense sampling guaranteeing that
is geometrically valid
51Processing and Analysis of Geometric Shapes Discrete Geometry
Geometric validity
Insufficient density
Invalid mesh
Sufficient density
Valid mesh