Forum

Author Topic: Trying to use resize with python 3 module  (Read 1419 times)

Antonio3d

  • Newbie
  • *
  • Posts: 4
    • View Profile
Trying to use resize with python 3 module
« on: April 19, 2022, 05:46:16 PM »
Hi all,

I want to batch the entire process to get a 3d model at the end. Im using a dome of cameras and I can resize the point cloud limits from software but i really dont know how to do it in python. I use general_workflow.py as base ("its a file from the Python scripts for Metashape Pro") and works like a charm but i need to limit the scanned area to get the cleannest model as posible.

Thanks in advance

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Trying to use resize with python 3 module
« Reply #1 on: April 19, 2022, 07:03:08 PM »
Hello Antonio,

Do you mean the size of the bounding box (reconstruction volume)?

The easiest way is to increase (or decrease) the size of the bounding box by the same factor by each size (for example, increasing the box by 2.5 times):
Code: [Select]
N = 2.5
chunk.region.size = N * chunk.region.size
Best regards,
Alexey Pasumansky,
Agisoft LLC

Antonio3d

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Trying to use resize with python 3 module
« Reply #2 on: April 20, 2022, 12:05:37 PM »
Thats it!!! Thanks so much,

I want just to modify x and y axis to make a clean model from the dome and get better results.

I have seen that it uses 2 vectors, one for min and the other for max. This is correct?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Trying to use resize with python 3 module
« Reply #3 on: April 20, 2022, 12:23:28 PM »
Hello Antonio,

The bounding box (chunk.region) is defined by its center (chunk.region.center), size (chunk.region.size) and rotation (chunk.region.rot) - the first two are three-component vectors, and rotation is 3x3 matrix. Note that they are defined in the internal coordinate system of the chunk, so if the project is referenced in local or geographic coordinate system (or even if you applied rotate/move/scale object transformations) additional transformation should be applied to the region settings.

Can you provide some additional information about the task that you are trying to solve? What information do you have on input when trying to set the bounding box properties?
Best regards,
Alexey Pasumansky,
Agisoft LLC

Antonio3d

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Trying to use resize with python 3 module
« Reply #4 on: April 21, 2022, 09:31:32 AM »
Hi Alexey,

Im searching a fast product pipeline process about scanning people. We have a dome of cameras that we use to take more than 100photos for 3d scanning, Agisoft works really well and want to make a python process to make the 3d scanning soft faster, we want to use a pc as a linux server with the soft  and make a web platform where the user can download the 3d scanned model when its will be ready, even he could print 3d in our 3d printers. The idea is to automate the process.

The resize of the region its to get a more clean model, im testing using a vector to resize (chunk.region.size) because the dome its always the same so i think that only one config its enough. Now i will try to make some rotation because the region appears a bit crooked.

Im also thinking to use your cloud version but i suppose  that the python script will be very similar.

Thanks in advance




Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Trying to use resize with python 3 module
« Reply #5 on: April 21, 2022, 01:08:54 PM »
Hello Antonio,

If you are using the same labeling convention for the cameras, you can get the coordinates of the cameras from some reference project and then re-use them in the next projects - it will allow to have all the generated models be of the same scale and also to apply the same orientation (for example, Z-up or Y-up) to all the models. Also having the model referenced in such local coordinante system will ease the process of the bounding box definition, as you know the box size and position in absolute coordinates.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Antonio3d

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Trying to use resize with python 3 module
« Reply #6 on: April 21, 2022, 02:58:43 PM »
It works like a charm, Im really impressed. I think that uses your ouwn cloud service will be a very similar python script as i have seen in the example code. How i can get a license  to pay per model using your cloud version?

Thanks so much for your support
« Last Edit: April 21, 2022, 03:35:17 PM by Antonio3d »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Trying to use resize with python 3 module
« Reply #7 on: April 21, 2022, 04:25:26 PM »
Hello Antonio,

Agisoft Cloud currently doesn't support execution of Python scripts, only processing operations available via Metashape interface can be submitted for cloud processing.

As for the pay-per-use model for the service providers, please send an inquiry to sales@agisoft.com
Best regards,
Alexey Pasumansky,
Agisoft LLC