Creating 3D Bounding Boxes

There is no ready-to-use sample that convert 2D to 3D boxes but you can take a look at the repository here :

You can use this function here :

Instead of using the center of the bbox 2D (bounds[0] /bounds[1]), use the 4 points of the 2D bbox and convert to 3D using the same code. it will return a X,Y,Z for each 4 points.

To create the 4 remaining points, you need to generate them using an arbitrary rule that might depend on the object class:
A simple way would be to say that the 4 remaining points are 1m away in the Z axis from the existing 4 3D points.
It could be 1m away on the Z axis or 1m away on the camera -> object axis. This 1 meter value will fit for people but you might change for other objects.

1 Like