Skip to main content
Version: 12.2

MetriCal Results JSON

MetriCal Results Schema

The full JSON schema for MetriCal results can be found in the MetriCal Sensor Calibration Utilities repository on GitLab.

Serialized Results and Metrics

Every calibration outputs a comprehensive JSON of metrics, by default named results.json. This file contains:

  • The optimized plex representing the calibrated system
  • The optimized object space (with any updated spatial constraints for a given object space)
  • Metrics derived over the dataset that was calibrated:
    • Summary statistics for the adjustment
    • Optimized object space features (e.g. 3D target or corner locations)
    • Residual metrics for each observation used in the adjustment

Optimized Plex

The optimized Plex is a description of the now-calibrated System. This Plex is typically more "complete" and information-rich than the input Plex, since it is based off of the real data used to calibrate the System.

The optimized plex can be pulled out of the results.json by using jq:

jq .plex results.json > plex.json

Optimized Object Space

MetriCal will optimize over the object spaces used in every calibration. For example, If your object space consists of a checkerboard, MetriCal will directly estimate how flat (or not) the checkerboard actually is using the calibration data.

This comes in two forms in the results.json file:

  1. An optimized object space definition that can be re-used in future calls to metrical calibrate.
  2. A collection of optimized object space features (i.e. the actual 3D feature or point data) optimized using the calibration data.

The former can be extracted from the results.json by using jq:

jq .object_space results.json > object_space.json

Conversely, the latter is embedded in the metrics themselves:

jq .metrics.optimized_object_spaces results.json > optimized_object_spaces.json

The latter is interesting insofar as it can be plotted in 3D to visually see how object features such as targets or the positions of corner points were estimated:

{
"1c22b1c6-4d5a-4058-a71d-c9716a099d48": {
"ids": [40, 53, 34, 3, 43],
"xs": [0.3838, 0.7679, 0.6717, 0.2883, 0.6717],
"ys": [0.1917, 0.096, 0.2879, 0.5761, 0.192],
"zs": [0.00245, -0.00159, 0.00122, -0.00155, 0.00085]
}
}

The optimized object space features are in a JSON object where

  • the keys are UUIDs for each object space
  • the values are an object containing the feature identifiers (ids), as well as Cartesian coordinate data (xs, ys, zs) for each feature

Summary Statistics

The main entrypoint into the metrics contained in the results.json is the collection of summary statistics. Of all the metrics output in a results.json file, the Summary Statistics for a calibration run the most risk of being misinterpreted. Always bear in mind that these figures represent broad, global mathematical strokes, and should be interpreted holistically along with the rest of the metrics of a calibration. These summary statistics can be extracted from the metrics using jq:

jq .metrics.summary_statistics results.json > summary_statistics.json

These are the same summary statistics that are output in the console logs.

Residual Metrics

Residual metrics are generated for each and every cost or observation added to the calibration. The most immediately familiar residual metric might be reprojection error, but similar metrics can be derived for other modalities and observations as well. A full list of these is linked below:

Metric TypeProduced by
Circle MisalignmentAll Camera-LiDAR pairs
Composed Relative Extrinsics ErrorAll Components and Objects
Image ReprojectionAll Cameras
IMU Preintegration ErrorAll IMUs
Interior Points to Plane ErrorAll Camera-LiDAR pairs
Object Inertial Extrinsics ErrorAll IMUs
Paired 3D Point ErrorAll LiDAR-LiDAR pairs
Paired Plane Normal ErrorAll LiDAR-LiDAR pairs