Forum

Author Topic: Python-based replacement of coordinates of detected markers  (Read 537 times)

nako09

  • Newbie
  • *
  • Posts: 1
    • View Profile
Python-based replacement of coordinates of detected markers
« on: April 13, 2022, 03:42:00 PM »
Hello,

I'm working on a python-based solution to replace the coordinates of detected (circular-coded) markers with coordinates from a txt-file. Right now I detect circular-coded markers with the chunk.detectMarkers function and compute their position by chunk.markers.position. My idea was to replace these coordinates with txt-file coordinates, that where measured in-field, but my code says that the position-attribute of Metashape.markers is not writeable.

Is there any way to replace the coordinates of detected markers in position with python? My problem is comparable to this older issue:
https://www.agisoft.com/forum/index.php?topic=2752.0
But it seems that locations-function is not part of the current Metashape-Version anymore.

Based on the same label in detected target and measured target I would like to replace the coordinates of a detected target with the field measured coordinates at this target.

Is there any way to do this in Python?

Thanks,
NaKo

Paulo

  • Hero Member
  • *****
  • Posts: 1103
    • View Profile
Re: Python-based replacement of coordinates of detected markers
« Reply #1 on: April 13, 2022, 05:36:35 PM »
Hi nako09,

for each marker, the marker.position is calculated by Metashape according to the marker.projections it has on the different cameras where it is detected (at least 2). So actually what you can modify with coordinates from text file, is marker.reference.location....
Best Regards,
Paul Pelletier,
Surveyor