0

Actually, I'm currently working on a simple project to detect collision between 2 specific objects in a surgery scene. The problem is that I don't have background on such problems so I'm really newbie to such things and I don't know yet what to do. After a little bit of research, I found Bullet library which can be used as a collision detection tool but not sure yet if it suits my case. I already checked some examples where the developer create the objects of interest manually which led me to think that I should detect first the objects of interest then launch the collision detection process.

In my case, I have 2 types of data:

  1. Video shooting the operating room
  2. Cloud points representing the room in 3D

I need to detect the collision between two objects in the scene. Is there any way to use Bullet to achieve such thing? Is it common to use a video as input for a detection collision problem(I'm wondering since I could find too much resources on it)?

I'm just starting so it might be a fuzzy question so sorry in advance for any inconveniences.

EDITED:

I already checked it but my point was to understand what options can be used before digging into the details. For me, a collision detection problem should have 2 parts: the objects of interest (The 2 or more objects that we're trying to detect their collision) and the scene in which we will be trying to detect the collision of the objects of interest. For the scene, the data I have is presented in 2 types mentioned above. So, I was asking about which type of data should be used as input for bullet collision process. Should it be an image taken from the video or should it be a list of 3D points? Or something else?

Maystro
  • 2,907
  • 8
  • 36
  • 71

1 Answers1

1

I have used Bullet half a year ago. I remember, that you need to register objects to Bullet with a collision shape. In simplistic case of your points, it could probably be small spheres. In case of your video, you need to have a 3d representation. I do not understand a 100% what you mean by detecting a "video" for collisions. However, to use Bullet, you need to have a collision shape associated with the object.

Further, you register a Collision Callback. This is one function called for each collision detected. All callbacks are listed here: http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Collision_Callbacks_and_Triggers As the wiki says - and I implemented it this way - to detect a specific collision, you need to iterate over allr esulting manifolds from Bullet manually. A little bit painful and performance wise strange approach. So you cannot register a specific callback for a specific object with another specific object!

Once the objects are registered, you run the algorithm and then you can check all manifolds in the callback.

To get started with Bullet, I used Bullet Physics Simplest Collision Example with the answers at that time.

Community
  • 1
  • 1
Peter Merkert
  • 354
  • 5
  • 14
  • Thanks @Neevo Lima. I have a video filming the scene in which I need to know if there is a collision between two specific objects. So, nothing related to detecting a "video" for collisions. Can u please help me out to clarify few things? If I got it properly, I should have a 3D representation for the objects of interest then try to launch the collision process using these representations. What is going to be the input of the collision process? the video I have? Do you have any recommendation on the algorithm that should be used? something like BVH? – Maystro Oct 24 '16 at 07:46
  • Hi @Maystro, I am still unsure what you mean by you have a video filming the scene. As you have said, you need 3D representations of the object. I would start adding two objects to Bullet of the points you need to check the collisions on. I recommend spheres for points. The point class needs to inherit from the [btCollisionObject](http://bulletphysics.org/Bullet/BulletFull/classbtCollisionObject.html) class. I recommend to take a look at the example link in my answer. It contains a minimal example. And I think Bullet is running GJK. But, I didn't set that up myself. – Peter Merkert Oct 24 '16 at 09:24
  • EDITED question – Maystro Oct 24 '16 at 09:45
  • 1
    If by "_I have a video filming the scene_" you mean something equivalent to having taped a TV program of a surgical operation and you want to detect when/if the [image of the] scalpel "collides" with the [image of the ] aorta, then this is very, very far from "a simple project" ... involving dynamic object recognition of the video to get a list of objects (sizes and locations in 3D space).before you could even consider something like Bullet – TripeHound Oct 24 '16 at 11:43