Generating a Calibration using MetriCal
This tutorial assumes you've gone through all of the prerequisite setup steps in the intro like getting a license and installing MetriCal.
You will also need an object space file and a data capture to process. If you are following along with the tutorial series, you will have procured these in Part 1 and Part 2 respectively.
1: Initialize MetriCal
A plex is a virtual snapshot of your system's calibration at a point in time. Init creates a raw input plex by inferring it from the data it is given. We'll optimize this plex, and this data, using Calibrate later.
metrical init \
--topic-to-model *cam*:opencv_radtan \ # Every topic with "camera" string gets the RadTan model
--topic-to-model *lidar*:no_offset \ # Every topic with "lidar" string gets no model
--topic-to-model *imu*:scale_shear \ # Every topic with "imu" string gets Scale-Shear model
$DATA \ # Provide our data
$INIT_PLEX # Our output: a fresh plex!
More on...
Init
mode: Init Mode- Data formats: Data Formats
- The plex: Plex
- Camera models: Camera models
- Lidar models: Lidar models
- IMU models: IMU models
2: Calibrate the Initial Plex
The actual calibration! This refines the plex, giving you accurate calibation values. We'll
visualize detections by passing the --render
flag. Make sure you have a Rerun instance running!
metrical calibrate \
--render \ # Render the calibration process using Rerun
--output-json $OUTPUT \ # Write the results to $OUTPUT
$DATA \ # Our input calibration dataset
$INIT_PLEX \ # Our fresh plex from Step 1
$OBJ \ # Our object space file describing fiducials and targets
More on...
Calibrate
mode: Calibrate mode- Object spaces: Object Space
- Results and metrics: Results
- Rendering: Rendering with Rerun
3: Render the Results
Display mode shows us what the calibration looks like when applied to a dataset. Usually, you'll just apply it to the same dataset you used for calibration, but you can pass in any dataset that uses the same topic names. Make sure you have a Rerun instance running!
metrical display $DATA $OUTPUT
4: Shape the Plex Output
This shapes the calibration output into something more useful for our system. In this case, we want to create a stereo rectification for our system.
metrical shape \
$OUTPUT \ # Use the calibration output we derived from Step 2
$OUTPUT_DIR \ # Write the results to $OUTPUT_DIR
stereo-lut \ # Create a pair of stereo rectification lookup tables
--dominant ir_one \ # The dominant eye in this stereo pair
--secondary ir_two \ # The secondary eye in this stereo pair
More on...
- Shape mode: Shape mode