I am exporting cameras using XMP. And also export using Internal / External camera parameters. In my understanding, they should duplicate information, albeit in a different representation. And all the parameters in these two views converge, except for rotations.
in the XMP file: <xcr: Rotation> 0.982594073038806 0.185426733553445 -0.0112166890261935 -0.032113633044729 0.11008102707942 -0.993403685341366 -0.18296885582437 0.976472781986697 0.114> Rotation>
And in CSV:
heading (163.736597399311)
pitch (83.4154313461628)
roll (174.386496244756).
These are two different turns. I attach screenshots of export. Can you tell me what might be wrong?
Upd:
I noticed that if you change the values like this
heading = heading - 180
roll = roll - 180
Then the turns coincide, what could be the problem in the end?
Perhaps this will be helpful in answering the question. The rotation received from CSV matches the rotation matrix from XMP if
heading = heading - 180
roll = roll - 180
and use YXZ. This can be checked using the calculator here https://www.andre-gaschler.com/rotationconverter/ and in the screenshot.
But I do not understand why in the original version it does not give the same results. I am very interested in this in order to understand the export logic, since I want to add camera import from RC to my application.
I have the same problem for two datasets and I rely on the CSV calibration file including the internal/external camera parameters for my workflow.
The first dataset is an outside-in capturing. I can convert Heading-Pitch-Roll to a rotation matrix following the workaround from Sasha with
heading = heading - 180
roll = roll - 180
and using YXZ order.
For the other dataset (inside-out camera array) I just have to change the order to ZYX to get the correct 3x3 matrix. Altering Heading-Pitch-Roll is not required there (in contrast to the first dataset).
For my workflow I need a reliable automated way to import the calibration file and convert the euler angles to a matrix. However if the conversion differs between datasets it’s impossible for me to find the correct conversion without manual checking.
Is there any update on this from the RealityCapture support? Maybe a little explanation how Heading-Pitch-Roll is generated. I’m getting out of ideas and it’s frustrating.