Please help us understand the Internal/External Camera Parameters export

We are attempting to visualise the registered camera frustums computed in RC in another application. We are having trouble interpreting the rotation information included within the _ Internal/External Camera Parameters _ export (example below). 

Our questions:

How is the heading/pitch/roll defined? We have tried to guess our way without success. Are they defined in world coordinate or image’s local coordinate? In Cesium, the Heading is the rotation about the negative z axis, Pitch is the rotation about the negative y axis, Roll is the rotation about the positive x axis. Is this the same in the _ Internal/External Camera Parameters _ export? What is the default direction(heading/pitch/roll = 0)?
2.
If defined in a world coordinate, x->left to right, y->backward to frontward, z->down to up?
3.

If defined in a local coordinate, are they using the EastNorthUp coordinate?

  1. In terms of transforming the heading/pitch/roll into a matrix, are there any other transform we need to do in order to compare to the algorithm in this article?

Any documentation would be much appreciated.

#name,x,y,alt,heading,pitch,roll,f,px,py,k1,k2,k3,k4,t1,t2
DJI_20220221103904_0022.JPG,-5041986.508798251,2573482.020935406,-2929105.142556032,-148.4200306549068,10.20497551291449,118.7049066788339,34.98005589922394,2.08370424314095e-003,8.261463622613804e-003,-4.472883919490048e-002,4.299250744468713e-002,-0.1293881883164149,0,0,0 DJI_20220221103956_0044.JPG,-5041974.610274723,2573499.802754866,-2929110.290966901,10.38505537635033,-9.7283810446774,-115.7011765380064,35.00697049557222,-2.759873217514973e-003,1.409853041227379e-002,-4.302171265375437e-002,2.572761946144416e-002,-9.709280172749243e-002,0,0,0

Hi Josh33357,

regarding to question 1, it is considered in the camera coordinate system, where X is pointing to the plane nose (or north), Y is pointing to right wing and Z is pointing down. Then heading/yaw is around Z axis, pitch is around Y axis and roll is around X axis.

Default direction looks like this (in a local world coordinate system, where Y is pointing to north):

Yaw = 0, image is oriented to Y (upper side of image is oriented that way)
Pitch = 0, image is looking down
Roll = 0, image is parallel with X axis

Regarding to question 2 and 3, the YPR are considered in camera coordinate system, as I mentioned in previous answer (X to north, Y to east and Z down).

Regarding to question 4, this is how you can compute the rotation matrix in JavaScript:

    EulerRotation: function (y, p, r) {

        var cx = Math.cos(LA.Deg2Rad * r);

        var cy = Math.cos(LA.Deg2Rad * p);

        var cz = Math.cos(LA.Deg2Rad * y);

        var sx = Math.sin(LA.Deg2Rad * r);

        var sy = Math.sin(LA.Deg2Rad * p);

        var sz = Math.sin(LA.Deg2Rad * y);

        return [cx * cz + sx * sy * sz, -cx * sz + cz * sx * sy, -cy * sx,

        -cy * sz, -cy * cz, -sy,

        cx * sy * sz - cz * sx, cx * cz * sy + sx * sz, -cx * cy];

    },

 

374823146340 perfect, thanks! We are now up and running. Appreciate your assistance.

You’re welcome!

If possible could you have a look at this question ? https://support.capturingreality.com/hc/en-us/community/posts/5215775994780-Camera-Coordinate-System-Explanation

Any help would be great! Thanks a lot!

@ which software where you using ?

@OndrejTrhan We are looking to convert the registered cameras from a drone in RC to a third party like Cesium or Three js. In your answer, are you suggesting that the rotation matrix can directly be applied to a camera in cesium?

Hi @brizzle1834
In that answer is described the process to compute the rotation matrix used in RealityCapture.
I am not sure about the axis orientation in Cesium, but RealityCapture have it as Y to North, X to East and Z to Up. So, if the systems are the same, the rotation matrix should work also in Cesium.

1 Like