Forum

Author Topic: Camera rig import extrinsics  (Read 903 times)

Saulzar

  • Newbie
  • *
  • Posts: 4
    • View Profile
Camera rig import extrinsics
« on: January 09, 2020, 03:59:01 PM »
Hi!

I've been trying to import the extrinsics (intrinsics works fine) of a camera rig which we calibrate externally, using a python script. However, my attempt shown below does not seem to have any effect on the output.  Is there something I'm missing here? I've tried a few things, setting the location_accuracy etc... nothing seems to have much effect? Any tips on how to achieve this?

Thanks!
Oliver


        for camera, sensor in zip (calib['cameras'], chunk.sensors):
            sensor.fixed_calibration=True

            sensor_calib = import_calibration(camera)
            sensor.user_calib = sensor_calib

            sensor.fixed_rotation = False
            sensor.fixed_location = False

           if 'location' in camera and 'rotation' in camera:
             sensor.reference.location = camera['location']
             sensor.reference.location_enabled = True
         
            #sensor.reference.rotation = Metashape.utils.mat2ypr(Metashape.Matrix(camera['rotation']))
            #sensor.reference.rotation_enabled = True
« Last Edit: January 09, 2020, 04:00:52 PM by Saulzar »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 11777
    • View Profile
Re: Camera rig import extrinsics
« Reply #1 on: January 09, 2020, 04:58:36 PM »
Hello Oliver,

Do you have multi-camera system (with Master and Slave sensors) or just a fixed rigs with N cameras (and only N images in the project)?
Best regards,
Alexey Pasumansky,
AgiSoft LLC

Saulzar

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Camera rig import extrinsics
« Reply #2 on: January 10, 2020, 02:50:03 AM »
Hi Alexey,

Sorry I should have clarified - I have a rig of 6 cameras which all move rigidly together. So I capture some images and end up with 6*image_frames and import them with Metashape.MultiplaneLayout.

I've been using Metashape for a while with them configured this way and allowing Metashape to calibrate the extrinsics between them (Just by using sensor.fixed_location=False and sensor.fixed_rotation=False). However I have a desire to use an external calibration so that the reconstructions are in real world units!


I should add that I tried setting the location and rotation directly, which seems to always fail to align, even when the location and rotation are the exact same outputs from a previous Metashape reconstruction on the same images...

          if 'location' in camera and 'rotation' in camera:
                sensor.location = camera['location']
                sensor.fixed_location = True

                sensor.rotation = Metashape.Matrix(camera['rotation'])
                sensor.fixed_rotation = True


Thanks,
Oliver

« Last Edit: January 10, 2020, 03:53:13 AM by Saulzar »