Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: aerophilicravi on June 23, 2022, 03:35:57 PM

Title: Batch clipping and exporting using given kml boundaries
Post by: aerophilicravi on June 23, 2022, 03:35:57 PM
Hello,

I have a large orthomosiac generated on Agisoft. I also have multiple overlapping village boundaries as shown in the screenshot in the attachment.

Orthomosiac needs to be cropped as per this village boundary with 50 meters buffer from each boundary.

My current methodology is to export a single Orthomosiac and then crop it using Global mapper or QGIS. This is taking twice the time if not less.
Is there a script or a batch processing methodology by which we can export the data directly from Agisoft itself.
Title: Re: Batch clipping and exporting using given kml boundaries
Post by: Paulo on June 23, 2022, 04:22:24 PM
Hello aerophilicravi,

the easiest way would be following:

- create the village shapes with 50 meter buffers in Global Mapper  or QGis;
- import the shapes into Metashape;
- create a script that loops thru all the village shapes, for each shape, set it as outerboundary, export Orthomosaic with clip to boundary.

Should be quire straightforward,

PS. if you do not want to create the buffer polygons outside of MS, this could be done inside  using shapely Polygon module...
Title: Re: Batch clipping and exporting using given kml boundaries
Post by: aerophilicravi on June 24, 2022, 09:44:18 AM
Thank you for your reply.
This is exactly what I want.
But unfortunately, I am not very good with Python scripting. Can I get help there?