Overview Overview Motivation Motivation Collision Detection - - PDF document

overview overview
SMART_READER_LITE
LIVE PREVIEW

Overview Overview Motivation Motivation Collision Detection - - PDF document

Overview Overview Motivation Motivation Collision Detection Collision Detection Classification Classification Query type Query type Alan Liu Alan Liu Algorithms Algorithms aliu@usuhs.mil aliu@usuhs.mil


slide-1
SLIDE 1

Collision Detection Collision Detection

Alan Liu Alan Liu aliu@usuhs.mil aliu@usuhs.mil

The Surgical Simulation Laboratory The Surgical Simulation Laboratory National Capital Area Medical Simulation Center National Capital Area Medical Simulation Center Uniformed Services University Uniformed Services University http://simcen.usuhs.mil/miccai2003 http://simcen.usuhs.mil/miccai2003

Simulation for Medical Training – MICCAI 2003

Overview Overview

  • Motivation

Motivation

  • Classification

Classification

  • Query type

Query type

  • Algorithms

Algorithms

  • Examples

Examples

  • Research directions

Research directions

Simulation for Medical Training – MICCAI 2003

Motivation Motivation

  • Need to identify

Need to identify interaction between interaction between

– – Tool and tissue Tool and tissue – – Tissue and tissue Tissue and tissue – – Tool and tool Tool and tool

  • Interactions include

Interactions include

– – Contact Contact – – Penetration Penetration – – Proximity Proximity

Simulation for Medical Training – MICCAI 2003

A Simple Collision Detection A Simple Collision Detection Algorithm Algorithm

  • for object_1 in {all objects}

for object_1 in {all objects}

– – for object_2 in {all objects} for object_2 in {all objects}

» » if collide(object_1,object_2) if collide(object_1,object_2)

  • add <object_1,object_2> to list

add <object_1,object_2> to list

  • Algorithm assumes

Algorithm assumes

– – static environment static environment – – You actually want to detect collision You actually want to detect collision

Simulation for Medical Training – MICCAI 2003

Collision Detection in a Dynamic Collision Detection in a Dynamic Environment Environment

  • Two broad classes

Two broad classes

– – Detects collisions in continuous spatial Detects collisions in continuous spatial-

  • temporal domain

temporal domain

» » Infinite spatial resolution Infinite spatial resolution

– – Detects collisions at discrete intervals in Detects collisions at discrete intervals in temporal domain temporal domain

» » Sampling must ensure collisions are not missed Sampling must ensure collisions are not missed

Simulation for Medical Training – MICCAI 2003

Query Types Query Types

  • Intersection

Intersection

– – Collide or not Collide or not – – Collision loci Collision loci – – Polygon(s) colliding Polygon(s) colliding

  • Proximity

Proximity

– – Finding the closest points/polygons Finding the closest points/polygons

  • Prediction

Prediction

– – Time to collide Time to collide – – Priority list Priority list

slide-2
SLIDE 2

Simulation for Medical Training – MICCAI 2003

Brute Force Collision Detection Brute Force Collision Detection

  • Check for collisions

Check for collisions between objects between objects

– – Self collision Self collision – – Tool Tool-

  • tissue collision

tissue collision – – tissue tissue-

  • tissue collision

tissue collision

  • Too much, need to

Too much, need to prune list of prune list of

  • bjects/polygons to
  • bjects/polygons to

test test

Image by Daigo Tanaka, The Surgical Simulation Laboratory

Simulation for Medical Training – MICCAI 2003

Brute Force Collision Detection Brute Force Collision Detection

  • Check for collisions

Check for collisions between objects between objects

– – Self collision Self collision – – Tool Tool-

  • tissue collision

tissue collision – – tissue tissue-

  • tissue collision

tissue collision

  • Too much, need to

Too much, need to prune list of prune list of

  • bjects/polygons to
  • bjects/polygons to

test test

Image by Daigo Tanaka, Image by Daigo Tanaka, The Surgical Simulation Laboratory The Surgical Simulation Laboratory

Simulation for Medical Training – MICCAI 2003

Collision Detection Collision Detection

  • Needs to be done often

Needs to be done often

– – Every time Every time tools/organs/tissues change tools/organs/tissues change position or deform position or deform – – Must be fast Must be fast

» » Both visual and haptic Both visual and haptic rendering rendering

  • Types of collisions

Types of collisions

– – Tool/tool Tool/tool – – Tool/tissue Tool/tissue – – Tissue/tissue Tissue/tissue

Simulation for Medical Training – MICCAI 2003

Detecting Collision Between Detecting Collision Between Polyhedra Polyhedra

  • Feature

Feature-

  • based algorithms

based algorithms

– – Features can be vertices, lines, or faces. Features can be vertices, lines, or faces.

  • Iteratively converges to the closest feature pair on

Iteratively converges to the closest feature pair on polyhedra being tested. polyhedra being tested.

  • Examples

Examples

– – Lin Lin-

  • Canny algorithm

Canny algorithm

» » Computes closest features Computes closest features » » Linear in number of vertices Linear in number of vertices » » Near Near-

  • constant time if temporal coherence is used

constant time if temporal coherence is used

– – V V-

  • Clip

Clip

» » Permits penetrating objects, more robust Permits penetrating objects, more robust

Simulation for Medical Training – MICCAI 2003

Detecting Collision Between Detecting Collision Between Polyhedra Polyhedra

  • Gilbert, Johnson and Kerrthi Algorithm

Gilbert, Johnson and Kerrthi Algorithm

– – GJK and enhanced GJK GJK and enhanced GJK

  • Based on techniques in linear programming

Based on techniques in linear programming

  • Estimates of penetrating distance possible

Estimates of penetrating distance possible

– – Uses temporal coherence to run in near constant Uses temporal coherence to run in near constant time time

Simulation for Medical Training – MICCAI 2003

Bounding Volumes Bounding Volumes

  • Not cost effective to track distant objects

Not cost effective to track distant objects

  • Many collision detection libraries use a

Many collision detection libraries use a two two-

  • level approach to detecting collisions.

level approach to detecting collisions.

– – Prune uninteresting objects Prune uninteresting objects

» » Too far away Too far away » » No colliding for next “n” time steps No colliding for next “n” time steps

– – Check for collision between likely objects only Check for collision between likely objects only

» » Check between polytopes Check between polytopes » » Check specific polygons between objects. Check specific polygons between objects.

slide-3
SLIDE 3

Simulation for Medical Training – MICCAI 2003

Popular Pruning Methods Popular Pruning Methods

  • Bounding volumes

Bounding volumes

– – Spheres Spheres – – Boxes Boxes

» » Static partition Static partition » » Axis aligned Axis aligned bounding boxes bounding boxes » » Separating Axis Separating Axis Theorem Theorem

  • Hierarchy of

Hierarchy of volumes volumes

– – Octrees Octrees – – Sphere trees Sphere trees – – OBBTrees OBBTrees

Simulation for Medical Training – MICCAI 2003

Spheres Spheres

  • Bound objects by

Bound objects by spheres spheres

  • Fast, easy to compute

Fast, easy to compute

  • Can be too

Can be too conservative conservative

– – Too many false Too many false positives if object is positives if object is long and thin/flat long and thin/flat – – But see But see [HUBBARD93] and [HUBBARD93] and [HUBBARD96] [HUBBARD96]

1

r

2

r d

Intersect if

2 1

r r d + <

Simulation for Medical Training – MICCAI 2003

Axis Aligned Bounding Boxes Axis Aligned Bounding Boxes (AABB) (AABB)

  • I

I-

  • Collide algorithm

Collide algorithm

[COHEN95] [COHEN95] – – Boxes intersect if and Boxes intersect if and

  • nly if projections to
  • nly if projections to

coordinate axes coordinate axes intersect intersect – – Uses temporal Uses temporal coherence coherence

» » Detects all possible Detects all possible intersections in intersections in expected linear time expected linear time

Simulation for Medical Training – MICCAI 2003

Axis Aligned Bounding Boxes Axis Aligned Bounding Boxes (AABB) (AABB)

  • Inefficient for long

Inefficient for long thin objects at thin objects at arbitrary orientations arbitrary orientations

  • Boxes need to be

Boxes need to be continually resized for continually resized for

– – rotating objects rotating objects – – deforming objects deforming objects

Simulation for Medical Training – MICCAI 2003

Oriented Bounding Boxes Oriented Bounding Boxes

  • Oriented bounding boxes

Oriented bounding boxes

  • Smallest box that bounds

Smallest box that bounds

  • bject, not necessarily
  • bject, not necessarily

aligned to coordinate axes aligned to coordinate axes

  • Separating Axis Theorem

Separating Axis Theorem

[GOTTSCHALK96]. [GOTTSCHALK96].

  • Two polytopes are disjoint

Two polytopes are disjoint iff. iff.

– – there exists an axis there exists an axis

  • rthogonal to an edge in
  • rthogonal to an edge in

each polytope, or there each polytope, or there exists an axis orthogonal exists an axis orthogonal to a face on one polytope to a face on one polytope

Simulation for Medical Training – MICCAI 2003

Oriented Bounding Boxes Oriented Bounding Boxes

  • For boxes, need to test

For boxes, need to test at most 15 axes at most 15 axes

– – Each box has 3 unique Each box has 3 unique face and 3 unique edge face and 3 unique edge

  • rientations
  • rientations

– – Thus, 3 faces (on one Thus, 3 faces (on one box) + 3 faces (on the box) + 3 faces (on the

  • ther box) + 9 edge
  • ther box) + 9 edge

combinations combinations

slide-4
SLIDE 4

Simulation for Medical Training – MICCAI 2003

Static Partition Static Partition

  • Partition space into fixed

Partition space into fixed sized boxes sized boxes

  • Build hash table mapping

Build hash table mapping space to polygons space to polygons

  • Advantages

Advantages

– – Fast (expected constant Fast (expected constant time) time) – – Deformations easily Deformations easily handled handled

  • Disadvantages

Disadvantages

– – Memory overhead Memory overhead

Image courtesy of Frank Tendick

Simulation for Medical Training – MICCAI 2003

Hierarchy Of Bounding Volumes Hierarchy Of Bounding Volumes

  • Need tighter fit with object

Need tighter fit with object

  • Collision detection reduced to tree search

Collision detection reduced to tree search

– – Typically O(lg N) time Typically O(lg N) time

  • Types of bounding volume hierarchies

Types of bounding volume hierarchies

– – Octrees [SAMMET98] Octrees [SAMMET98] – – Sphere trees [HUBBARD93] Sphere trees [HUBBARD93] – – AABB Trees [BERGEN97] AABB Trees [BERGEN97] – – OBB Trees [GOTTSCHALK96] OBB Trees [GOTTSCHALK96]

Simulation for Medical Training – MICCAI 2003

Octrees Octrees

[SAMMET98] [SAMMET98]

  • Start with AABB encompassing entire

Start with AABB encompassing entire

  • bject
  • bject

– – Recursively subdivide box into four sub Recursively subdivide box into four sub-

  • boxes

boxes until a lower limit is reached until a lower limit is reached – – Relatively easy to construct Relatively easy to construct – – Updates are non Updates are non-

  • trivial

trivial

» » Movement Movement » » Deformation Deformation

Simulation for Medical Training – MICCAI 2003

Sphere Trees Sphere Trees

[HUBBARD93] [HUBBARD93]

  • Instead of using boxes,

Instead of using boxes, use spheres use spheres

  • Methods for building

Methods for building hierarchy hierarchy

– – Octree subdivision Octree subdivision [HUBBARD93] [HUBBARD93] – – Medial axis based Medial axis based [HUBBARD96] [HUBBARD96] – – Tighter subdivision Tighter subdivision [BRADSHAW02] [BRADSHAW02]

[HUBBARD96] [HUBBARD96] [HUBBARD96] [HUBBARD96]

Simulation for Medical Training – MICCAI 2003

AABB Trees AABB Trees

[BERGEN98] [BERGEN98]

  • Recursively subdivide

Recursively subdivide AABB by partitioning AABB by partitioning along longest axis along longest axis

– – Equal number of primitives Equal number of primitives

  • n either side of partition
  • n either side of partition
  • Refit boxes after

Refit boxes after deformation deformation

– – AABB of child AABBs is AABB of child AABBs is smallest AABB enclosing smallest AABB enclosing all primitives. all primitives.

  • Refitted boxes have more

Refitted boxes have more

  • verlap than rebuilt boxes
  • verlap than rebuilt boxes

[BERGEN98] [BERGEN98]

Simulation for Medical Training – MICCAI 2003

OBBTrees OBBTrees

[GOTTSCHALK96] [GOTTSCHALK96]

  • Recursively subdivide

Recursively subdivide OBBs OBBs

– – Divide along Divide along longest/2 longest/2nd

nd

longest/shortest axis longest/shortest axis – – Repeat division until Repeat division until not possible to divide not possible to divide

  • n any axis
  • n any axis

– – Use Separating Axis Use Separating Axis Theorem to determine Theorem to determine intersection intersection

[GOTTSCHALK96] [GOTTSCHALK96]

slide-5
SLIDE 5

Simulation for Medical Training – MICCAI 2003

Bucket trees Bucket trees

[GANOVELLI00] [GANOVELLI00]

  • For each axis,

For each axis, maintain sorted list of maintain sorted list of polygon coordinates polygon coordinates

  • Use octree to partition

Use octree to partition space space

  • Leaves point to

Leaves point to polygon with lowest polygon with lowest coordinate value in coordinate value in each array each array

– – Each leaf contains a Each leaf contains a “bucket” of polygons “bucket” of polygons

[GANOVELLI00]

Simulation for Medical Training – MICCAI 2003

Bucket trees Bucket trees

  • When object deforms,

When object deforms, polygons move to polygons move to different bucket different bucket

– – Change pointer at Change pointer at leaves leaves

[GANOVELLI00]

Simulation for Medical Training – MICCAI 2003

  • Updating tree for

Updating tree for deformable deformable

  • bjects requires
  • bjects requires

little effort little effort

  • Tree can get

Tree can get unbalanced unbalanced

  • Tight fit with

Tight fit with underlying object underlying object

  • Faster

Faster

  • Relatively easy to test

Relatively easy to test for intersections for intersections

  • Needs fewer

Needs fewer intersection tests intersection tests compared to AABB compared to AABB Tree (object Tree (object dependent) dependent)

  • No need to rebuilt

No need to rebuilt tree for tree for deformable deformable

  • bjects
  • bjects
  • Easy to build

Easy to build

  • Relatively easy to

Relatively easy to test for test for intersections intersections

  • Needs more

Needs more intersection tests intersection tests compared to OBB compared to OBB Tree (object Tree (object dependent) dependent)

  • Rotationally

Rotationally invariant invariant

  • Intersection test is

Intersection test is very simple very simple

  • Approximation to

Approximation to underlying object underlying object may be poor may be poor

OBB Tree OBB Tree

Efficient for rejection tests, less efficient for cases where mu Efficient for rejection tests, less efficient for cases where multiple intersections ltiple intersections exists exists

Bucket Bucket Trees Trees AABB Tree AABB Tree Sphere trees Sphere trees

Simulation for Medical Training – MICCAI 2003

Hardware Based Collision Detection Hardware Based Collision Detection

[LOMBARDO99] [LOMBARDO99]

  • Dynamic collision detection

Dynamic collision detection

– – No need to take discrete samples in time No need to take discrete samples in time

  • No additional data structures

No additional data structures

  • Uses commonly available graphics hardware

Uses commonly available graphics hardware

– – OpenGL based OpenGL based

  • Detects multiple contact points in one pass

Detects multiple contact points in one pass

  • Runs at interactive frame rates

Runs at interactive frame rates

– – Depending on hardware Depending on hardware

Simulation for Medical Training – MICCAI 2003

Hardware Based Collision Detection Hardware Based Collision Detection

[LOMBARDO99] [LOMBARDO99]

  • Laparoscopic instrument moves about a pivot

Laparoscopic instrument moves about a pivot point point

  • At each time step, instrument moves in (nearly) a

At each time step, instrument moves in (nearly) a straight line. straight line.

  • Volume swept out by instrument approximates a

Volume swept out by instrument approximates a viewing frustum viewing frustum

  • Use OpenGL define that frustum, then render

Use OpenGL define that frustum, then render

  • Anything visible must be due to objects

Anything visible must be due to objects intersecting path of instrument intersecting path of instrument

Simulation for Medical Training – MICCAI 2003

Hardware Based Collision Detection Hardware Based Collision Detection

[LOMBARDO99] [LOMBARDO99]

slide-6
SLIDE 6

Simulation for Medical Training – MICCAI 2003

Hardware Hardware-

  • based Bounding Box

based Bounding Box Computation [AHARON02] Computation [AHARON02]

  • Partition objects into

Partition objects into AABBs AABBs

– – Each box has specified # of polygons Each box has specified # of polygons – – Resize boxes for deformable objects Resize boxes for deformable objects

  • Use GL select mode to

Use GL select mode to

– – Determine collision of bounding boxes Determine collision of bounding boxes – – Determine polygon collisions Determine polygon collisions

  • Polygon collisions determined by building

Polygon collisions determined by building bounding boxes around polygons. bounding boxes around polygons.

Simulation for Medical Training – MICCAI 2003

Performance Performance

  • Experiments suggest

Experiments suggest

– – Less than linear time increase as polygons Less than linear time increase as polygons increase increase – – Not very sensitive to # polygons per bounding Not very sensitive to # polygons per bounding box box

  • Fast update

Fast update

– – Full AABB tree not required Full AABB tree not required

Simulation for Medical Training – MICCAI 2003

Open Questions Open Questions

  • Many, many points of contact

Many, many points of contact

– – Organ/organ, Suturing, Palpation Organ/organ, Suturing, Palpation – – Many current algorithms not efficient at solving this Many current algorithms not efficient at solving this problem problem

  • Deformation, change in topology

Deformation, change in topology

  • Self collision

Self collision

– – Knot tying Knot tying

  • Collision detection using a volumetric

Collision detection using a volumetric representation representation

  • Need to do everything in real

Need to do everything in real-

  • time

time

Simulation for Medical Training – MICCAI 2003

Collision Detection Code Collision Detection Code

  • Lin

Lin-

  • Canny algorithm

Canny algorithm

– – http://www.cs.berkeley.edu/~mirtich/collDet.html http://www.cs.berkeley.edu/~mirtich/collDet.html

  • I

I-

  • COLLIDE,V

COLLIDE,V-

  • COLLIDE and many others

COLLIDE and many others

– – http://www.cs.unc.edu/~geom/ http://www.cs.unc.edu/~geom/

  • SOLID (AABB Trees)

SOLID (AABB Trees)

– – http://www.win.tue.nl/~gino/solid/ http://www.win.tue.nl/~gino/solid/

  • Enhanced GJK

Enhanced GJK

– – http://web.comlab.ox.ac.uk/oucl/work/stephen.cameron http://web.comlab.ox.ac.uk/oucl/work/stephen.cameron /distances/index.html /distances/index.html

Simulation for Medical Training – MICCAI 2003

Bibliography Bibliography

  • [BERGEN97] van den Bergen G. "Efficient collision detection of

[BERGEN97] van den Bergen G. "Efficient collision detection of complex deformable complex deformable models using AABB trees." Journal of Graphics Tools, 2(4):1 models using AABB trees." Journal of Graphics Tools, 2(4):1--

  • -13, 1997. pp. 1

13, 1997. pp. 1-

  • 13.

13.

  • [HUBBARD96] Hubbard, P.M. "Approximating Polyhedra with Spheres

[HUBBARD96] Hubbard, P.M. "Approximating Polyhedra with Spheres for Time for Time-

  • Critical Collision Detection." ACM Trans. on Graphics, 15(3), 19

Critical Collision Detection." ACM Trans. on Graphics, 15(3), 1996. pp. 179

  • 96. pp. 179-
  • 210.

210.

  • [HUBBARD93] Hubbard, P.M. "Interactive collision detection." Pr

[HUBBARD93] Hubbard, P.M. "Interactive collision detection." Proceedings of the

  • ceedings of the

IEEE Symposium on Research Frontiers in Virtual Reality, October IEEE Symposium on Research Frontiers in Virtual Reality, October 25 25-

  • 26, 1993. pp.

26, 1993. pp. 24 24-

  • 31.

31.

  • [SAMMET98]

[SAMMET98] Samet H., Webber R.E. "Hierarchical data structures and algorith Samet H., Webber R.E. "Hierarchical data structures and algorithms ms for computer graphics, part I: Fundamentals." IEEE Computer Grap for computer graphics, part I: Fundamentals." IEEE Computer Graphics and hics and Applications, vol. 8, no 3., May 1998. pp. 48 Applications, vol. 8, no 3., May 1998. pp. 48-

  • 68.

68.

  • [LIN98] Lin, Ming C., Gottschalk S. "Collision detection betwee

[LIN98] Lin, Ming C., Gottschalk S. "Collision detection between geometric models: a n geometric models: a survey" In Proc. of IMA Conference on Mathematics of Surfaces, 1 survey" In Proc. of IMA Conference on Mathematics of Surfaces, 1998. 998.

Simulation for Medical Training – MICCAI 2003

Bibliography Bibliography

  • [GANOVELLI00] Ganovelli F., Dingliana J., O’Sullivan C. "BucketT

[GANOVELLI00] Ganovelli F., Dingliana J., O’Sullivan C. "BucketTree: Improving collision ree: Improving collision detection between deformable objects" Conference on Computer Gra detection between deformable objects" Conference on Computer Graphics (SCCG2000), Bratislava, phics (SCCG2000), Bratislava, April 2000. pp. 156 April 2000. pp. 156-

  • 163.

163.

  • [GOTTSCHALK96] Gottschalk S., Lin M.C., Manocha D. "OBBtree: A h

[GOTTSCHALK96] Gottschalk S., Lin M.C., Manocha D. "OBBtree: A hierarchical structure for ierarchical structure for rapid interference detection." SIGGRAPH ‘96 Proc. 1996. pp. 171 rapid interference detection." SIGGRAPH ‘96 Proc. 1996. pp. 171-

  • 180.

180.

  • [COHEN95] Cohen J.D., Lin M.C., Manocha D., Ponamgi M.K. "I

[COHEN95] Cohen J.D., Lin M.C., Manocha D., Ponamgi M.K. "I-

  • COLLIDE: An interactive and

COLLIDE: An interactive and exact collision detection system for large exact collision detection system for large-

  • scale environments." Proceedings of the 1995 Symposium

scale environments." Proceedings of the 1995 Symposium

  • n Interactive 3D Graphics (Monterey, California), 1995. pp. 189
  • n Interactive 3D Graphics (Monterey, California), 1995. pp. 189-
  • 196.

196.

  • [LOMBARDO99] Lombardo J.C., Gascuel M.P., Neyret F. "Real

[LOMBARDO99] Lombardo J.C., Gascuel M.P., Neyret F. "Real-

  • time collision detection for virtual

time collision detection for virtual surgery." Proceedings of Computer Animation '99, May 1999. pp. 3 surgery." Proceedings of Computer Animation '99, May 1999. pp. 33 3-

  • 39.

39.

  • [AHARON02]

[AHARON02] Aharon Aharon S., S., Lenglet Lenglet C., “Collision Detection Algorithm for Deformable Objects Using C., “Collision Detection Algorithm for Deformable Objects Using OpenGL.”, MICCAI (2) 2002: 211 OpenGL.”, MICCAI (2) 2002: 211-

  • 218

218

  • [BRADSHAW02] Bradshaw G., O'Sullivan C., "Sphere

[BRADSHAW02] Bradshaw G., O'Sullivan C., "Sphere-

  • tree Construction Using Dynamic Medial

tree Construction Using Dynamic Medial Axis Approximation", ACM SIGGRAPH Symposium on Computer Animatio Axis Approximation", ACM SIGGRAPH Symposium on Computer Animation, pp. 33 n, pp. 33-

  • 40. ACM
  • 40. ACM

Press, July 2002. Press, July 2002.