# Calibration Files

### Camera Calibration

<figure><img src="https://cdn.prod.website-files.com/67008ba73b4fd0346790d085/67442b033c1c278ddb41eeef_camera_image_axes.png" alt="_images/camera_image_axes.png" width="563"><figcaption><p><strong>Camera and image coordinate system conventions.</strong></p></figcaption></figure>

‍

The camera calibration file contains the calibrations for all of the cameras using a structure similar to XML. An example calibration file is provided with the sample data. Key elements and attributes of the calibration file are outlined here. Note that Qualisys calibrations exported from QTM as .txt files and Vicon calibrations (.xcp) can also be used.

### &#x200D;**\<calibration>**

Top level element with no attributes.

Grouping element that holds \<camera> child elements. It has no attributes.

### \<results>

Element that holds the calibration results metrics, as described in [Chessboard Calibration Metrics](/apollo-v2024/theia3d-documentation/theia3d-dropdown-menus/calibration-menu/chessboard-calibration.md).

### **\<camera>**

Element that holds the calibration information for a single camera. Required attributes are: active, serial, and viewrotation. Required child elements are: \<transform> and \<intrinsic>.

* **active:** 1 if the camera is used, 0 if unused.
* **serial:** The camera ID. Must be unique to the camera and match the camera ID used to name the video subfolders.
* **viewrotation:** Rotation of the camera. 0 if upright, 180 if upside down, 90 or 270 if sideways. This is calculated from the rotation matrix of the calibration.

### **\<transform>**

Translation and rotation components of the transformation from global to camera coordinates (p→cam=Rp→global+t→). Required attributes are x, y, z and r11 through r33.

* **x, y, z:** Elements of the translation component (t→) of the transformation. Expressed in mm.
* **rij:** Elements of row i and column j of the rotation component (R) of the transformation.

### **\<intrinsic>**

Intrinsic camera parameters. Required attributes are: focallength, sensorMinU, sensorMaxU, sensorMinV, sensorMaxV, focalLengthU, focalLengthV, centerPointU, centerPointV, skew, radialDistortion1-3, and tengentialDistortion1-2.

* **focallength:** Focal length of the lens in mm.
* **sensorMinU:** Minimum u coordinate of the sensor in pixels.
* **sensorMaxU:** Maximum u coordinate of the sensor in pixels.
* **sensorMinV:** Minimum v coordinate of the sensor in pixels.
* **sensorMaxV:** Maximum v coordinate of the sensor in pixels.
* **focalLengthU:** Focal length along the u axis in pixels.
* **focalLengthV:** Focal length along the v axis in pixels.
* **centerPointU:** Principal point u coordinate in pixels.
* **centerPointV:** Principal point v coordinate in pixels.
* **skew:** Skew coefficient. Non-zero if the image axes are not perpendicular. Note that non-zero skew is currently unsupported.
* **radialDistortion1-3:** Radial distortion coefficients.
* **tangentialDistortion1-2:** Tangential distortion coefficients.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.theiamarkerless.com/apollo-v2024/theia3d-documentation/data-formats/calibration-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
