Forum

Author Topic: why is removing cameras so slow?  (Read 249 times)

stephan

  • Full Member
  • ***
  • Posts: 129
    • View Profile
why is removing cameras so slow?
« on: January 24, 2022, 04:40:31 PM »
Hey guys,

I'm running a script that copies a chunk, then based on some calculations removes cameras from a chunk.
First the cameras are disabled.
Then the disables cameras are removed.
Something like this:

Code: [Select]

for camera in [some_list]:
    camera.enabled = False
    chunk.remove(camera)



For some reason: the "camera.enabled = False" works in 1/10th of a second, no problem.

When I add the "chunk.remove(camera)" it takes FOREEEEEVER.  Like 15 minutes to go through my chunk...

Any idea why this behaves in such a way? Or what I can do to speed it up?

Cheers,


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13642
    • View Profile
Re: why is removing cameras so slow?
« Reply #1 on: January 24, 2022, 06:01:44 PM »
Hello stephan,

removing cameras also updates the sparse point cloud. If you have many cameras to be removed, it may be reasonable to do it once and pass the list of cameras to chunk.remove() command at once.
Best regards,
Alexey Pasumansky,
Agisoft LLC

stephan

  • Full Member
  • ***
  • Posts: 129
    • View Profile
Re: why is removing cameras so slow?
« Reply #2 on: January 24, 2022, 06:41:14 PM »
Ah right got it, thanks, that works perfectly!