Forum

Author Topic: Loading Animation path  (Read 4598 times)

bbehera

  • Newbie
  • *
  • Posts: 1
    • View Profile
Loading Animation path
« on: September 26, 2023, 07:55:06 AM »
Hello,

After importing a track.path file into animation it changes the rotation angles to quaternions.
The YAW angles are derived from CAD files, and I exported the camera YAW PITCH ROLL  rotation in degrees inside .path file, is there any way to convert them into quarternions.

Or can this be done using Python script to read speed, XYZ and Y P R values directly instead of .path file.
I tried a script from the forum, to generate a path from polyline but it has incorrect camera rotations. if there is a curve then camera YAW should also rotate to keep the frame perpendicular to a polyline.
Anybody found any solutions?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15276
    • View Profile
Re: Loading Animation path
« Reply #1 on: September 26, 2023, 07:25:39 PM »
Hello bbehera,

Track .path file supported by Metashape doesn't contain yaw, pitch, roll angles - it stores the camera orientation as quaternion. So you will get incorrect camera orientation if the imported .path file has orientation angles input instead of 3 of 4 quaternion components.

If you would like to import the animation using Python script, can you provide an example (a few lines) from the external file with the camera track?
Best regards,
Alexey Pasumansky,
Agisoft LLC

sonno

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Loading Animation path
« Reply #2 on: January 14, 2024, 12:57:10 PM »
Hello bbehera,

Track .path file supported by Metashape doesn't contain yaw, pitch, roll angles - it stores the camera orientation as quaternion. So you will get incorrect camera orientation if the imported .path file has orientation angles input instead of 3 of 4 quaternion components.



Hello Alexey,

I would like to reproduce a camera animation path identical to the trajectory of a camera that took the photos.

I've been able to export the chunk cameras in the Omega Phi Kappa .txt  format and retrieve the coordinates of the cameras that took the shots, but is there a simple way, via export, to retrieve the cameras' orientation quaternions in order to build an animation .path file?

Furthermore, is there a simple way to export quaternions that would target the orientation of the cameras shooting towards the center of the object or towards a particular point of coordinates X,Y,Z targeted?

Thanks in advance,

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15276
    • View Profile
Re: Loading Animation path
« Reply #3 on: January 15, 2024, 02:18:05 PM »
Hello sonno,

I can suggest to check the script published in another thread https://www.agisoft.com/forum/index.php?topic=15761.msg68143#msg68143 - it will create animation camera track based on the existing estimated camera locations in the active chunk. Then you will be able to export the camera track to .path file.
Best regards,
Alexey Pasumansky,
Agisoft LLC

sonno

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Loading Animation path
« Reply #4 on: January 17, 2024, 10:31:19 AM »
Thank you Alexey for that answer, but it's not really what I want to do. But your script is a good example that I will keep. In fact, I'd like to keep the camera trajectory in the same order as you do, but always pointing the object at the center, i.e. with orientation quaternions pointing at the object center (0,0,0).

Incidentally, I sent you a message on the support email on another subject.

Best regards,