Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: cwoe on March 02, 2021, 09:16:21 PM
-
Hi there,
I want to filter my dense point cloud with some masks (by file).
The entire workflow with adding masks before depth map & dense creation works, but I would like to create the dense cloud first.
As far as I understood, the process is to select points by mask and then export those.
I'm trying to use the method
Metashape.DenseCloud.selectMaskedPoints(camera, softness=4)
with camera being camera = chunk.cameras
However, this gets me the following error:
TypeError: descriptor 'selectMaskedPoints' requires a 'Metashape.Metashape.DenseCloud' object but received a 'Metashape.Metashape.Camera'
Giving the argument of the dense cloud (object?) (chunk.dense_cloud) obviously returns
TypeError: selectMaskedPoints() missing required argument 'cameras' (pos 1)
Could you give me some pointers into the right direction?
Thanks!
Chris
-
Hello Chris,
I think that the problem is related to the incorrect use of selectMaskedPoints functcion. It should be applied to the actual dense cloud instance, whereas you are trying to apply it to Metashape.DenseCloud() class.
Please try the following approach:
chunk = Metashape.app.document.chunk
chunk.dense_cloud.selectMaskedPoints(chunk.cameras)
It should select the dense cloud points that appear to be masked on any of the aligned images.
-
Thanks a lot Alexey for your explanation, that made it work. Awesome!