Forum

Author Topic: Python command for adding fiducial markers  (Read 4633 times)

yourvick

  • Newbie
  • *
  • Posts: 1
    • View Profile
Python command for adding fiducial markers
« on: September 13, 2024, 06:43:53 PM »
I'm working with large numbers of scanned aerial photos with a complex grid of fiducial markers - too many to add to the GUI by hand.

I can't seem to find or work out the right command for adding a fiducial marker to a photo/calibration group. Not assigning photo coordinates to an existing fiducial (that is covered here https://www.agisoft.com/forum/index.php?topic=14822.msg64922#msg64922), but creating/adding the fiducial with its mm coordinates in the first place.

Any help greatly appreciated!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15420
    • View Profile
Re: Python command for adding fiducial markers
« Reply #1 on: September 30, 2024, 11:41:42 AM »
Hello yourvick,

Please check the commands below:

Code: [Select]
sensor = chunk.sensors[0]
sensor.film_camera = True #switches the sensor to film camera with fiducial marks

f = chunk.addMarker()
f.type = Metashape.Marker.Type.Fiducial #switches marker type to fiducial
f.sensor = sensor #assigns fiducial to the sensor

f.reference.location = Metashape.Vector([120.22, 122.15, 1]) #coordinates in mm
f.projections[camera] = Metashape.Marker.Projection(Vector([89.49, 67.35]), True) #coordinates in pix

If there are more specific questions, please let me know.
Best regards,
Alexey Pasumansky,
Agisoft LLC