Forum

Author Topic: Select photos belonging to the tie point with the most cameras  (Read 889 times)

protactinium

  • Newbie
  • *
  • Posts: 3
    • View Profile
Select photos belonging to the tie point with the most cameras
« on: February 23, 2022, 09:28:52 AM »
Hi,

I am trying to automate a manual workflow as follows, to help to identify redundant images:

1 - use gradual selection -> image count, drag the slider to the right and then one step back to select all but the the point(s) which are found in greatest no. of images

2 - Edit -> invert selection. - now have only the point(s) selected which have the greatest number of images

3. - 'Filter photos by tie points' to find the matching images

Any pointers at all would be appreciated, as to if this is possible and if so which api commands I should look at

Thanks for any help!

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Select photos belonging to the tie point with the most cameras
« Reply #1 on: February 24, 2022, 07:02:50 AM »
Hello protactinium,

the following code would select all tie points having an image count equal or less than cloud maximum image count -1 (point 1):
Code: [Select]
import Metashape as ps
chunk = ps.app.document.chunk
fltr = ps.PointCloud.Filter()
fltr.init(chunk, ps.PointCloud.Filter.ImageCount)
maximgcnt = fltr.max_value # maximum image count
fltr.selectPoints(maximgcnt-1)

The result would be like in following screen copy... you would then need to code efficiently points 2 and 3 (invert selection and filter photos by tie points)...
This can get you started...
« Last Edit: February 24, 2022, 07:24:40 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor