Forum

Author Topic: Filter photos by marker using Python API  (Read 249 times)

aniket@aus.co.in

  • Newbie
  • *
  • Posts: 12
    • View Profile
Filter photos by marker using Python API
« on: August 03, 2022, 09:31:15 PM »
The filter photos by marker work very well on GUI. I need to get the same result of filtering photos using the python API. Is there any way to do it?

and also is there any way to find the approximate positions for the markers on the images?
« Last Edit: August 03, 2022, 09:44:52 PM by aniket@aus.co.in »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13908
    • View Profile
Re: Filter photos by marker using Python API
« Reply #1 on: August 15, 2022, 01:13:35 PM »
Hello aniket,

Here is the example, that applies a filter to the Photos pane, based on the existing projections of the marker:

Code: [Select]
chunk = Metashape.app.document.chunk
marker = chunk.markers[-1] #last marker
cameras_filtered = marker.projections.keys()
Metashape.app.photos_pane.setFilter(cameras_filtered)

As for the marker projections on the cameras, you can check the example in another thread, which shows how to access the existing projection (blue or green flag) and how to estimate the marker re-projected location based on the marker 3D position:
https://www.agisoft.com/forum/index.php?topic=14595.msg64114#msg64114
Best regards,
Alexey Pasumansky,
Agisoft LLC