Hello joswil,
Here is the example of Python script that works similar to Add Marker command applied to the image in Photo view:
import Metashape
chunk = Metashape.app.document.chunk #active chunk
N = 10 #camera id
x, y = 3000, 2000 #pixel coordinates for marker on Nth camera in the chunk
if chunk.point_cloud:
surface = chunk.point_cloud
elif chunk.tiled_model:
surface = chunk.tiled_model
elif chunk.model:
surface = chunk.model
else:
surface = chunk.tie_points
cameras = [c for c in chunk.cameras if c.type == Metashape.Camera.Type.Regular and camera.transform]
camera = chunk.cameras[N]
marker = chunk.addMarker(camera.unproject([x,y]))
point = surface.pickPoint(camera.center, camera.transform.mulp(camera.sensor.calibration.unproject(Metashape.Vector([x,y]))))
for camera in cameras:
if not camera == chunk.cameras[N]:
continue
if marker.projections[camera]: #skipping, if marker has projections on the given image
continue
x, y = camera.project(point)
if (0 <= x < camera.sensor.width) and (0 <= y < camera.sensor.height):
marker.projections[camera] = Metashape.Marker.Projection(Metashape.Vector([x,y]), False)
print("Script finished")
Scripts sends the ray for Nth camera through x,y coordinates of the image, intersects it with the available 3D surface in the following order, depending on presence in the active chunk: dense point cloud, tiled model, mesh model, tie point cloud. Then re-projects the intersection point back to all the other aligned cameras.
This should work in 2.3 version.