Forum

Author Topic: Unable to remove specific camera from a chunk via Python API v1.2.6  (Read 2702 times)

jsloat

  • Newbie
  • *
  • Posts: 13
    • View Profile
I am working on a plug-in that needs to remove certain cameras that I determine by proximity and orientation won't contribute much to computing a Dense Cloud per chunk. (I am able to use the API to deactivate my candidate cameras, but in another pass, I want to actually remove those cameras to make the result small enough to be savable. (when I use more than 75 chunks and each chunk has 2-3K cameras, it won't save).

I'm trying to be very careful that I'm not actually trying to remove a "COPY" of a camera from the camera list (cause I understand why that wouldn't work).

I absolutely can remove a camera using the GUI and it goes away.

But via the console window, I find that even this basic command which is not using a "copy" won't actually delete the camera (the first camera in this case).

PhotoScan.app.document.chunk.cameras.remove(PhotoScan.app.document.chunk.cameras[0])

(It doesn't fail, the return status is "" or "none")
Surely I'm doing something wrong, but I can't figure out why.
-Jay-

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14927
    • View Profile
Re: Unable to remove specific camera from a chunk via Python API v1.2.6
« Reply #1 on: April 11, 2017, 08:36:39 AM »
Hello Jay,

This one should work:

Code: [Select]
PhotoScan.app.document.chunk.remove(PhotoScan.app.document.chunk.cameras[0])
Best regards,
Alexey Pasumansky,
Agisoft LLC

jsloat

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Unable to remove specific camera from a chunk via Python API v1.2.6
« Reply #2 on: April 14, 2017, 02:06:14 AM »
Thank you for an answer.
This took the pain out of having to manually remove hundreds of deactivated cameras from 2500 cams per chunk, and 100 chunks.

Besides significantly improving the time to save and load (project and chunks), I think the
cluster server computing of the chunks is now using less memory and spends more time doing useful computing rather than 100% Swapping.

-Jay-