David0tt / DeepGTAV

A system to easily extract ground truth training data for different machine learning tasks from GTAV
GNU General Public License v3.0
89 stars 9 forks source link

understanding camera rotation #8

Closed fabiopoiesi closed 2 years ago

fabiopoiesi commented 2 years ago

Hi,

I am trying to understand how to interpret the camera orientation parameters: camrot_x, camrot_y, camrot_z. Is the camera fixed to the drone (i.e. there is no gimbal)? Which axis is the view direction?

For example, in this case the z axis is view direction: 4iFEV

I am asking this because I would like to understand from the metadata when the camera is pointing down or at the horizon.

Thanks!

David0tt commented 2 years ago

Hey,

the camera orientation parameters camrot_x, camrot_y, camrot_z in the meta_data are given relative to the world coordinates. If you are familiar with ScriptHookV those are the returns of CAM::GET_CAM_ROT(camera, 0);

They can be understood as pitch, roll, yaw relative to the world coordinates. (i.e. camrot_x corresponds to pitch, camrot_y to roll and camrot_z to yaw. Note however that they are applied in the order camrot_z -> camrot_x -> camrot_y. That is, we first do the yaw rotation, then the pitch rotation and finally the roll rotation.

So the Y-Axis is the viewing direction.

For most applications the only relevant information is the camrot_x that gives the camera pitch, which is the camera angle relative to the horizon.

A camera looking directly downwards corresponds to camrot_x = -90 A camera looking directly at the horizon corresponds to camrot_x = 0

C-der-Baum commented 2 years ago

I guess this is answered. Let me know if not.