Forum

Author Topic: Automated masking  (Read 936 times)

terrafirma

  • Newbie
  • *
  • Posts: 5
    • View Profile
Automated masking
« on: July 09, 2021, 07:37:53 PM »
Hi all!

     I'm working on a project where we fly over different sites using a DJI and Survey3 camera. These sites are anywhere from 100-400 acres, so as you can imagine I have a lot of pictures to work with (approximately 2000 images). The issue I'm having is Agisoft does not like to align the Survey3 (infrared) photos when there is excessive sun glare in the photos. If I go through and manually mask them, it will align no problem. However, I'm having difficult automating this process because the glare is not the same size, nor in the spot in these photos. There is a very distinct difference in pixel colors though - it is the only thing in the photos that is bright white. Is there any way to automate the masking to mask certain colored pixels as opposed to size/shape of the mask?

  If not, any recommendations otherwise (so I'm not having to manually sift through 2000 images and mask them)? I'm an intern, so very new to Agisoft.

Thanks in advance!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13642
    • View Profile
Re: Automated masking
« Reply #1 on: July 10, 2021, 12:43:32 AM »
Hello terrafirma,

You can try to use the following script for masking by color:
https://github.com/agisoft-llc/metashape-scripts/blob/master/src/masking_by_color_dialog.py
Please try to run it on smaller set of images to see, if this approach can be used.
Best regards,
Alexey Pasumansky,
Agisoft LLC

terrafirma

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Automated masking
« Reply #2 on: July 10, 2021, 01:33:38 AM »
That's really helpful! It didn't want to run since I apparently still had version 1.6 - but we got there.

Thank you again!
« Last Edit: July 10, 2021, 01:41:28 AM by terrafirma »

terrafirma

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Automated masking
« Reply #3 on: July 21, 2021, 10:28:12 PM »
Hello again!

 I've tried using this script but it just keeps saying "Run Script Failed". Any idea why it might be saying this (software is up to date)? Is there a certain step I need to run this after, or before?

Thanks again