Forum

Author Topic: exportMasks?  (Read 2750 times)

stephan

  • Full Member
  • ***
  • Posts: 129
    • View Profile
exportMasks?
« on: February 03, 2016, 09:06:12 PM »
Hi guys,

I can import masks using a python script but by the looks fo it there is no way to export them other than from the GUI... Am I overlooking something here or is the function just not implemented yet?

Cheers,
Stephan

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14753
    • View Profile
Re: exportMasks?
« Reply #1 on: February 03, 2016, 09:32:02 PM »
Hello Stephan,

Assuming that "camera" variable is some camera from the chunk, you can use
Code: [Select]
camera.mask.image().save(path)to save the mask as image file.

Does it fit your needs?
Best regards,
Alexey Pasumansky,
Agisoft LLC

stephan

  • Full Member
  • ***
  • Posts: 129
    • View Profile
Re: exportMasks?
« Reply #2 on: February 04, 2016, 12:24:14 AM »
Hi Alexey,

Thanks for the quick response!

Could I dump all of the masks using this?
Code: [Select]
for camera in chunk.cameras:
                camera.mask.image().save(mask_path)

Which format are the masks exported in by default?

Thanks!
Stephan

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14753
    • View Profile
Re: exportMasks?
« Reply #3 on: February 09, 2016, 11:35:19 AM »
Hello Stephan,

You can make a loop on all the cameras in chunk.cameras and save the masks.

Image.save() requires the full export path, including filename with extension. I can suggest to use png format.
Best regards,
Alexey Pasumansky,
Agisoft LLC