0

i'm trying to detect the collision between 2 object. like his one, enter image description here I want to detect collision between my red mallet and those three colored rectangles underneath it. Now for prototype i just use simple color like that. But i want to use image later on.

From what i searched in the internet, looks like box collision is the best way to it. Rectangle collision too small and i fear with the low accuracy.

So my question is, how to build a collision box at the location that i want ?

thank you for your attention. I waited for any of your response

Kevin phytagoras
  • 123
  • 1
  • 2
  • 15
  • I'm not sure if you mean collision detection for bounding boxes or whether "box collision" is a special term. If the former, than you might want to have a look at: http://stackoverflow.com/questions/8714101/how-can-one-easily-detect-whether-2-rois-intersects-in-opencv Create cv::Rect around your objects and test for collision. Later you shoudl check contours for collision, by testing each single line against each single line, or use some kind of bounding box hierarchy. – Micka Dec 23 '13 at 10:20
  • i don't know the right term:D. What i need is a box above those colored rectangles that can be collided with my red mallet. Is that called bounding box ? I will check your link, thank you – Kevin phytagoras Dec 23 '13 at 11:00
  • Do you want the 2D or 3D collision? I.e., do you want to know when the mallet hits the table/paper, or when the red blob intersects the blue or black blob? – Hannes Ovrén Dec 23 '13 at 11:58
  • if it could, i want to know when the mallet hits the table/paper – Kevin phytagoras Dec 23 '13 at 12:51

0 Answers0