Forum

Author Topic: Is there a Python equivalent of Tools > Import Masks?  (Read 3974 times)

Fernando

  • Newbie
  • *
  • Posts: 16
    • View Profile
Is there a Python equivalent of Tools > Import Masks?
« on: June 22, 2014, 04:48:32 PM »
Hi, I have images with an alpha channel, and I was wondering if there is a way to create masks from those alpha channels with Python?

Thanks!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14968
    • View Profile
Re: Is there a Python equivalent of Tools > Import Masks?
« Reply #1 on: June 23, 2014, 02:05:21 PM »
Hello Fernando,

You can use the following (providing that photo variable contain alpha-channel):
Code: [Select]
photo.setMask(photo.alpha())
Best regards,
Alexey Pasumansky,
Agisoft LLC

Fernando

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Is there a Python equivalent of Tools > Import Masks?
« Reply #2 on: June 23, 2014, 08:15:52 PM »
Great, thanks!