Forum

Get all calibration parameters when saving to xml using exportCameras

Started by sergio, December 14, 2022, 10:15:19 AM

Previous topic - Next topic

sergio

Hi,

When I use chunk.exportCameras I notice only the focal length is exported under the sensor element of the xml file  How to get the rest of the calibration parameters? (e.g. cx, cy, k1, etc...)
The same applies when I use calibration.save().

I noticed that when I export from the GUI, all the parameters are written....

Best,

Sergio

Alexey Pasumansky

Hello Sergio,

What Metashape version you are using and whether the export is performed from the aligned project?

Can you give the screenshots of Initial and Adjusted tabs from the Camera Calibration dialog and the result of exportCameras command to XML format? Additionally please post the export line with all the arguments used for the export.
Best regards,
Alexey Pasumansky,
Agisoft LLC

sergio

Thank you.

In our workflow we have 2 chunks
Your questions allowed me to understand where the problem was. In our workflow we make 2 alignments (with 2 chunks). We use the first one to compute camera parameters. We then undistort the images and compute a second alignment forcing a pinhole model. Therefore, in this chunk the camera parameters are fixed (I attach the screenshot).

I assume that if these parameters are zero and they are fixed, Metashape will not export them in the calibration or camera files?

This is the output xml calibration data:
<?xml version="1.0" encoding="UTF-8"?>
<calibration>
  <projection>frame</projection>
  <width>2160</width>
  <height>3840</height>
  <f>2801.295081040385</f>
  <date>2022-12-15T02:18:21Z</date>
</calibration>


I am using Metashape 1.8.4 GUI and python API