Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: jgillan on August 14, 2019, 04:19:59 AM

Title: python script to Invert selection
Post by: jgillan 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!
Title: Re: python script to Invert selection
Post by: jgillan on August 14, 2019, 04:53:30 AM
Alternatively, what is a python command to 'reset point selection'?
Title: Re: python script to Invert selection
Post by: Alexey Pasumansky 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.
Title: Re: python script to Invert selection
Post by: jgillan on August 14, 2019, 04:33:40 PM
BIngo! Thank you Alexey.