12
Image Based Collision Detection Rafael Kuffner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to the problem of collision detection using images to represent complex enviroments and buildings derived from laser scan, creating several 2.5+D maps that together represent a 3D view of the world. Keywords: Collision Detection, Image-based, Point-Cloud, Interactive Applications, Polygonal Oversampling. 1 Introduction 1.1 Problem and motivation Collision detection is normally a bottleneck in the visualization and interaction process, as col- lisions need to be checked at each frame. Tra- ditionally, the more complicated and crowded is our scene, the more calculations need to be done, bringing our frame-rate down. There- fore the optimization of this process, gaining speed without losing quality in the simulation, is something that has been researched for years. Different techniques and approaches such as bounding volumes, distance fields, and other auxiliary data structures that group object fea- tures together to diminish the number of useless testings have been developed, and showed good performance. Invariantly, in more complex or crowded scenes, or on a situation where one does not have enough processing power available, one quickly reaches a performance bottleneck while trying to keep the realism of the simulation. Also, in scenarios that use a different object representation such as a point cloud, we can’t rely on object topology information. The clas- sical approaches either won’t work, or will have to heavily adapt to this specific scenario, tay- loring its optimizations to a point cloud repre- sentation. Using images as an alternative way of ex- ecuting the task of collision detection might just be the answer. Image-based techniques can have their precision easily controlled by the resolution of the used images, and the algo- rithms are completely independent of the ob- ject’s topology. It doesn’t matter whether we have a pointy object, a round one, or even a point cloud, as all we’re dealing with is the ob- ject’s image representation. Being a scalable and promissing technique, Image-based colli- sion detection seems to be a plausible alterna- tive to the classical approaches. Our approach focuses in a virtual reality nav- igation scenario, where we’re representing data coming from the real world via devices such as laser scans, which present us with enourmous point clouds. Also, the hardware available on our hands might not fit the basic requirements for most algorithms and techniques, a situa- tion that commonly will happen in tourism hotspots, museums, or other places where we want ordinary people to interact with the sys- tem. The main contribution of our research is a new 3D world representation for enviroment and buildings completely image-based with use- ful information for collision-detection queries. Slicing the structure along the Z axis (Figure 1) , we create a discrete set of images containing height information about the surface, and pos- sible collidable frontiers. It’s a flexible format, that is able to represent either point clouds or polygonal models. This representation allow us to perform collision detection with user chosen 1

Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

  • Upload
    lamlien

  • View
    221

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

Image Based Collision Detection

Rafael Kuffner dos Anjos

October 25, 2011

Abstract: This work explores an alternative approach to the problem of collision detectionusing images to represent complex enviroments and buildings derived from laser scan, creatingseveral 2.5+D maps that together represent a 3D view of the world.Keywords: Collision Detection, Image-based, Point-Cloud, Interactive Applications, PolygonalOversampling.

1 Introduction

1.1 Problem and motivation

Collision detection is normally a bottleneck inthe visualization and interaction process, as col-lisions need to be checked at each frame. Tra-ditionally, the more complicated and crowdedis our scene, the more calculations need to bedone, bringing our frame-rate down. There-fore the optimization of this process, gainingspeed without losing quality in the simulation,is something that has been researched for years.

Different techniques and approaches such asbounding volumes, distance fields, and otherauxiliary data structures that group object fea-tures together to diminish the number of uselesstestings have been developed, and showed goodperformance.

Invariantly, in more complex or crowdedscenes, or on a situation where one does nothave enough processing power available, onequickly reaches a performance bottleneck whiletrying to keep the realism of the simulation.Also, in scenarios that use a different objectrepresentation such as a point cloud, we can’trely on object topology information. The clas-sical approaches either won’t work, or will haveto heavily adapt to this specific scenario, tay-loring its optimizations to a point cloud repre-sentation.

Using images as an alternative way of ex-ecuting the task of collision detection might

just be the answer. Image-based techniquescan have their precision easily controlled by theresolution of the used images, and the algo-rithms are completely independent of the ob-ject’s topology. It doesn’t matter whether wehave a pointy object, a round one, or even apoint cloud, as all we’re dealing with is the ob-ject’s image representation. Being a scalableand promissing technique, Image-based colli-sion detection seems to be a plausible alterna-tive to the classical approaches.

Our approach focuses in a virtual reality nav-igation scenario, where we’re representing datacoming from the real world via devices such aslaser scans, which present us with enourmouspoint clouds. Also, the hardware available onour hands might not fit the basic requirementsfor most algorithms and techniques, a situa-tion that commonly will happen in tourismhotspots, museums, or other places where wewant ordinary people to interact with the sys-tem.

The main contribution of our research is anew 3D world representation for enviromentand buildings completely image-based with use-ful information for collision-detection queries.Slicing the structure along the Z axis (Figure 1), we create a discrete set of images containingheight information about the surface, and pos-sible collidable frontiers. It’s a flexible format,that is able to represent either point clouds orpolygonal models. This representation allow usto perform collision detection with user chosen

1

Page 2: Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

2 RELATED WORK 2

precision, and high scalability.

2 Related Work

The problem of collision detection is present invaried areas of research and applications, eachof them having different concerns and desiredresults. This necessity has given birth to severaltechniques that try to deliver these results usingvaried approaches.

The goal of collision avoidance is to predictan upcoming collision, and use this informa-tion to prevent it from happening. It is usedmostly in artificial intelligence to control intel-ligent agents or robots.

The BOIDS framework [24] uses simple cir-cular spheres are used to detect obstacles inthe vicinity. On Ondrej et. al [23] work, amore complex technique is presented that sim-ulates the human vision to detect obstacles onthe agent’s path. Loscos et. al [20] representthe environment as patches to where the agentcan or cannot go according to it’s occupation.

Feature based algorithms use the vertices,edges and faces (so called features) of the ob-ject’s boundary to perform geometric compu-tations to determine if a pair of polyhedra in-tersect and possibly calculate the distance be-tween them. Famous examples are the Lin-Canny algorithm[19] and it’s more recent re-lated algorithm, V-Clip[21], that keeps track ofthe closest features between two objects, deriv-ing both the separation distance, and the ver-tices that have possibly already penetrated theother object.

By far the most popular class of collision de-tection algorithms, BVHs work by dividing theobjects in smalller primitives contained by it,until a certain leaf criteria is achieved (top-down approach) or starting on the smallestprimitives possible, grouping up until a singlevolume is achieved (bottom-up). Each prim-itive is enveloped by a particular boundingvolume shape such as Spheres [15], OrientedBounding Boxes (OBB) [12] , or Axis AlignedBounding boxes (AABB) [18] [11] [28], eachof them having their advantages over the oth-ers; Spheres are easier to fit, OBBs have faster

pruning capabilities, and AABBs are quickerto update, therefore being very popular in de-formable body simulation.

When checking for collisions between two ob-jects, the hierarchy is traversed top-down, test-ing only elements which have parents that havecollided with another BV, avoiding useless cal-culations. Different tree traversing and creationtechniques [18] [12] have been developed to op-timize these expensive operations, taking intoaccound each specific kind of application.

Stochastic algorithms that try to give a fasterbut less exact answer have been developed, giv-ing the developer the option to ”buy” exact-ness in collisions with computing power. Thetechnique based on Randomly selected Primi-tives, selects random pairs of features that areprobable to collide, and calculates the distancebetween them. The local minima is kept forthe next step and calculations are once againmade. The exact collision pairs are derivedwith Lin-Canny [19] feature based algorithm.With a similar idea, Kimmerle et. al [25]have applied BVH’s with lazy hierarchy up-dates and stochastic techniques to defformableobjects and cloth, where not every boundingbox is verified for collision, but it has a certainprobability.

Image-based algorithms commonly workwith the projection of the objects, opposed tothe previous techniques that work in objectspace. RECODE [6] and several other works[17] [22], [5] take advantage of the stencil bufferand perform collision detection on it by usingobjects coordinates as masks, and thus detect-ing possible penetrations.

CULLIDE [13] uses occlusion queries only todetect potentially colliding objects, and thentriangle intersubsection is made on the CPU.They render the bounding volumes of the ob-jects in normal and reverse list storage order,and remove the objects that are fully visible inboth passes, meaning they are not involved inany collision.

Heidelberger et. al [14] uses simple AABB’sas bounding volumes for the objects in thescene. Potentially colliding objects are de-tected, and a LDI (Layered Depth Image [26])of the intersubsection volume between the two

Page 3: Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

3 IMPLEMENTATION 3

Table 1: Coarse granularity in the compromise between precision and efficiency.

Advantages DisadvantagesFeature based Simple implementation, precise Not ScalableBVH Popular implementation, rela-

tively scalable, reliableCompromise between precisionand efficiency hard to obtain, re-quires input data to be properlysegmented

Stochastic Fast and adaptable Not completely reliable, sharesall of BVH’S issues.

Image-based Scalable and precise, topologyindependent, works with un-structured polygon soups

Requires specific graphic card ca-pabilities

objects is created. That is, a volumetric rep-resentation of an object across a chosen axis.At each rendering step, as a polygon is pro-jected into the LDI, the size of the intersubsec-tion volume is computed. Faure et. al [10] [3]adresses not only collision detection, but alsoit’s response by using this same principle.

Regarding collision detection on pointclouds, algorithms using feature based tech-niques, bounding volumes, and spatial subdi-vision have been developed. Similar to theidea presented in SWIFT [8], Klein and Zach-mann [16] create bounding volumes on groupsof points so collision detection can be normallyapplied. Figueiredo et. al [11] uses spatial sub-division to group points in the same voxel, andBVHs to perform collision detection.

In Table 1 we have a quick comparison ofthe refered techniques, where we can see thatimage-based algorithms are the ones more fit-ted to our scenario. For further information oncollision detection and avoidance techniques wesuggest the following surveys: [4] [9] [27].

3 Implementation

Image-based algorithms that have been pre-sented in the community ([13] [6] [17] [7] [3][10]) perform very well in various kinds of sce-narios, but some features of our set scenario(described on section 1.1) make them hard orimpossible to be applied (e.g. our data is un-structured, not all objects are closed or convex).

Our work extends the idea of a 2.5D map pre-

Figure 1: Slices creation process, and cameravariables

sented on the work of Loscos et. al [20] com-bining it to a a height-map, where the pixelcolor not only represents the height on thatpoint, but also contains obstacle information,while overcoming the limitations of only sup-porting single floor environments. Instead ofhaving just one height map, we create a seriesof special maps along intervals sized sigma onthe z axis, thus enabling the storage of morethan a single z value for each (x, y) pair. Us-ing the color of each pixel as a representationof a voxel, we write height information on thered channel, and identify obstacles on the bluechannel. By adding these variables, we can de-termine not only the height where the avatarshould be standing, but also if he is collindingwith any obstacle in several different heights.

Page 4: Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

3 IMPLEMENTATION 4

Figure 2: Pipeline of operations executed on the preprocessing stage in order to create the slicesrepresentation

3.1 Slices creation

The creation of this representation is executedin a pre-processing stage, divided in severalsteps (Figure 2) that must be performed fromthe input of the model until the actual render-ing to create the snapshots that will be the usedas collision maps.

Algorithm 3.1 Slices creation

for z = z0 → z = zmax dozcam ← z0 + σnearcam ← 0farcam ← σleftcam ← max(zmax, xmax)rightcam ← min(zmin, xmin)bottomcam ← max(zmax, xmax)topcam ← min(zmin, xmin)render and snapshot

end for

Algorithm 3.1 describes the last step of theprocess: creating the slices. It sets up thecamera according to the previously calculatedbounding boxes of the input model on an or-thogonal projection. After each rendering ofthat projection, a snapshot sized σ is createdand saved onto the disk for further use.Thecamera then is moved along the z axis, and theprocess is repeated until the whole extension ofthe model has been rendered onto images. A vi-sual representation of the variables mentionedand the slices made on an example model can

be seen on figure 1

3.2 Polygonal model oversam-pling

Although we aim for a solution that acceptsboth polygonal models and point clouds, itis not possible to treat them as if they wereunique. We focused ourselves on an approachthat is easy to apply on point clouds, as theycan be considered a simpler representation of apolygonal model.

We apply a simple oversampling operationthat operates on a triangle level transforminga polygonal model into a perfect point cloudwith a user-choice level of precision. Figure 3shows an average polygon count model that de-scribes this situation exactly. After discardingthe polygons, we do not get a faithful repre-sentation of the original shapes, but after pro-ducing a point cloud through oversampling, theshape is exactly as the polygonal representa-tion.

For each triangle 4abc on the input model,we check if the distance between any of itspoints is smaller than threshold t, which rep-resents the pixel size on the output image. Ifone meets this criteria, we are sure that anypoint inside this triangle is closer than t froman edge, otherwise we will apply the oversam-pling operation to it. Variables n1, n2 and n3represent the number of points to be createdbetween two given points (x, y) in order to fit

Page 5: Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

3 IMPLEMENTATION 5

Figure 3: Polygonal model, vertexes only, and generated point cloud

the threshold and are given by dist(x,y)t .

Starting on point a, we start to create pointsalong the edges ab and ac. Each pair of points(abi, aci) created is then considered a new edge,and ni points are created along it.

When one of the edges is completed, westart creating points along bc. The oversam-pled points created along this edge are inter-polated with the points still being created onthe uncompleted edge ab or ac, thus filling thesurface of the triangle.

The whole process applied to the input modelcreates a point cloud with precision defined byt. This guarantees us to have enough points torepresent a closed surface without having un-filled pixels on the output image.

3.3 Information processing andencoding

Since all of our collision information will bewritten on collision maps as colors, we must as-sign each point on the point cloud a color repre-senting its collision information. This will notreplace the original color of that point in ques-tion. When writing these points on the outputimage on Algorithm 3.1, each pixel will rep-resent a voxel sized (t,t,σ) on object space. Sothe painted color on that pixel will represent allthe points contained on that area. Algorithm3.2 performs both the operation of height mapinformation encoding, and obstacle detection.

The first operation is executed as follows:We calculate the difference between the cur-rent point z coordinate and the models lowerbounding box zmin, and apply the modulo op-erator with σ. This remainder r represents thepoints z coordinate on an interval [0, σ].

Algorithm 3.2 Points coloring and obstacledetection

for all points p in m do

s← floor(abs(z−zmin)σ )

red← abs(z−zmin)modσσ

redold ← cube[xscreen][yscreen][s]

if abs(redold−red)σ > σε then

cube[xscreen][yscreen][s]← 1p.color(red, 1, 1)if redold > red thenp.z ← p.z + (redold − red) ∗ σ + ε2

end ifelsecube[xscreen][yscreen][s]← redp.color(red, 1, 0.1)

end ifend for

To be used as a color value it must belong onthe interval [0, 1], so we calculate r

σ , derivingfinally the red channel value. The simplified

formula is given by red← abs(z−zmin)modσσ

As navigation on a real-world scenario is nor-mally performed horizontally on the xy plane,we classify an obstacle as a surface that is closeto perpendicular to xy, parallel to zy. So ourobstacle collision technique simply estimateshow paralel to the z axis a certain surface is.Figure 4 describes briefly this estimative oper-ation executed on algorithm 3.2. Points linedup vertically on the same pixel most likely tobelong to a vertical surface.

Using an auxiliary structure, the 3D arraycube[w][h][σ], after processing each point, wekeep its color value on the position of the ar-ray representing the voxel on object space from

Page 6: Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

3 IMPLEMENTATION 6

Figure 4: Technique for surface orientation de-tection. Red points belong to a vertical struc-ture, grey points to the floor.

where it came from. If there is already a storedvalue on this voxel, the difference between bothred values is calculated, and transformed into

an object-space distance abs(redold−red)σ

If this difference is bigger than a certain smallpercentage ε of the size σ of the slice, we assumethat the points are vertically aligned, belongingto a vertical surface. These points are markedon their blue channel with the value 1, and weslightly increase it’s z coordinate in order to thepoint not be occluded on rendering time.

Some of the output slices from the pre-processing stage can be observed in Figure 5,an office environment, where the floor has beencorrectly assigned as green, and all the walls aswhite or light blue.

3.4 Collision detection

The developed representation provides us withenough information to perform quick collisiondetection on the navigation scenario given onsubsection 1.1 where we consider point cloudsas a viable input. While the aspects concerningthe realism of the collision response have notbeen explored, precision on simple rigid bodiescollision detection has been achieved.

We divide the task of collision detection intotwo steps: a first step, that we call Broad phase,where we verify the occurance of collisions be-tween any objects in the scene, and a secondstep called narrow phase, where we perform col-lision response.

3.4.1 Broad phase and collision detec-tion

This task consists on identifying possible colli-sions between all objects on the scene. By rep-resenting the avatar that will be navigating onthe environment by an Axis Aligned BoundingBox (AABB), we first calculate its size in pixels

by calculating pixx ← sizext and pixz ← sizey

t ,where threshold t was calculated as the pixelsize. This will be the number of pixels checkedfor collision on each slice, around the center ofthe pawn. If any checked pixel is not black, wemark the object as colliding, and will be pro-cessed in a narrow phase.

The only images we will need to loadinto the memory at the same time in or-der to perform collision detection are fromslice0 ← zpawnmin+zpawn−zmin

σ to slicen ←zpawnmax+zpawn−zmin

σ , the slices that containinformation about the area where the pawn cur-rently is.

New needed slices are onto memory until auser defined constant nslices is reached. Newslices beyond this point, replace an alreadyloaded slice that has the furthest z value fromthe avatar’s own z value, meaning it is notneeded at this point of the execution.

3.4.2 Narrow phase and collision re-sponse

Our collision response algorithm has as it’s onlyobjective to simply avoid objects from overlap-ping, and provide with a basic navigation expe-rience on the given environment. This can beachieved with a simple extension to our broad-phase algorithm, by applying the concepts ofcollision response from height maps, and colli-sion avoidance [20]. Instead of returning truewhen we find pixels that are not black, wegather information for collision response eachtime we find colored pixels.

Pixels with the blue channel set to 1 alwaysrepresent an obstacle, except on applicationswhere we want to enable the avatar to climbsmall obstacles, as the agents from Loscos et.al[20]. On these situations, we may ignore thesepixels up until the height we want to be con-sidered as climbable. As our avatar moves on

Page 7: Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

4 EXPERIMENTAL RESULTS 7

Figure 5: Three slices of an office environment, where walls and floor are clearly distinguished,aswell as a subsection of a roof on the entrance.

fixed length steps, and each time it collides, wecorrect it to the place he was on the previouscheck, that we always assume as a valid posi-tion. We apply this (x, y) correction each timean obstacle pixel is found until all the pixelsrepresenting the avatar’s bounding box are ver-ified.

Height is defined exactly as it is on heightmaps. Multiplying the coded height informa-tion on the red channel by σ and adding the zbase coordinate of the given slice, we have pre-cise information about the given point’s height.Collision response can be made by setting thefinal height to the average height of the pointson the base of the bounding box, or by themaximum value. Here also we check for surfaceheight values from the first slice until the heightwe want to consider as climbable. The complex-ity of this operation is exactly O(pixx∗pixy∗s),but without adding any extra operation fromthe broad phase checking.

4 Experimental Results

4.1 Environment and settings

We have implemented the whole algorithm us-ing OpenGL 2.1.2, C and the OpenGL UtilityToolkit (GLUT) to deal with user input andthe base application loop managing. The plat-form used for testings is a computer with a Intelcore 2 Duo CPU at 2 GHz with 2GB of RAM,a NVIDIA GeForce 9400 adapter, running Mi-crosoft Windows Seven x86.

Seven models have been used for testing, eachrepresenting different scenarios and styles ofmodeling. None of them were tailored in a spe-cific way to our application, as most of themwere downloaded from free 3D models repos-itoriums on the web [2] [1]. A more detailedoverview of them can be seen on Table 2

Tests have been done for each model usingtwo different image resolutions (700x700 and350x350), performing obstacle detection (sig-naled by a + on Figure 6) and one without it(signaled by a - on Figures 6). This providesus with enough information about the key vari-ables that make the difference on the efficiencyof this stage. Resolution, obstacle detection,and polygonal oversampling.

Figure 6 shows the time taken on the wholepreprocessing stage for each model and con-figuration. Polygonal oversampling is clearlythe most heavy task on the pipeline, since thetwo tested point clouds had the faster perfor-mance. The increase on processing time withpoint clouds is linear to point complexity. Thislinear growth is expected since each point mustbe checked for coloring once, and also for com-mon input processing such as input file readingand display list creation.

Regarding overall memory cost, we find thatmemory scales according to the size of the pointcloud. Tests have shown that memory con-sumption was ordered according to the sizeof the produced point clouds. Table 3 showsthe results of oversampling, and the size of thepoint clouds. The only extra memory needed

Page 8: Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

4 EXPERIMENTAL RESULTS 8

Table 2: Features of the models used for evaluation

Model Type Complexity DetailsOffice Polygonal 17.353 pts Office environment with cubicles and

hallwaysChurch Polygonal 26.721 pts Simple church with stairs and columnsSibenik Polygonal 47.658 pts Cathedral of St. James on Sibenik,

CroatiaColumns Polygonal 143.591 pts Big environment with localized com-

plexity.Room 3D laser Scan 271.731 pts 3D Scan of a room with chairs, a table,

and other objects.Street Polygonal 281.169 pts Outside street environment with an ir-

regular floor, houses, and several ob-jects.

Entrance 3D laser Scan 580.062 pts Entrance of the Batalha monastery inPortugal.

Figure 6: Graph picturing average time values in seconds for the pre-processing stage of eachmodel and configuration.

for our preprocessing stage is for allocating theauxiliary 3D array for obstacle detection.

During the application runtime, memoryconsumption varies according to the number ofloaded slices onto the RAM, but by controllingnslices we can avoid this value from going overthe memory we wish the application to con-sume. On a 700x700 resolution, the minimalvalue found was 81,92MB and the maximum143,36MB , while on 350x350 values were be-tween 61,44MB and 122,88MB. The complexityof the model has a much lighter impact here,being only noticable on tasks that are unre-

lated to collision detection such as renderingand shading.

Results also show that our algorithm did notaffect the rendering speed of the interactive ap-plication at all, environments where the framerate was below the values considered minimumfor interaction would be on this situation withany other collision detection algorithm appliedto it. This shows that our technique is clearlynot the bottleneck of the visualization cycle,one of the main concerns presented on subsec-tion 1.1.

Results on collision detection have been ver-

Page 9: Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

4 EXPERIMENTAL RESULTS 9

Table 3: Polygonal oversampling results

Model Original 350x350 700x700Office 17.353 pts 3.088.193 pts 9.349.585 ptsChurch 26.721 pts 2.246.549 pts 6.475.125 ptsSibenik 47.658 pts 1.838.167 5.199.093 ptsColumns 143.591 pts 1.448.383 pts 2.612.303 ptsStreet 281.169 pts 3.606.225 pts 7.142.361 pts

ified through establishing a fixed route to nav-igate with the pawn where it goes through dif-ferent situations and scenarios. Tests on Cathe-dral have showed us that reading from the diskon runtime has a bigger impact on efficiencythan storing a higher number of images. Whenreading a high resolution image from disk, wenotice a sudden drop on the frame-rate, andthis is well noticed when the pawn falls froma higher structure. Increasing nslices to storeenough slices to represent the ground floor andthe platform on top of the steps, little to no dif-ference was noticed on memory load, and theinteraction was a lot smoother. On a low res-olution though, reading from disk on runtimeshowed no impact on the performance.

Altough we did not aim for high precisionon collision response, our technique has pre-sented precise results on different resolutions.Floor collision has been performed perfectly inall resolutions, as shown on Figure 7. Collisionswith obstacles are more affected by resolution,since we rely on pixel finess to precisely knowthe position of a given surface. Tests on of-fice and street have showed the same errors ofsmall object interference or fake collisions dueto diffuse information about object boudaries.These are more noticable on the interactionswith round objects on Street shown also on Fig-ure 7, where we can notice the aliasing creat-ing invisible square barriers around a perfectlyround object.

Table 4 compares our technique with thework from Figueiredo et. al [11], which hashas been tested on one of our experimentalscenarios, the point cloud of the Entrance ofthe Batalha Monastery, on a machine with aslightly faster processing speed and RAM thanthe one used for our walkthoughs.

Frame-rate was disturbed during the collisiondetection process on the R-tree aproach, whileit remained steady at the 30 fps during thewhole execution of our application. Also, theimage-based technique has required much lessmemory to be executed, even with a high num-ber of slices loaded onto memory. The biggestdifference is in the pre-processing times. Ourapproach was executed 107 times faster thanthe BVH approach, and most importantly, thispre-processing stage must only be performedonce for each configuration, since the represen-tation is written to the hard disk and can beused on further interactions.

As stated on section 2 the research on pointcloud collision detection is recent, and inexis-tent regarding image-based techniques. Our pi-oneer solution has presented excellent results,not only performing better than other workson point clouds published in the scientific com-munity, but also being flexible enough to be ap-plied on models from CAD, or combined withprecise collision response techniques. Withoutadding any load to the visualization pipeline,our technique is not only scalable with inputcomplexity, but also with hardware capabili-ties. Image-based collision detection can beperformed with our representation on any com-puter that can render the input model at anacceptable frame-rate, without requiring any-thing meaningful from the CPU or GPUs.

Page 10: Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

5 CONCLUSION AND FUTURE WORK 10

Figure 7: Low resolution scenario: small round object interaction and floor collision.

Table 4: Comparison between point cloud techniques

Image-based BVH’sFrame-rate 30 fps 16 to 30 fpsTotal Memory 143.36 MB 225,44 MBPre-processing time 13.9 s 1500 s

5 Conclusion and Futurework

A new image-based environment representationfor collision detection has been presented, us-ing 2.5+D slices of an environment or build-ing across the z axis. These images contain ateach pixel, information about a certain voxel,representing it’s contents with colors. Heightmap information is stored on the red channel,and obstacles are indicated on the blue chan-nel. This allows us to have a Broad phase colli-sion detection stage that is performed with highefficiency and scalability, where the user canchoose the precision according to the comput-ing power at hand by simply adjusting the res-olution of the produced images. Point cloudsand polygonal models are ubiquitously pro-cessed, making our approach the top alterna-tive for fast interaction with massive laser scandata.This work fills a gap in the area of col-lision detection, exploring a scenario that hasbeen receiving more attention recently.

5.1 Future work

Implementing our broad-phase collision detec-tion technique on the stencil buffer would

greatly speed up this operation, since less test-ings would need to be made. Also, if we im-plemented the point coloring algorithm using avertex shader, we wouldn’t have to perform theheavy memory allocation we need on the pre-processing stage, and also, calculations wouldbe moved to the GPU, taking away some chargeof the CPU.

Extending this representation to be used byordinary objects such as the statue of David,or the Stanford Bunny, or even applying it tothe avatars we’re using on the interaction, couldpresent interesting results. Using non-uniformresolution images on enviroments where we donot have an uniform complexity, would alsohelp us achieve more precision on our narrowphase, or on these presented situations.

Image comparison techniques can also be ap-plied to the generated images in order to di-minish the number of times we need to load aslice, and also the number of collision detectionchecks we must do.

Page 11: Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

REFERENCES 11

References

[1] http://artist-3d.com - free 3d models.

[2] http://www.3dmodelfree.com - free 3dmodel warehouse.

[3] Jeremie Allard, Francois Faure, HadrienCourtecuisse, Florent Falipou, ChristianDuriez, and Paul G. Kry. Volume con-tact constraints at arbirtrary resoltion.ACM Transactions on Graphics, 29(4),July 2010.

[4] Noralizatul azma BT Mustapha, Abdul-lah Bin Bade, and Sarudin Kari. A reviewof collision avoidance technique for crowdsimulaion. 2009.

[5] George Baciu and Wingo Sai-KeungWong. Hardware-assisted self collision fordeformable surfaces. Proceedings of theACM symposium on Virtual reality soft-ware and technology, 2002.

[6] George Baciu, Wingo Sai-Keung Wong,and Hanqiu Sun. Recode: An image-basedcollision detection algorithm. ComputerGraphics and Applications, 1998.

[7] Niels Boldt and Jonas Meyer. Self-intersectios with cullide. Eurographics,23(3), 2005.

[8] Stephen A. Ehmann. Swift: Acceleratedproximity queries using multi-level voronoimarching. Technical report, 2000.

[9] Kochara et al. Collision detection: A sur-vey. Systems, Man and cybernetics, 2007.

[10] Francois Faure, Sebastien Barbier, JeremieAllard, and Florent Falipou. Image-basedcollision detection and response betweenabitrary volume objects. Eurographics /ACM SIGGRAPH Symposium on Com-puter Animation, 2008.

[11] Mauro Figueiredo, Joao Oliveira, BrunoAraujo, and Joao pereira. An efficient col-lision detection algorithm for point cloudmodels. 20th International conference onComputer Graphics and Vision, 2010.

[12] S. Gottschalk, M. C. Lin, and D. Manocha.Obbtree: A hierarchical structure for rapidinterference detection. SIGGRAPH, 1996.

[13] Naga K. Govindaraju, Stephane Redon,Ming C. Lin, and Dinesh Manocha. Cul-lide: Interactive collision detection be-tween complex models in large enviro-ments using graphics hardware. GraphicsHardware, 2003.

[14] Bruno Heidelberger, Matthias Teschner,and Markus Gross. Real-time volumetricintersections of deforming objects. VMV,2003.

[15] Philip M. Hubbard. Approximating poly-hedra with spheres for time-critical col-lision detection. ACM Transactions onGraphics, 15(3):179–210, July 1996.

[16] Jan Klein and Gabriel Zachmann. Pointcloud collision detection. Eurographics, 23,2004.

[17] Dave Knott and Dinesh K. Pai. Cinder -collision and interference detection in real-time using graphics hardware. Proceedingsof Graphics Interface, 2003.

[18] Thomas Larsson and Tomas Akenine-Moller. Collision detection for contin-uously deforming bodies. Eurographics,2001.

[19] Ming C. Lin and John F. Canny. A fastalgorithm for incremental distance calcu-lation. IEEE, 1991.

[20] Celine Loscos, Franco Tecchia, and Yior-gos Chrysanthou. Real-time shadows foranimated crowds in virtual cities. Proceed-ings of the ACM symposium on Virtual re-ality software and technology, pages 85 –92, 2001.

[21] Brian Mirtich. V-clip: Fast and ro-bust polyhedral collision detection. ACMTransactions on Graphics, 17(8), 1998.

[22] Karol Myszokowski, Oleg G. Okunev, andTosiyasu L. kunii. Fast collision detectionbetween complex solids using rasterizing

Page 12: Image Based Collision Detection - Autenticação · Image Based Collision Detection Rafael Ku ner dos Anjos October 25, 2011 Abstract: This work explores an alternative approach to

REFERENCES 12

graphics hardware. The Visual Computer,11(9):497 – 512, 1995.

[23] Jan Ondrej, Julien Pettre, Anne-HeleneOlivier, and Stephane Donikian. Asynthetic-vision based steering approachfor crowd simulation. ACM Transactionson Graphics, 29(4), July 2010.

[24] Craig W. Reynolds. Flocks, herds, andschools: A distributed behavioral model.SIGGRAPH, 1987.

[25] F.Faure S. Kimmerle, M.Nesme. Hierarcyaccelerated stochastic collision detection.VMV, 2004.

[26] Jonathan Shade, Steven Gortler, Li weiHe, and Richard Szeliski. Layered depthimages. Proceedings of the 25th annualconference on Computer graphics and in-teractive techniques, 1998.

[27] M. Teschner, S. Kimmerle, B. Heidel-berger, G. Zachmann, L. Raghupathi,A. Fuhrmann, M.-P.Cani, F. Faure,N. Magnenat-Thalmann, W. Strasser, andP.Volino. Collision detection for de-formable objects. Eurographics State-of-the-Art Report, 2004.

[28] Xinyu Zhang and Young J. Kim. Inter-active collision detection for deformablemodels using streaming aabbs. IEEETransactions on Visualization and Com-puter Graphics, 13(2), March 2007.