The NVIDIA® DriveWorks Graph Calibration Tool constructs a graph representation which is then further optimized.
This tool is available on the x86 Host System and NVIDIA DRIVE™ OS Linux.
Run the tool by executing:
/calibration-graph-cli --targetDB=[path to target database] --dir=[path to directory containing calibration images] --data=[path to a calibration data description json] --graph=[path to a calibration graph json] --showDebug
--targetDB=[path to target database] Description: The target database to use. Automatically assigned `targets.json` when loading from `dir` structure. Ignored when the [graph] parameter is supplied. --dir=[path to directory containing calibration images] Description: Path to a directory with known structure to load calibration images from (see next section). Any `calib-data`, `graph`, and `calibrated-graph` files in the directory will be overwritten. Ignored when the [data] or [graph] parameters are supplied. --data=[path to a calibration data description json] Description: Path to a calibration data description json. Any graph and calibrated-graph json files in the directory will be overwritten. Ignored when the [graph] parameter is supplied. --graph=[path to a calibration graph json] Description: Path to a calibration graph json. Can be used to reload a previously calibrated graph and produce validation images. --showDebug Description: When enabled, displays additional debugging information about the calibration procedure.
calib-data-path/external
(Optional).Some targets are considered "special". For example, targets attached to wheels, or targets laying flat on the floor that constrain the ground plane. These special targets must be declared in a separate special-targets.json
file, with a structure similar to the following example:
Use the Intrinsics Constraints Tool to extract the intrinsic constraints from a recorded video. The tool then generates a JSON file with the camera constraints.
Navigate to the following path by running the following:
cd <calib-data-path>/intrinsics
./calibration-intrinsics-constraints --use-checkerboard=11x8 --input-video=<camera-0>.h264 --output=<camera-0>.json
./calibration-intrinsics-constraints --targetsDB=../targets.json --input-video=<camera-0>.h264 --output=<camera-0>.json
./calibration-intrinsics-constraints --targetsDB=../targets.json --input-folder=external-dlsr --output=external.json
This tool has to be executed for each input video of each camera that needs to be calibrated intrinsically.
Running the tool without arguments assumes the known file structure above. It will determine the names of the cameras from the extrinsics folder.
Then it will look in the intrinsic folder for corresponding json files with the intrinsic constraints. All external images will be used for intrinsic calibration and for extrinsics constraints.
./calibration-graph-cli
One of the outputs of the tool is a calibrated-graph.json
file. This file includes all constraints (intrinsic and extrinsic) used for calibration. Running the tool with
./calibration-graph-cli --graph=calibrated-graph.json
will load the constraints from the graph, initialize the graph with the values in the file, re-run the non-linear optimization, and rewrite all the outputs.
The calibration data can be explicitly specified in a json file. The format of this json file is best understood by example. See /sdk/data/tests/tools/calibration-calibgraph/gt-scenes/quicksilver/SceneQuicksilver-v2/calib-data.json
for an example with 12 cameras.
./calibration-graph-cli --data=calib-data.json
calibrated-graph.json
. This contains all constraints, the calibrated camera models, the camera poses, the target poses, etc. validation-intrinsics-<camera>.jpg
) shows the set of points used for intrinsic calibration. validation-<camera>.jpg
) shows the image used for extrinsic calibration with overlaid results. Detected targets have a green overlay.