Skip to main content
Version: Next

Common Workflows

Users can find workflow scripts and sample datasets in the MetriCal Sensor Calibration Utilities repo on GitLab:
https://gitlab.com/tangram-vision/platform/metrical/-/tree/main/examples

Experiment with different intrinsics models

# Run an initial calibration [slower]
metrical init -m *cam*:opencv_radtan $INIT_PLEX
metrical calibrate -o $OPENCV_RES $DATA $INIT_PLEX $OBJ

# Modify our init plex to use EUCM for all cameras, and recalibrate [fast]
metrical init -y -m *cam*:eucm $INIT_PLEX
metrical calibrate -o $EUCM_RES $DATA $INIT_PLEX $OBJ

# The same operation, except we create a new init plex from the first one [fast]
metrical init -m *cam*:eucm -p $INIT_PLEX $SECOND_INIT_PLEX
metrical calibrate -o $EUCM_RES $DATA $SECOND_INIT_PLEX $OBJ

This workflow demonstrates how effortless it can be to play around with models using the same dataset. Note that the second and third runs of Init mode will result in the same plex, but in two different ways:

  • The second run tells MetriCal to overwrite (-y) the plex at $INIT_PLEX. MetriCal will use this $INIT_PLEX as a seed plex for the operation. It will modify the file in place.
  • The third run explicitly tells MetriCal to use $INIT_PLEX as a seed. It will output the resulting init plex to $SECOND_INIT_PLEX.

Since Calibrate mode caches detections between runs, the second and third runs of this data will process much faster than the first. This all results in a pain-free way to rapidly test several different models for your components.

Seed an extrinsics calibration with intrinsics

FRONT_CAM_DATA=/my/front_cam.mcap # <-- Only front cam in view of fiducials
FRONT_CAM_RESULTS=/my/front_cam.json

BACK_CAM_DATA=/my/back_cam.mcap # <-- Only back cam in view of fiducials
BACK_CAM_RESULTS=/my/back_cam.json

RIG_DATA=/my/full_rig.mcap # <-- 360* rotation around rig with fiducials
RIG_RESULTS=/my/full_rig.json

# Run a calibration for the front camera (intrinsics only)
metrical init -m /front_cam:eucm $FRONT_INIT_PLEX
metrical calibrate -o $FRONT_CAM_RESULTS $FRONT_CAM_DATA $FRONT_INIT_PLEX $OBJ

# Run a calibration for the back camera (intrinsics only)
metrical init -m /back_cam:eucm $BACK_INIT_PLEX
metrical calibrate -o $BACK_CAM_RESULTS $BACK_CAM_DATA $BACK_INIT_PLEX $OBJ

# Run an extrinsics-only calibration between the front and back cameras
metrical init -p $FRONT_CAM_RESULTS -p $BACK_CAM_RESULTS -m *cam*:eucm $RIG_INIT_PLEX
metrical calibrate -o $RIG_RESULTS $RIG_DATA $RIG_INIT_PLEX $OBJ

Sometimes, your platform is just too big to calibrate in one dataset. You know that getting a good camera calibration usually means getting up-close and personal with your fiducials, in order to cover the entire field of view. How can you do that if your camera is 8 feet off of the ground? It's a logistics nightmare.

Luckily, MetriCal has the answer. You can split your calibration into several different runs in order to get the best data possible. In the script above, we take the following steps:

  • Record a calibration dataset using the front camera only, and derive intrinsics for that camera using Calibrate mode.
  • Do the same thing with the back camera. Now we have two different calibrations for two different streams.
  • Combine the results of the first and second run into one big init plex ($RIG_INIT_PLEX). Use this plex to calibrate the extrinsics of the whole rig.