Forum

Author Topic: Multiple-Camera Rig with Python API  (Read 3205 times)

jseinturier-utln

  • Newbie
  • *
  • Posts: 3
    • View Profile
Multiple-Camera Rig with Python API
« on: November 21, 2023, 03:33:16 PM »
Hello,

i'm using a Stereo camera rig and i'm using Metashape in order to process models.

At this time, here is the process i follow:

1. Set up on my hard drive a folder named "images" that contains 2 sub-folders named "SL" that contains the left images and "SR" that contains the right images from my stereo system (each left / right image of a stereo pair have the same filename).
2. Open Metashape
1. Create a chunk
2. Click on Workflow -> Add Folder and select the images folder that contains SL and SR subfolder
3. Metashape is detecting that the folder contain a stereo camera rig
4. Click on "Tools -> Camera calibration"
5. Within the new windows, click on the second camera and select the "Slave" pane
6. Within the pane, set up the X, Y, Z, O, P, K values
7. Click on Workflow -> Align Photos

My question is that i would like to automatize the chunk preparation (from a given folder and a given slave calibration, i would like that the steps 1-6 of the process be achieved automatically). However, i've not be able to find any function related to stereo or multiple camera rig processing within the Python or Java API.

Is it possible to integrate these functionnalities within the API ?

Thanks a lot.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14927
    • View Profile
Re: Multiple-Camera Rig with Python API
« Reply #1 on: November 21, 2023, 04:24:52 PM »
Hello jseinturier,

Have you checked already the examples of adding images using MultiplaneLayout (similar to Multi-camera system) option?
https://www.agisoft.com/forum/index.php?topic=14453.msg63627#msg63627
It should work for steps 2-3 in your workflow, then camera calibration should be loaded for each sensor in chunk.sensors (you may need to understand which is left and right based on filename of any camera related to each sensor).

To enable and define slave sensor offsets:
Code: [Select]
sensor.reference.location_enabled = True
sensor.reference.rotation_enabled = True
sensor.reference.location = Metashape.Vector([x, y, z])
sensor.reference.rotation = Metashape.Vector([omega, phi, kappa])
Best regards,
Alexey Pasumansky,
Agisoft LLC

jseinturier-utln

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Multiple-Camera Rig with Python API
« Reply #2 on: November 21, 2023, 07:00:37 PM »
Thanks a lot Alexey, i will try this soon.