Author Topic: Estimated yaw pitch and roll values from Camera transform in python api  (Read 1428 times)


  • Newbie
  • *
  • Posts: 16
    • View Profile
I am trying to access camera yaw pitch and roll estimated values (as appear in GUI reference pane)

To get the transformed camera position I am using the following code:
Code: [Select]
chunk =
camera = chunk.cameras[2]
transform = chunk.transform.matrix * camera.transform
# this works as expected, values are matching those in reference pane
pos = transform.translation()

rot = transform.rotation()
# this is not working, expected values are 93.583, -0.937, -44.785, outputted values are 273.58297001960716, 1.784351814162492, -135.21509554607456
ypr = Metashape.Utils.mat2ypr(rot)

I can do this using external libraries, but thought there would be a way to do this inside of metashape. This issue is persistent over different documents

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14890
    • View Profile
Hello Mitchell,

Please check, how the estimated coordinates and orientation angles are calculated in the following script example:
Best regards,
Alexey Pasumansky,
Agisoft LLC