Efficient Distance Computation between Non-Convex Objects

Slides:



Advertisements
Similar presentations
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Advertisements

Fast Algorithms For Hierarchical Range Histogram Constructions
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
B+-Trees (PART 1) What is a B+ tree? Why B+ trees? Searching a B+ tree
The Divide-and-Conquer Strategy
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
CS4413 Divide-and-Conquer
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Divide and Conquer.
K-structure, Separating Chain, Gap Tree, and Layered DAG Presented by Dave Tahmoush.
Bounding Volume Hierarchy “Efficient Distance Computation Between Non-Convex Objects” Sean Quinlan Stanford, 1994 Presented by Mathieu Brédif.
1 Trees. 2 Outline –Tree Structures –Tree Node Level and Path Length –Binary Tree Definition –Binary Tree Nodes –Binary Search Trees.
OBBTree: A Hierarchical Structure for Rapid Interference Detection Gottschalk, M. C. Lin and D. ManochaM. C. LinD. Manocha Department of Computer Science,
Efficient Distance Computation between Non-Convex Objects by Sean Quinlan presented by Teresa Miller CS 326 – Motion Planning Class.
Efficient Distance Computation between Non-Convex Objects By Sean Quinlan Presented by Sean Augenstein and Nicolas Lee.
CSC 2300 Data Structures & Algorithms February 6, 2007 Chapter 4. Trees.
Binary Trees Chapter 6.
B-trees (Balanced Trees) A B-tree is a special kind of tree, similar to a binary tree. However, It is not a binary search tree. It is not a binary tree.
Lecture 10 Trees –Definiton of trees –Uses of trees –Operations on a tree.
Chapter 6 Binary Trees. 6.1 Trees, Binary Trees, and Binary Search Trees Linked lists usually are more flexible than arrays, but it is difficult to use.
Binary Trees, Binary Search Trees RIZWAN REHMAN CENTRE FOR COMPUTER STUDIES DIBRUGARH UNIVERSITY.
COSC 2007 Data Structures II Chapter 15 External Methods.
PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
Lecture 3: Uninformed Search
1 Multi-Level Indexing and B-Trees. 2 Statement of the Problem When indexes grow too large they have to be stored on secondary storage. However, there.
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
R-Trees: A Dynamic Index Structure For Spatial Searching Antonin Guttman.
Where We Stand At this point we know how to: –Convert points from local to window coordinates –Clip polygons and lines to the view volume –Determine which.
A Fast Algorithm for Incremental Distance Calculation Ming C. Lin and John F. Canny University of California, Berkeley 1991 Original slides by Adit Koolwal.
A Fast Algorithm for Incremental Distance Calculation Ming C. Lin & John Canny University of California, Berkeley 1991 Presentation by Adit Koolwal.
Minkowski Sums and Distance Computation Eric Larsen COMP
CLARANS: A Method for Clustering Objects for Spatial Data Mining IEEE Transactions on Knowledge and Data Enginerring, 2002 Raymond T. Ng et al. 22 MAR.
Indexing Structures for Files
Spatial Data Management
3. Polygon Triangulation
Catalogs contain hundreds of millions of objects
Recursion Topic 5.
Bounding Volume Hierarchies and Spatial Partitioning
BackTracking CS255.
Multiway Search Trees Data may not fit into main memory
Binary Search Trees A binary search tree is a binary tree
UNIT III TREES.
Ch9: Decision Trees 9.1 Introduction A decision tree:
Distance Computation “Efficient Distance Computation Between Non-Convex Objects” Sean Quinlan Stanford, 1994 Presentation by Julie Letchner.
Bounding Volume Hierarchies and Spatial Partitioning
Lecture 22 Binary Search Trees Chapter 10 of textbook
B+ Tree.
Real-Time Ray Tracing Stefan Popov.
Mean Shift Segmentation
Query Processing in Databases Dr. M. Gavrilova
Tonga Institute of Higher Education
ITEC 2620M Introduction to Data Structures
Map interface Empty() - return true if the map is empty; else return false Size() - return the number of elements in the map Find(key) - if there is an.
6. Introduction to nonparametric clustering
Craig Schroeder October 26, 2004
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
Multi-Way Search Trees
Types of Algorithms.
Quadtrees 1.
Lectures on Graph Algorithms: searching, testing and sorting
A Robust Data Structure
Sampling Distributions
Text Categorization Berlin Chen 2003 Reference:
Types of Algorithms.
CO Games Concepts Week 12 Collision Detection
B-Trees.
Data Structures and Algorithm Analysis Priority Queues (Heaps)
B-Trees.
CMPT 225 Lecture 16 – Heap Sort.
Presentation transcript:

Efficient Distance Computation between Non-Convex Objects By Sean Quinlan http://graphics.stanford.edu/courses/cs468-01-winter/ CSC/Math 870 Yelena Gartsman 11/11/2018

The Robotic Challenge… Computing the distance between objects is a common problem in robotics… Problem One object is a robot and the other object is the union of all obstacles in the environment Solution We find a point on each object such that the distance between the points is minimized, describing how close the robot is to collision 11/11/2018

Previous Work (1/2) Previous work focused on convex objects Finding the distance between two convex objects Iteratively find pairs of points, one on each object, such that the distance between the points monotonically converges to the minimum Properties of convex objects are difficult to extend to the non-convex cases 11/11/2018

Previous Work (2/2) Non-Convex Objects - Naïve Implementation Each object broken down into convex components Known algorithms are used to determine the distance between these convex components The distance between the two objects is then the smallest distance between any pair of convex components Complexity is O(nm), where n and m are the number of components of each of the objects 11/11/2018

Collision Detection Definition Uses Observations Two objects are in collision iff the distance between the objects is zero Uses Robotics – path planning Computer Graphics – physical based modeling Observations Collision detection often consumes a significant percentage of the execution time Much research has been directed at finding efficient algorithms 11/11/2018

Collision Detection: Efficient Detection Models Hierarchical Model(HM) Describes an object at various levels of detail Detection algorithm uses different levels of detail to reduce the number of components that are examined Bounding Representation(BR) Approximately describes an object with simple primitives such as rectangles Detection algorithm determines if collision has occurred between the BR only then the components of the original model are examined 11/11/2018

Distance Computation: Algorithm Objects described as a set of convex components – Underlying Model(UM) From UM a HBR is built based on spheres that approximates the object Search routine examines HBR of each object and determines pairs of components to compare with a convex distance algorithm Experimental results show that only a small fraction of the possible pairs are compared – thus, O(nm) is avoided 11/11/2018

Distance Computation: A More Efficient Algorithm Compute the distance between objects with a relative error For some applications, it is acceptable to partially underestimate the distance between the objects When relative error is zero, the exact distance is computed When relative error approaches 100%, a value of 0 is returned iff the objects intersect Thus, get benefit of some distance information with the efficiency of collision detection 11/11/2018

Distance Computation: Assumptions UM is a surface representation consisting of a set of convex polygons This implies that algorithm will not detect collision when one object completely contains another object 11/11/2018

Distance Computation: Bounding Shape Based On Spheres Spheres Are Simple The simplest geometric solid Can be specified with a position vector and a radius Calculation of distance between two spheres requires 7 additions, 3 multiplications and 1 square root 11/11/2018

Distance Computation: Binary Tree (1/2) BR consists of approximately balanced binary tree Each node of the tree contains a single sphere Tree has the following 2 properties Union of all leaf spheres completely contains the surface of the object Sphere at each node completely contains the spheres of its descendant leaf nodes Leaf spheres closely approximate the surface of the object Interior nodes represent approximations of descendant leaf spheres 11/11/2018

Distance Computation: Binary Tree (2/2) Tree represents a hierarchical description of the object Nodes that are close to the root represent many leaf nodes but to a coarse resolution Nodes near the bottom closely approximate the shape of the few leaf spheres below them 11/11/2018

Distance Computation: Building A Tree (1/2) Cover the object’s surface with small spheres Spheres will be the leaf nodes of the tree Cover the surface by covering each polygon because UM of the object is a set of convex polygons A regular grid of equal sized spheres covers the polygon with the center of each sphere lying in the plane of the polygon Label each leaf sphere with the polygon for which is was created 11/11/2018

Distance Computation: Building A Tree (2/2) Use a divide and conquer strategy to build the interior nodes of the tree Divide a set of leaf nodes into two approximately equal subsets Build a tree for each of the subsets Combine subsets into a single tree by creating a new node with each of the subtrees as children Build subtrees by recursively calling the same algorithm until the set consists of a single leaf node 11/11/2018

Distance Computation: Finding The Smallest Sphere Use two heuristic methods and select the smaller of the two spheres Because no obvious way to compute the smallest sphere that contains a set of spheres First method finds a bounding sphere that contains the spheres of two children nodes and hence, by induction, all descendant leaf nodes Second method directly considers leaf spheres Select center for bounding sphere and examine each of descendant leaf spheres to determine min radius required Selection of center is done by using the average position of the centers of leaf spheres First method works well near the leaves of the tree, while second method produces better results closer to the root 11/11/2018

The object is a polygon approximation to the letter “g” Example (1/4) The object is a polygon approximation to the letter “g” 11/11/2018

138 leaf spheres used to cover the outline of the object Example (2/4) 138 leaf spheres used to cover the outline of the object 11/11/2018

Example (3/4) Level five 11/11/2018

Example (4/4) Root of the tree 11/11/2018

Distance Computation: Execution Time Bounding tree is expected to be approximately balanced If there are n leaf nodes, we expect there to be about n interior nodes and the depth of the tree to be about logn Time taken to split a set of nodes into two and time needed to form the bounding sphere has order O(ni) complexity, where ni is the number of leaf nodes descending from the i-th node Thus, expected execution time is O(nlogn) and worst case is O(n^2) 11/11/2018

Algorithm: Overview (1/2) Set d to infinity Search routine attempts to show the objects are at least a distance d apart Suppose the search finds two polygons from UM that are less than d apart If polygons intersect, then we know that the distance between two objects is 0 and we are done Otherwise, we set d to the distance between the two polygons and continue the search with the new value of d Eventually, the search shows that either the objects are a distance d apart or the objects intersect 11/11/2018

Algorithm: Overview (2/2) The key to the algorithm is be able to show the two objects are a distance d apart without examining all possible pairs of polygons As each polygon is covered by a set of leaf nodes in the bounding tree, we need only to examine pairs of polygons for which a corresponding pair of leaf spheres are less than a distance d apart 11/11/2018

Algorithm: Implementation (1/3) Search routine examines pairs of nodes in a depth-first manner starting with the root nodes of the two trees If distance between nodes’ spheres is greater or equal to the current value of d then we know the distance between the two sets of descendant leaf spheres is greater or equal to d and can thus be ignored If distance between nodes’ spheres is less than current value of d then we must further examine the children of the nodes 11/11/2018

Algorithm: Implementation (2/3) If both nodes are from interior of the tree, we split one of the nodes into its two children then recursively search the two pairs consisting of a child and the node not split In the case of one interior node and one leaf node, we split the interior node into its two children then recursively search the two pairs consisting of a child and the leaf node In the case of two leaf spheres, the distance between two corresponding polygons can be computed using one of the many available distance algorithms for convex objects 11/11/2018

Algorithm: Implementation (3/3) Issue: the search routine may compute the distance between the same pair of polygons multiple times Because each polygon may be covered by many leaf spheres Solution: We record which pairs of polygons have been examined and before computing the distance between two polygons we check that the computation has not previously been done Record using a Hashtable 11/11/2018

Algorithm: Modification Search routine can be modified to include notion of relative error User specifies a relative error e We calculate a distance d’ such that d’<=d and d-d’<=ed Note, d’ =0 only if d =0; thus, we will not incorrectly report a collision 11/11/2018

Algorithm: Modified Version Search routine must show that the objects are a distance d’ apart The initial value of d’ is set to infinity as in the original algorithm However, when we find two polygons that are closer than d’ apart, we set d’ to be a fraction 1-e of the distance between them 11/11/2018

Algorithm Testing: Scenario (1/2) Six chess piece -- a king, queen, rook, bishop, knight and pawn are randomly placed in 3-dim space For each chess piece, determine its distance to the union of the other five pieces 11/11/2018

Algorithm Testing: Scenario (2/2) Each piece is described by a BR consisting of roughly 2,000 triangles The pieces are non-convex, have rather detailed features and are roughly 100 units high 11/11/2018

Algorithm Testing: Results (1/4) Building Bounding Tree As a pre-computation step, we build the bounding tree for each of the chess pieces For the first two experiments radius of the leaf sphere was set to 2 units resulting in a total of 34,461 leaf nodes The bounding trees for all the pieces are built in 6.4 seconds* * Reported execution times are from an implementation on a Decstation 5000/240 11/11/2018

Algorithm Testing: Results (2/4) Computing Distance The current implementation can examine 80,000 pairs of nodes a second and compute the distance between 11,000 triangles a second For a 20% relative error, the average execution time is 2.0 milliseconds * * Reported execution times are from an implementation on a Decstation 5000/240 11/11/2018

Algorithm Testing: Results (3/4) Varying Relative Error There is approximately two orders of magnitude improvement over naïve implementation if a 20% relative error is specified 11/11/2018

Algorithm Testing: Results (4/4) As two objects get closer, one would expect the search routine to examine more nodes and triangles Algorithm runs a lot slower when the objects are close 11/11/2018

Conclusion The combination of HBR, a simple search routine and a convex distance algorithm appears to be a powerful framework for building an efficient distance algorithm for non-convex objects The notion of relative error enables exact distance computation and collision detection to be unified as two extremes of a single problem By accepting a reasonable relative error, one hopes to achieve the performance of a collision detection algorithm while still obtaining useful distance information 11/11/2018