+ All Categories
Home > Documents > The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

Date post: 20-Dec-2015
Category:
View: 214 times
Download: 0 times
Share this document with a friend
Popular Tags:
101
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003
Transcript
Page 1: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Distance Fields

Avneesh Sud

COMP 290-058, Fall 2003

Page 2: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

2The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Overview

WHAT are Distance Fields?HOW are they computed?WHY do we care?

Page 3: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

3The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Overview

WHAT are Distance Fields?HOW are they computed?WHY do we care?

Page 4: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

4The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Distance Functions

A scalar function f:Rn -> R representing the distance from an object O to any point P ε Rn

Object O is called a ‘site’

Page 5: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

5The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Distance Functions: Example

Euclidean Distance Function:f(x,y)=√x2+y2

Point in 2D

Page 6: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

6The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Distance Functions: Example

Euclidean Distance Function:f(x,y)=√x2+y2

Plot a graph:z=√x2+y2

Cone

Points in 2D

Page 7: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

7The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Distance Metrics

Lp distance metric in k dim

p = 1, “Manhattan” or City Blockp = 2, Euclideanp =∞, Max-norm

pk

i

p

iip yxd

1

1

),(

yx

Page 8: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

8The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Distance Fields

For a set of sites, the minima of all distance functions representing the distance from a point P ε Rn to closest site“Lower Envelope” of all distance functions

Page 9: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

9The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Differential Geometry

S = surface moving in a normal direction with unit speedDistance of point X from surface = arrival time of the surface at X

S

X

d

Page 10: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

10The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Differential Geometry

Shortest distance from X to point p ε S is orthogonal to SLine segment Xp is a characteristicS must be smooth

S

X

d

p

Page 11: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

11The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

What is a Voronoi Diagram?Given a collection of geometric primitives, it is a subdivision of space into cells such that all points in a cell are closer to one primitive than to any other

Voronoi Site

Voronoi Region

Page 12: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

12The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Ordinary Point sitesNearest Euclidean distance

GeneralizedHigher-order site geometryVarying distance metrics

Weighted Distances

Higher-orderSites

2.0

0.5

Page 13: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

13The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Voronoi Diagram and Distance Fields“Projection of lower envelope” of

distance functions

“Lower Envelope” of distance functions

Voronoi Diagram

Page 14: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

14The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Voronoi Diagram and Distance Fields

“Projection of lower envelope” of distance functionsGiven one, other can be easily computedPractical methods compute distance fields on a discrete grid

Page 15: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

15The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Related Terminology

Distance Transform = Distance FieldClosest Point Transform = Feature Transform = Voronoi Diagram

Page 16: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

16The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Why Should We Compute Them?

Useful in a wide variety of applications

Collision DetectionSurface ReconstructionRobot Motion Planning

Non-Photorealistic RenderingSurface Simplification

Mesh GenerationShape Analysis

Page 17: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

17The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

GVD: “Clearance Information”

Points with the largest distance values to nearby obstacles

Maximally Clear Path

Density Estimation Nearest Neighbors

Page 18: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

18The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Distance Field: “Proximity Information”

Potential Fields – need proximity information to obstaclesDistance field of obstacles (and its gradient) used to compute repulsive forces [Khatib86]

0

020

reprep

if0

if111

x

kF

Page 19: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

19The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Overview

WHAT are Distance Fields?HOW are they computed?WHY do we care?

Page 20: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

20The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Brute Force Algorithm (Grid)1. Initially : dp =∞, for all p ε

grid2. for each site m3. for each grid point p4. dnew = distance to m

5. if |dnew|<|dp|

6. dp = dnew

7. cpp = closest point on m8. end9. end

Page 21: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

21The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Brute-force Algorithm

Record ID of the closest site to each sample

point

Coarsepoint-sampling

result

Finerpoint-sampling

result

Page 22: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

22The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Brute Force Algorithm

Time Complexity?M sites, grid size N O(MN)

Space Complexity?O(N)

Immensely Parallelizable!

Page 23: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

23The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

GPU Based Computation

Point Line Triangle

HAVOC2D, HAVOC3D [Hoff et al, 99]

Evaluate distance at each pixel for all sitesAccelerate using graphics hardwareModel is polygonal

Page 24: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

24The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

HAVOC2D, HAVOC3DEvaluate distance at each pixel for all sitesAccelerate using graphics hardware

StepsMesh approximation of Distance FunctionsRender distance meshes using graphics hardwareReadback final buffers

GPU Based Computation

Page 25: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

25The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Approximating the Distance Function

Depth buffer performs minimum comparisonGraphics Hardware performs fast linear interpolation Distance Functions are non-linearPerform linear approximation to Distance Function

Page 26: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

26The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Approximating the Distance Function

Point Line Triangle

Avoid per-pixel distance evaluationPoint-sample the distance functionReconstruct by rendering polygonal mesh

Page 27: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

27The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

The Error Bound

Error bound is determined by the pixel resolution farthest distance a point can be from a pixel sample point

Close-up of pixel grid

Page 28: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

28The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Meshing the Distance Function

Shape of distance function for a 2D point is a cone

Need a bounded-error tessellation of the cone

Page 29: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

29The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Rasterization to reconstruct distance valuesDepth test to perform minimum operator

Graphics Hardware Acceleration

Perspective, 3/4 view Parallel, top view

Page 30: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

30The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Readback Results

Distance Field

Depth Buffer

Voronoi Regions

Color Buffer

Page 31: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

31The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Shape of Distance Functions

Sweep apex of cone along higher-order site to obtain the shape of the distance function

Page 32: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

32The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Example Distance Meshes

Page 33: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

33The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Curves

Tessellate curve into a polylineTessellation error is added to meshing error

Page 34: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

34The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

3D Voronoi Diagrams

Graphics hardware can generate one 2D slice at a timeSweep along 3rd dimension (Z-axis) computing 1 slice at a time

Polygonal model

Page 35: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

35The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Shape of 3D Distance Functions

Slices of the distance function for a 3D point site

Distance meshes used to approximate slices

Page 36: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

36The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Shape of 3D Distance FunctionsPoint Line segment Triangle

1 sheet of a hyperboloid

Elliptical cone Plane

Page 37: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

37The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Advantages

Simple idea – efficiently implemented on graphics hardwareExtensible to any type of distance function and input set

Page 38: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

38The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Disadvantages

Mesh Generation and TranformLarge number of triangles generated

Rasterization: Distance mesh can fill entire sliceComplexity for M sites and N slices = O(MN) Lot of Fill !

Readback:Stalls the graphics pipelineUnsuitable for interactive applications

Page 39: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

39The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Using Voronoi Information

Assume point sites onlyCompute Voronoi diagram

O(M logM) in 2DO(M2) in 3D

Scan convert each Voronoi cell, computing closest distance

O(N)Edges of Voronoi polygons/polyhedra must be larger than grid spacing

Page 40: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

40The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Characteristics/Scan Conversion Algorithm

Use characteristics [Mauch00]2D algorithm for a piecewise linear curve

Page 41: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

41The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Characteristics/Scan Conversion Algorithm

Closest points to a line segment lie within an infinite stripEach strip exactly contains the characteristic curves from that edge

Characteristic Curve

Page 42: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

42The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Characteristics/Scan Conversion Algorithm

Closest points to a point lie within an infinite wedgeCharacteristic line for non-smooth points on the manifold lies “between” the normals of surrounding smooth parts

Page 43: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

43The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Edge Strips

Positive Distance Negative Distance

Page 44: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

44The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Vertex Wedges

Positive Distance Negative Distance

Page 45: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

45The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Bounds

Compute distance field in a band up to distance d from the curveCompute bounding polygons up to distance d

Vertex Edge

Page 46: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

46The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

CSC algorithm – 2D

1. Initially: dij =∞, for all i,j2. for each edge e3. p = bounding polygon of e4. G = scan_convert(p)5. for each (i, j) ε G6. dnew = distance to e7. if |dnew|<|dij|8. dij = dnew

9. cpij = closest point on e10. end11. end12. for each vertex v13. …14. end

Page 47: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

47The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

3D Triangle Mesh

Sites are triangular faces, edges or verticesCharacteristic lines have bounding polyhedra

Faces – Triangular Prims Edge - Wedge Vertices – “Cones”

Page 48: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

48The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

3D Triangle Mesh

Sites are triangular faces, edges or verticesCharacteristic lines have bounding polyhedra

Page 49: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

49The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

3D Computation

Slice polyhedra into polygonsScan convert each polygon

Slices of a “cone”

Page 50: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

50The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

CSC algorithm – 3D

1. Initially: dij =∞, for all i,j2. for each face f3. p = bounding polyhedron of f4. …5. end6. for each edge e7. …8. end9. for each vertex v10. …11.end

Page 51: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

51The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Complexity

M sites, N grid cells within distance d of the surfacer = ratio of sum of volumes of polyhedra by volume of region within distance d

Gives amount of overlap = number of times each cell is written

Complexity = O(M +rN)

Polyhedra Construction Scan Conversion

Page 52: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

52The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Complexity

For small d, r ≈ 1For large d, clip bounding polyhedra to keep r small

Can increase setup cost of polyhedra construction to O(M2 )

Page 53: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

53The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Advantages

Efficiently exploits surface connectivity, minimizing fillGives signed distance fields

Page 54: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

54The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Disadvantages

Valid for manifold surfacesCannot evaluate non-linear distance functions on older generations of graphics hardwareA large number of polygons may be scan-converted for each sliceSaddle points – “Cones” invalidSetup cost

Page 55: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

55The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

CSC on graphics hardware

Use programmable fragment programs on modern GPUs to compute distance functions at each pixel [Sigg03]

Can compute complicated functions at each pixel on current GPUs

Page 56: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

56The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

HW-Based CSC

Compute entire slice at a timeCPU computes slicing polygonsGPU computes distance values at each pixel on slice in parallel

Model

Slice PolyhedraPolygons

Page 57: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

57The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Reducing polygon count

Expand triangular prisms to encloses point closest to edges and faces

2D example

Bisector

Page 58: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

58The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Reducing polygon count

Expand triangular prisms to encloses point closest to edges and faces

Fragment program computes closest siteComplete Voronoi information is lost

3D example

Page 59: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

59The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Results

Stanford Bunny Model Knot Model

Page 60: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

60The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Advantages

Efficient implementation on graphics hardware – exploits parallelismReduces number of polygons drawnHandles saddle points

Page 61: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

61The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

DiFi

Fast Distance Field computation using graphics hardware [Sud03]Enhancement over HAVOCExploits Voronoi diagram properties for culling

Page 62: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

62The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Voronoi Diagram Properties

Within a bounded region, all voronoi regions have a bounded volume

9 Sites, 2D

Page 63: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

63The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Voronoi Diagram Properties

Within a bounded region, all voronoi regions have a bounded volume

As site density increases, average spatial bounds decrease

27 Sites, 2D

Page 64: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

64The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Voronoi Diagram Properties

Voronoi regions are connected

Valid for all Lp norms

Page 65: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

65The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Voronoi Diagram Properties

High distance field coherence between adjacent slicesChange in distance function between adjacent slices is bounded Distance functions for a

point site Pi to slice Zj

Page 66: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

66The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Voronoi Diagram Properties

High distance field coherence between adjacent slicesChange in distance function between adjacent slices is bounded Distance functions for a

point site Pi to slice Zj+1

Page 67: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

67The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Culling Techniques

Use Voronoi region bounds for culling

Site ClassificationEstimating Z-BoundsEstimating XY-Bounds

Page 68: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

68The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Site Culling: Classification

For each slice partition the set of sites S1

S3

Slicej

S4

S2

Sweep Direction

X

Z

S5

Page 69: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

69The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

S4

Site Culling: Classification

For each slice partition the set of sites, using voronoi region bounds:

Slicej

S1

S2

S3

X

ZSweep Direction

S5

Page 70: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

70The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Site Culling: Classification

For each slice partition the set of sites, using voronoi region bounds:

Approaching (Aj)

Slicej

S1S3

S4

S2

X

ZSweep Direction

Aj

S5

Page 71: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

71The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

S4

S2

Site Culling: Classification

For each slice partition the set of sites, using voronoi region bounds:

Approaching (Aj)

Intersecting (Ij)

Slicej

S1S3

X

ZSweep Direction

Aj

Ij

S5

Page 72: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

72The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

S4

S2

Site Culling: Classification

For each slice partition the set of sites, using voronoi region bounds:

Approaching (Aj)

Intersecting (Ij)

Receding (Rj)

Slicej

S1S3

X

ZSweep Direction

Aj

Ij

Rj

S5

Page 73: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

73The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

S4

S2

Site Culling: Classification

For each slice partition the set of sites, using voronoi region bounds:

Approaching (Aj)

Intersecting (Ij)

Receding (Rj)

Render distance functions for Intersecting sites only

Slicej

S1S3

X

ZSweep Direction

Aj

Ij

Rj

S5

Page 74: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

74The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Coherence

Updating Ij

Ij+1 = Ij …

Slicej+1

S1S3

Previously Intersecting

S4

S2

X

ZSweep Direction

Ij

S5

Page 75: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

75The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

S4

S2

Coherence

Updating Ij

Ij+1 = Ij

+ (Aj – Aj+1) …

Slicej+1

S1S3

X

ZSweep Direction

Approaching Intersecting

Aj-Aj+1

S5

Page 76: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

76The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

S4

S2

Coherence

Updating Ij

Ij+1 = Ij

+ (Aj – Aj+1)

– (Rj+1 – Rj)

Slicej+1

S1S3

X

ZSweep Direction

Rj+1-Rj

Intersecting Receding

S5

Page 77: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

77The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

S4

S2

Coherence

Updating Ij

Ij+1 = Ij

+ (Aj – Aj+1)

– (Rj+1 – Rj)

Slicej+1

S1S3

X

ZSweep Direction

S5

Aj+1Ij+1

Rj+1

Page 78: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

78The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Estimating Set Partitions

Computing exact set partition = Exact voronoi computationUse hardware based occlusion queries

Determine number of visible fragments

Compute a set of potentially intersecting sites Îjjj II ˆ

Page 79: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

79The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Estimating XY Bounds

Monotonic distance functions

Page 80: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

80The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Estimating XY Bounds

Monotonic distance functionsVoronoi region’s XY extent bounded by depth of distance function

Page 81: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

81The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Estimating XY Bounds

Monotonic distance functionsVoronoi region’s XY extent bounded by depth of distance functionEstimate max depth bounds for each site!

Page 82: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

82The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Estimating Depth Bound

Render distance function in layers using occlusion query

Page 83: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

83The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Estimating Depth Bound

Render distance field in layers using occlusion query

Page 84: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

84The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Estimating Depth Bound

Render distance field in layers using occlusion query

Page 85: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

85The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Estimating Depth Bound

Render distance field in layers using occlusion query

Last visible layer bounds the max depth

Page 86: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

86The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Estimating Depth Bound

Render distance field in layers using occlusion query

Last visible layer bounds the max depth

Gives max depth at end of current slice

Page 87: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

87The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Updating Depth Bound

Exploit depth field coherenceGiven a depth bound for current slice, estimate a bound for next slice

Page 88: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

88The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Complexity

Performance depends on amount of occlusion in distance functions

Influences estimated boundsr = ratio of estimated Voronoi bounds by actual Voronoi size

Complexity O(M+rN )Worst case: r = MExpected: r = constant

Mesh Generation + Transform

Rasterization

Page 89: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

89The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Results

Model Polys ResolutionHAVOC

(s)DiFi(s)

Shell Charge 4460 128x126x126 31.69 3.38

Head 21764 79x106x128 52.47 13.60

Bunny 69451 128x126x100 212.71 36.21

Cassini 90879 94x128x96 1102.01 47.90

4 -20 times speedup!

Page 90: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

90The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Overview

WHAT are Distance Fields?HOW are they computed?WHY do we care?

Page 91: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

91The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Planning Based on GVD & MAT

O’Dunlaing, Sharir and Yap [1983]

Canny and Donald [1987]

Latombe [1991]

Choset, Burdick, et al. [1994-1999]

Vleugels and Overmars [1996,1997]

Guibas, Holleman and Kavraki [1999]

Wilmarth, Amato and Stiller [1999]

…… and others ……

Page 92: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

92The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Planning Using GVDs

Is a GVD sufficient for path planning?

GVD computed in 3D workspaceSufficient for a point robot

Use GVD along with other methods

Page 93: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

93The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

3-DOF Potential Field Planner with GVD

Rigid robot moving on a plane in a dynamic environment [Hoff00]Combines a GVD roadmap with a local (potential field) planner

Page 94: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

94The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Basic Approach

Depth Buffer – providing distance function and distance gradient (finite difference)

Color Buffer – building Voronoi graphs

Combination of BothCompute weighted Voronoi graphs Voronoi vertices used for milestonesWeighted edges used for selecting pathsDistance values for quick rejection

Page 95: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

95The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Voronoi BoundaryFor each voxel in discrete GVD, associate a color corresponding to an object ID and a distance value to this obstacle.

To extract the boundary, use continuation method similar to iso-surface extraction -- starting from a seed point and step to next by bracketing boundary curves in a 2x2x2 region of sampled points.

Can be efficiently performed on modern GPUs using fragment programs

Page 96: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

96The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Constructing Voronoi Roadmap

Identify Voronoi vertices

Extract Voronoi boundary

Build Voronoi graph

Select path based on edge weights

Incrementally construct Voronoi roadmap

local planner (PFF) between milestonesquick collision rejection test & exact CD

Page 97: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

97The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Voronoi Roadmap/Graph for

Dynamic Environments

Page 98: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

98The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Video (3D View)

Page 99: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

99The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Other Approaches

Voronoi based sampling for PRM [Hoff, WAFR00], [Foskey01] Constraint based motion planning [Garber 02]

Planning problem formulated as a dynamic simulation problem with constraintsUses distance information for solving constraints

Page 100: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

100The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

References (Distance Fields)

HAVOC: Hoff et al. Fast Computation of Generalized Voronoi Diagrams Using Graphics Hardware SIGGRAPH 1999 CSC: S. Mauch A fast algorithm for computing the closest point and distance transformHW-CSC: Sig et al. Signed Distance Transform Using Graphics Hardware IEEE Vis 2003DiFi: Sud and Manocha Fast Distance Field Computation Using Graphics Hardware UNC-TR03-026

Page 101: The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Distance Fields Avneesh Sud COMP 290-058, Fall 2003.

101The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

References (Planning)

Hoff et al. Interactive Motion Planning Using Hardware-Accelerated Computation of Generalized Voronoi Diagrams ICRA 2000Pisula et al. Randomized Path Planning for a Rigid Body Based on Hardware Accelerated Voronoi Sampling WAFR 2000Garber and Lin Constraint-Based Motion Planning using Voronoi Diagrams WAFR 2002


Recommended