Forum

Author Topic: python script to Invert selection  (Read 367 times)

jgillan

  • Newbie
  • *
  • Posts: 12
    • View Profile
python script to Invert selection
« on: August 14, 2019, 04:19:59 AM »
Hello All,

I'm just looking for a python command to invert the selection of points in headless mode. There appears to be a GUI command but I can't find a python command in the Metashape Python API doc. My interest is to use a color threshold to identify ground points, but then invert the selection so I can delete non-ground points. I find the 'classify ground points' very useful, but I think structure + color would make a better filter for my application.

Thank you!

jgillan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: python script to Invert selection
« Reply #1 on: August 14, 2019, 04:53:30 AM »
Alternatively, what is a python command to 'reset point selection'?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 10929
    • View Profile
Re: python script to Invert selection
« Reply #2 on: August 14, 2019, 03:45:35 PM »
Hello jgillan,

If you have selected the points that you would like to keep and remove all the others, probably you should try chunk.dense_cloud.cropSelectedPoints() method.
Best regards,
Alexey Pasumansky,
AgiSoft LLC

jgillan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: python script to Invert selection
« Reply #3 on: August 14, 2019, 04:33:40 PM »
BIngo! Thank you Alexey.