Unity-Technologies / com.unity.perception

Perception toolkit for sim2real training and validation in Unity
Other
909 stars 177 forks source link

3D Bounding Box visualization #474

Closed umairkhawaja closed 2 years ago

umairkhawaja commented 2 years ago

Can anyone help with understanding how to use these values of BoundingBox3d Labeler to visualize a 3D box?

"translation": { "x": 36.20206, "y": -2.58197212, "z": 39.8012123 }, "size": { "x": 2.27042556, "y": 1.74524713, "z": 4.77659559 }, "rotation": { "x": 0.110200636, "y": 0.959971, "z": -0.257339865, "w": 0.009357027 },

What is w in rotation?

@JonathanHUnity

csun commented 2 years ago

Rotation here is represented as a quaternion. There are many other ways of representing rotations - do you know what format you are looking for? There are conversion functions between any of these formats, and most languages with have readily available implementations of these in third-party libraries.

umairkhawaja commented 2 years ago

Oh, thanks for clarifying that. I mainly wanted to plot this 3D box and was trying to understand how to go about that using this information

csun commented 2 years ago

Gotcha - what type of plot exactly? Could you describe what your desired output looks like and what language / libraries you're using? I might be able to help, but would need to know a bit more about your specific situation.

umairkhawaja commented 2 years ago

Just the visualization of the 3D box of each vehicle on the images. Nothing too specific, and using the standard python libraries.

Thanks a lot!

Robotatron commented 2 years ago

You can use data insights package from Unity, they have a notebook for 3D box visualization - https://github.com/Unity-Technologies/datasetinsights/blob/master/notebooks/Perception_Statistics.ipynb

umairkhawaja commented 2 years ago

@Robotatron Thanks! This is exactly what I was looking for