Forum

Author Topic: Metashape.Tasks.FilterDenseCloud Attribute Error  (Read 1795 times)

mrv2020

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
Metashape.Tasks.FilterDenseCloud Attribute Error
« on: May 14, 2021, 10:30:34 PM »
Hi,

I am trying to use the function to reduce the dense cloud "filterdensecloud" command.

Manual workflow:

Generate the dense cloud> Right click on the "filter dense cloud"> Point Space> "0.30m"> Replace Default dense cloud> "No".

Code: [Select]

chunk.dense_cloud.label = "Full"

task = Metashape.Tasks.DuplicateChunk ()
chunk.dense_cloud = None
task.copy_dense_clouds = True
task.apply(chunk)
                   
task1 = Metashape.Tasks.FilterDenseCloud ()
task1.point_spacing = 0.30
task1.assets = [cloud.key for cloud in chunk.dense_clouds]
task1.apply(chunk)
                   
chunk.dense_cloud.label = "Reduced"



On the end the result is "AttributeError:"

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Re: Metashape.Tasks.FilterDenseCloud Attribute Error
« Reply #1 on: May 15, 2021, 04:36:42 PM »
Hello mrv2020,

I can suggest the following workflow for the procedure that you have described:

Code: [Select]
filtered = chunk.dense_cloud.copy()
task = Metashape.Tasks.FilterDenseCloud()
task.point_spacing = 0.3
task.asset = filtered.key
task.apply(chunk)
The code duplicates the original dense cloud and applies filtering to it.

In your code you are using "copy_dense_clouds" method which doesn't exist and it raises AttributeError.

[/code]
Best regards,
Alexey Pasumansky,
Agisoft LLC