Forum

Author Topic: Replicating GUI Marker Placement on Masked Images via API  (Read 3307 times)

joswil

  • Newbie
  • *
  • Posts: 1
    • View Profile
Replicating GUI Marker Placement on Masked Images via API
« on: May 07, 2026, 11:53:37 AM »
I am trying to reproduce the manual marker placement in Metashape (the Create Marker option in the GUI / right‑click → Add Marker) using the Python API.

The point I want to place lies on a masked part of the image (I am using a turntable shooting setup). When I place the marker manually in the GUI, Metashape successfully estimates the 3D XYZ position, even though the pixel is masked.

However, I cannot reproduce this behavior through the API.

I tried: marker.projections[camera] = (imgX, imgY). This correctly places the marker projection on the image, but Metashape does not compute its 3D XYZ position.

I also tried the solution suggested here: https://www.agisoft.com/forum/index.php?topic=7446.0 but it does not work for my case, because chunk.point_cloud.pickPoint() searches for the nearest point in the sparse cloud, which is far away from the actual location (the masked region contains no tie points).

Could you please help me reproduce the GUI marker placement behavior through the API?

Thanks