Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: Thibaud Capra on April 26, 2017, 03:41:27 PM

Title: Process chunk depending on bounding box's size
Post by: Thibaud Capra on April 26, 2017, 03:41:27 PM
Hello everyone

I'm currently working on UAV-based models where I process subparts of a global point cloud. Problem is, if the bounding box is too small, I may have issues processing it (DPC, Meshing etc.) because my photo coverage is insufficient.

Since the scene's coverage is constant (one photo every X meters), I determined the minimal surface for the bounding box to have enough photos in it to process things properly : 500 m².

I figured my condition would be something like
(I also loosen the region size until the bounding box is big enough):

Code: [Select]
for chunk in doc.chunks
    region = chunk.region
    box_x = chunk.region.size.x
    box_y = chunk.region.size.y
    box_z = chunk.region.size.z
    Box_surf = box_x * box_y
    while Box_surf < 500: #m²
        region.size = 1.1 * region.size
        chunk.region = region
        box_x = chunk.region.size.x
        box_y = chunk.region.size.y
        box_z = chunk.region.size.z
        Box_surf = box_x * box_y
    # Densify
    # Mesh etc.

How can I get the size in meters?
Any way to make it cleaner?

Thanks in advance.
Title: Re: Process chunk depending on bounding box's size
Post by: Thibaud Capra on April 26, 2017, 04:04:16 PM
For the record, I printed the values of my variables:

Code: [Select]
    box_x = chunk.region.size.x
    box_y = chunk.region.size.y
    box_z = chunk.region.size.z

And they're all around 1 or 0.8...