Agisoft Metashape

Agisoft Metashape => General => Topic started by: xabierr on April 28, 2021, 05:22:35 AM

Title: reset region using shapefile
Post by: xabierr on April 28, 2021, 05:22:35 AM
As far as I understand, the Reset Region option is currently based on the sparse cloud only. I am trying to align multiple surveys (different times) to the same region extent.

Is there away to select/crop points in the sparse point cloud OR reset the region using a shapefile? If not, is there any workaround?

cheers,

Javier   
Title: Re: reset region using shapefile
Post by: Alexey Pasumansky on April 28, 2021, 04:05:20 PM
Hello Javier,

Can you please elaborate, what do you mean by resetting region by a shape file? Which information is available in the shape file?

Would it be sufficient to "copy" the bounding box from the active chunk in the project all the other chunks in the same project?
Title: Re: reset region using shapefile
Post by: xabierr on April 29, 2021, 01:01:08 AM
Thanks Alexey.

I mean cropping the bounding box extent to a polygon shapefile extent OR cropping the sparse point cloud to the extent of the polygon shapefile.
Title: Re: reset region using shapefile
Post by: Alexey Pasumansky on May 04, 2021, 04:43:48 PM
Hello Javier,

The attached script example should crop the tie point cloud based on the single selected polygonal shape.
Title: Re: reset region using shapefile
Post by: bisenberger on March 08, 2023, 06:36:43 AM
Hi Alexey,
I couldn't get the script to work. I'm running Metashape Pro version 2.0.1.
Title: Re: reset region using shapefile
Post by: Corensia on March 09, 2023, 07:52:23 AM
Hi bisenberger,
The script I modified below should work in Metashape 2.0.

Hope it helps!
Title: Re: reset region using shapefile
Post by: bisenberger on March 11, 2023, 04:15:33 PM
Hi bisenberger,
The script I modified below should work in Metashape 2.0.

Hope it helps!

Thanks Corensia, but I can't get it to work. The script shows up in the Custom menu pull down. I have a shape selected, set to outer boundary, when I run the script it says "No tie points, script aborted".

(https://digital-mapping.net/image_links/clip_tie_points.jpg)
Title: Re: reset region using shapefile
Post by: Paulo on March 11, 2023, 06:36:45 PM
Hi bisenberger,

try this modified script. The original was testing on presence of chunk.point_cloud instead of chunk.tie_points

Should run now...
Title: Re: reset region using shapefile
Post by: bisenberger on March 17, 2023, 04:16:42 AM
Hi bisenberger,

try this modified script. The original was testing on presence of chunk.point_cloud instead of chunk.tie_points

Should run now...

Thanks Paulo, but it removed most of the tie points within the shape. Ended up just adjusting the bounding box using the shape as a reference.
Title: Re: reset region using shapefile
Post by: Paulo on March 17, 2023, 09:46:57 PM
Yes bisenberger,

I noticed that also, it seems the multiprocessing.dumy Pool used somehow does not finish the whole tie point selection before cropping...

This multiprocessing approach is over my head, maybe Alexey can help more on this point..

Another way to use is removing the multiprocessing and then t will work correctly but slower....