Forum

Author Topic: Generate masks from polygon drawn in the orthophoto  (Read 628 times)

Guillaumeb89

  • Newbie
  • *
  • Posts: 6
    • View Profile
Generate masks from polygon drawn in the orthophoto
« on: April 19, 2025, 06:19:27 PM »
Hi,

I would like to know if its possible to generate a mask for each photo in my chunk, from a polygon that is drawn on the orthophoto.

The idea is to mask every watered zone then regenerate clean models with my photos and a mask applied for each of them

regards,


Paulo

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
Re: Generate masks from polygon drawn in the orthophoto
« Reply #1 on: April 19, 2025, 10:49:11 PM »
Guillaume Bonjour,

I think this can be done by developing a script. From the polygon on ortho you would need a DEM to apply the altitudes to each polygon vertex. Then find its  projection on each corresponding camera and generate a mask...

You can send me a PM for more details...
Best Regards,
Paul Pelletier,
Surveyor

Guillaumeb89

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Generate masks from polygon drawn in the orthophoto
« Reply #2 on: April 20, 2025, 01:04:14 AM »
Hi Paulo,

Thank you for your answer

That's exatly what I tried to do.

I'm using a DEM for polygon projection.

I managed to write a script but I'm blocked when I have to reproject the polygon, especially when the polygon appears in partially on the picture ..

I'll send you a PM

regards,

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15420
    • View Profile
Re: Generate masks from polygon drawn in the orthophoto
« Reply #3 on: April 21, 2025, 06:25:30 PM »
Hello Guillaumeb89,

As a possible workaround, if you already have DEM: build mesh model using DEM as a source surface, crop it by the shape that you need to use as a mask (set as boundary, then duplicate model with "clip by boundary shapes" option enabled), then run Generate Masks process using "From Model" option.

Probably, before clipping the model by shape you can also smooth it using high Strength value (like 50 or even 100) to make the surface almost flat, if it is related to the water only.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Guillaumeb89

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Generate masks from polygon drawn in the orthophoto
« Reply #4 on: April 22, 2025, 09:01:30 PM »
Hi Alexey,

Thanks a lot for this useful answer. You solved my problem !