Forum

Poll

can you details the differents source and operation option

python
1 (100%)
Mask import options
0 (0%)

Total Members Voted: 1

Author Topic: Parameters to import masks on a chunk  (Read 157 times)

claire

  • Newbie
  • *
  • Posts: 4
    • View Profile
Parameters to import masks on a chunk
« on: December 03, 2019, 08:04:48 AM »
Hello,

I'm running a python script to import masks on my chunk.
They are well reconized the problem is I do not know what source and what operation I should use.
The masks are in white where no data should be considered and equal to 0 or else.

I used :chunk.importMasks(path= "C:\\Users\\TOTO\\Documents\\Masks\\Mask_%s\\"%year ,\
                  source=Metashape.MaskSourceAlpha,operation=Metashape.MaskOperationReplacement,tolerance=10)

  but the masks appeared in white on my pictures.

Can you give me a hand please.

All the best

Claire

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 10929
    • View Profile
Re: Parameters to import masks on a chunk
« Reply #1 on: December 04, 2019, 08:04:05 PM »
Hello Claire,

If you are using black&white files with the masks, you should should specify Metashape.MaskSourceFile option for the importMasks method. Replacement - default operation, should be used, if there are no pre-loaded masks for the images which you would like to keep somehow.
Best regards,
Alexey Pasumansky,
AgiSoft LLC