Calibration

Calibrate your Stereo Camera for CoreVisionX

Computing high quality depth maps from your stereo images requires accurate intrinsic and extrinsic calibration. CoreVisionX makes this process easy with our calibration CLI.

Install Calibration Tools

First create a new directory for our calibration project to live. This will help us keep track of data we collect during calibration.

mkdir stereo-calibration-demo && cd stereo-calibration-demo

Next initialize the python project. We recommend using pixi

pixi init
 Created /Users/bencaunt/Documents/stereo-calibration-demo/pixi.toml

Then in pixi.toml add preview = ["pixi-build"]

[workspace]
authors = ["Ben Caunt <[email protected]>"]
channels = ["conda-forge"]
name = "stereo-calibration-demo"
platforms = ["osx-arm64"]
version = "0.1.0"
preview = ["pixi-build"] # add this line here! 

[tasks]

[dependencies]

Once that is done we can install our calibration package. This contains the CLI tools needed to generate a CoreVisionX compatible calibration file.

Calibrating your Camera

For this step you will need your CoreVisionX camera plugged into your computer with the included USB-C cable. You will also need a calibration checkerboard printed.

Capturing Data

To begin capturing data run

Calibration view

Above we can see what the view looks like for the stereo calibration process. We want to ensure that both lenses can "see" the checkerboard. We know this is the case when the colored lines are displayed such as in the above image. If you cannot see the lines move the camera closer and double check the columns / rows set in the command above. Pressing space will capture an image. We want to capture around 10-30 images. In each image we want the checkerboards to be taking up as much of the field of view as possible.

Running this process will give you data.npz which contains our collected images.

Next we will calibrate the Intrinsics and Extrinsic of our camera from the collected data:

Which should output similar to the following:

This calibration process will give a second binary called calib.npz this is important to hold onto and it is a good idea to label this as it is specific to the camera being calibrated. Using the same calibration file between different cameras will have poor accuracy. We can check the quality of the output using the preview command.

Here you can see the rectified output. Notice how the parallel lines across the screen line up perfectly in both frames. If this is the case with your camera then you have successfully calibrated your camera and can go onto using your camera for depth applications!

Last updated