Calibrate
SUMMARY
calibrate() detects the calibration target in every input image and solves for the camera's intrinsic matrix and distortion coefficients via cv::calibrateCamera.
SUPPORTED TARGETS
Works with any target, ChessboardTarget, CharucoTarget, or ArucoTarget, see All Supported Targets.
UNITS
Input images are BGR ndarrays. reprojection_error and per_view_errors are in pixels.
The Skill
python
result = calibrator.calibrate(images)| Skill | Returns | Description |
|---|---|---|
calibrate(images) | IntrinsicResult | Detect the target in every image and run cv::calibrateCamera. |
The Code
python
from telekinesis.axon import IntrinsicCalibrator, IntrinsicOptions
from telekinesis.axon.targets import CharucoTarget
target = CharucoTarget(squares_x=6, squares_y=9, square_length=0.012, marker_length=0.009)
options = IntrinsicOptions()
options.per_view_error_threshold = 0.8
calibrator = IntrinsicCalibrator(target, options)
result = calibrator.calibrate(images)
result.ok # bool
result.intrinsic_matrix # (3, 3) np.ndarray
result.distortion_coefficients
result.reprojection_error
result.successful_indices
result.low_view_error_indicesIntrinsicResult
| Field | Type | Description |
|---|---|---|
ok | bool | False when detection or the solver failed; other fields are then only partially populated. |
intrinsic_matrix | (3, 3) ndarray | Camera matrix. |
distortion_coefficients | ndarray | Distortion coefficients. |
reprojection_error | float | Mean reprojection error (px) over all successful views. |
successful_indices | list[int] | Indices into the input image list with successful detections. |
image_points | list[ndarray] | Detected image points per successful view. |
low_view_error_indices | list[int] | Positions into successful_indices whose per-view error is below per_view_error_threshold. |
per_view_errors | list[float] | Per-view RMS reprojection errors from the extended solver. |
std_deviations_intrinsics | ndarray | Standard deviations of the intrinsics from the solver. |
std_deviations_extrinsics | ndarray | Standard deviations of the extrinsics from the solver. |
See IntrinsicCalibrator for theory and best practices, and IntrinsicCalibrator State to read back the last result.

