Forum

Author Topic: Using Markers to Determine Rotation  (Read 1683 times)

nanythemummy

  • Newbie
  • *
  • Posts: 4
    • View Profile
Using Markers to Determine Rotation
« on: May 24, 2024, 12:28:54 AM »
I have a set of objects that I’m scanning which have definite “up” directions. Since I’m automating the photogrammetry process for these objects, I want to write code which will always rotate the object such that this up direction aligns with the world space Y axis—when I export the model, the object will be centered on (0,0,0), and the direction marked as “up” will always be rotated upward.
Since it’s hard to programmatically tell which way is up, I’ve scanned a marker palette where the markers form a cross which should align with X and Z. So, say Markers [1,2,3,] are on the X axis and Markers[4,5,6] are on the Z axis.
Theoretically, I should be able to get the vector between two points in the “X axis Markers” list and two points in the “Z-axis Markers” list, and calculate the cross product between them to get the Y axis.
Once I  have my three axes as defined by markers. I would like to rotate the model such that the marker defined axes line up with the ones in World space such that when I export the models, the object will be facing right-side-up.
Any ideas on how to do that? Specifically, I’m unsure how to get the angle between the Y axis that I calculated above with the markers, and the Y axis in world space, and how to apply that transformation to the model such that it rotates in world space.
I am not really even sure how world-space and object space works in metashape, so any help would be greatly appreciated.
« Last Edit: May 24, 2024, 01:07:08 AM by nanythemummy »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15086
    • View Profile
Re: Using Markers to Determine Rotation
« Reply #1 on: June 07, 2024, 01:24:59 PM »
Hello nanythemummy,

Can you show a simple sketch of the markers' configuration with the expected directions of the coordinate system axis shows as well?
Best regards,
Alexey Pasumansky,
Agisoft LLC