Forum

Author Topic: Export 2D image coordinates of the markers  (Read 27864 times)

Outis79

  • Newbie
  • *
  • Posts: 20
    • View Profile
Export 2D image coordinates of the markers
« on: August 13, 2025, 03:38:37 PM »
Hi all,
I would like to extract from Metashape 2.2 the 2D coordinates of the markers for each photo where the projection has been validated in order to get a txt or csv file with the following structure:
marker name, x coordinate, y coordinate, name of the photo.

I do not know Python, Is there any script already done I can use?

Thank you

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15710
    • View Profile
Re: Export 2D image coordinates of the markers
« Reply #1 on: August 13, 2025, 06:52:06 PM »
Hello Outis79,

Please check the following script that outputs the required information to the Console pane:
Code: [Select]
import Metashape
def get_markers_projections(chunk):
print("Script started...\n")
for marker in chunk.markers:
if (not len(marker.projections.keys()) and not marker.position):
continue
for camera in chunk.cameras:
if camera in marker.projections.keys():
x, y, z = marker.projections[camera].coord
print("{:s},{:.2f},{:.2f},{:s}".format(marker.label, x, y, camera.label))
print("\nScript finished")
return
chunk = Metashape.app.document.chunk
get_markers_projections(chunk)
Best regards,
Alexey Pasumansky,
Agisoft LLC

Outis79

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Export 2D image coordinates of the markers
« Reply #2 on: August 14, 2025, 04:54:57 PM »
Thank you very much Alexey, it works great.
« Last Edit: August 14, 2025, 04:57:28 PM by Outis79 »