Roll pitch roll to Pix4d rotation matrix

 In my TIFF images i have the following initial metadata: XMP::Roll   XMP::Pitch   XML::Yaw.

I need to convert those params to a rotation-matrix R.

I would like to compare metadata initial R with the Pix4D optimized one (i.e. the one stored in the calibrated_camera_parameters.txt file). 

Any tip about how to do it?

PS I already know about this documents:

 

Hi Giorgio,

Let me add two documents to your list :wink:

You will find the necessary information in the paper, but more details about the math involved especially in the companion notes. Since what you want to do is compare the results with what Pix4D computes, you will have to do the conversion manually.

Let us know how the comparison went!

Hi Rhea,

I was trying to compute the Omega, phi and Kappa values from the formulas given in the above documents.

I took the rotation matrix from calibrated_camera_parameters.txt file inside the Pix4D’s output params folder. As given in companion notes, I multiplied the matrix with [(-1,0,0),(0,1,0),(0,0,-1)]. Then I followed the formulas given in right column of table1 in page 6.

omega = arctan −C 2,3/C 3,3

phi = arctan C 1,3/sqrt(C 2,3 **2 + C 3,3 **2)

kappa = arctan −C 1,2/C 1,1

And I compared the values with those given in calibrated_external_camera_parameters.txt file in same params folder.

I found that for some images the Kappa angle came same, but for others, Pix4D has done +/- 180 to the absolute value. I am interested in knowing the logic/pattern about how Pix4D identifies such images?

Thank you.

Hi,
It could be that you did not consider good quadrants when doing the DCM transformation. At least in Matlab, you should use atan2 instead of atan in order to pick the right quadrant.

I have been experimenting with accurate geolocation and orientation setting and has very good experience with it. Up until now the procedure was to upload the pictures and a separate txt file in pix4d mapper with position, orientation and accuracy values. The input and calculated omega, phi and kappa values matched pretty well (see my pictures attached: VT calc is the in-house calculation and pix4d result is the result found in the pix4d folder).

Based on this experience I started to work on geotag the images: lat,lon,alt in the EXIF part and roll,pitch,yaw in the XMP tag of the image.

To my great surprise the roll-pitch-yaw to omega-phi-kappa results by the built in converter of pix4d does not match my own calculations (see the pix4d calc. XMP lines in the plots). I ran all possible configurations flipping the axes of directions in every permutations, but I have not found any option which leads to similar precision as my in-house calculation routine.

To be on the safe side I also did a matlab implementation of the “Yaw, Pitch, Roll and Omega, Phi, Kappa angles and conversion, Pix4D product documentation, January 2020” which again led to a different solution (pix4d calc doc.).

I would be happy to share my matlab code and also the dataset, since I have a suspicion I might be doing something wrong, but I ran out of ideas.

Hi Gyula,

We do not officially support the files in the Output Params folder. The values produced in this folder are for experimental and research purposes only and we do not guarantee their correctness nor provide technical support for justifying the underlying calculations. Please also note that these parameters can be removed from future Pix4Dmapper versions without any prior notice.

Maybe it is worth checking out this community post: What is the local coordinate system

Cheers,
Teodora

Hi Rhea.

I would also like to convert yaw pitch and roll to omega phi and Kappa.

Unfortunately I’m not smart enough to decipher the pix4d article that references some funky mathematics.

Can you help me out a little further on this translation?

I think Agisoft converts it but I do not have an Agisoft account.

Hello,
Unfortunately, we cannot provide personal support for these conversions.
Pix4Dmapper accepts as input the omega, phi , kappa values. However, please keep in mind that these values are not necessary for processing with Pix4Dmapper.
Pix4Dmapper will calculate these values even if there is not such an input.

If you have a drone that does not provide the omega, phi, kappa values, you may want to contact the drone manufacturer to request for more information.
This article and the reference to the mathematics can be useful for drone manufacturers.

I hope it helps.
Christina

No problems.

Thanks anyway Christina.

1 Like