Expand description
Core math and geometry primitives for calibration-rs.
This crate provides the foundational building blocks used by all other crates in the workspace:
- linear algebra type aliases (
Real,Vec2,Pt3, and friends), - composable camera models (projection + distortion + sensor + intrinsics),
- a deterministic, model-agnostic RANSAC engine.
Camera pipeline (conceptually):
pixel = intrinsics(sensor(distortion(projection(dir))))
The sensor stage supports a Scheimpflug/tilted sensor homography aligned
with OpenCV’s computeTiltProjectionMatrix.
§Modules
- [
math]: basic type aliases and homogeneous helpers. - [
models]: camera model traits and configuration wrappers. - [
ransac]: generic robust estimation helpers. - [
synthetic]: deterministic synthetic data helpers (tests/examples/benchmarks).
§Example
use vision_calibration_core::{
CameraParams, DistortionParams, FxFyCxCySkew, IntrinsicsParams, ProjectionParams,
SensorParams,
};
let params = CameraParams {
projection: ProjectionParams::Pinhole,
distortion: DistortionParams::None,
sensor: SensorParams::Identity,
intrinsics: IntrinsicsParams::FxFyCxCySkew {
params: FxFyCxCySkew {
fx: 800.0,
fy: 800.0,
cx: 640.0,
cy: 360.0,
skew: 0.0,
},
},
};
let cam = params.build();
let px = cam.project_point_c(&nalgebra::Vector3::new(0.1, 0.2, 1.0));
assert!(px.is_some());Re-exports§
pub use error::Error;
Modules§
- coordinate_
utils - Coordinate transformation utilities for camera projection.
- error
- Typed error enum for this crate.
Typed error enum for
vision-calibration-core. - synthetic
- Deterministic synthetic data generation helpers.
- test_
utils - Test utilities for cross-crate calibration testing.
Structs§
- Brown
Conrady5 - Brown-Conrady 5-parameter radial-tangential distortion model.
- Camera
- A composable camera model: projection -> distortion -> sensor -> intrinsics.
- Camera
FixMask - Combined mask for camera calibration parameters.
- Camera
Params - Serializable camera parameters for building a runtime model.
- Correspondence
View - A single view containing 2D-3D point correspondences.
- Distortion
FixMask - Mask for fixing distortion parameters during optimization.
- FxFy
CxCy Skew - Standard pinhole intrinsics with optional skew.
- Homography
Sensor - Sensor model represented by a 3x3 homography.
- Identity
Sensor - Identity sensor model.
- Intrinsics
FixMask - Mask for fixing intrinsics parameters during optimization.
- NoDistortion
- No distortion (identity mapping).
- NoMeta
- Empty metadata marker for views that do not need extra metadata.
- Pinhole
- Classic pinhole projection model.
- Planar
Dataset - A planar dataset consisting of multiple views.
- Ransac
Options - Configuration parameters for the generic RANSAC engine.
- Ransac
Result - Output of a RANSAC run.
- Ray
- A camera ray represented by its intersection with the z = 1 plane.
- Reprojection
Stats - Summary statistics for reprojection errors.
- RigDataset
- Multi-view dataset for a camera rig.
- RigView
- One time-synchronized rig frame containing per-camera observations and metadata.
- RigView
Obs - Multi-camera observations for one rig view/frame.
- Scheimpflug
Params - Scheimpflug tilt parameters (OpenCV-compatible).
- Target
Pose - Metadata carrying the per-view pose
camera_se3_target. - View
- Single-camera observation view with attached metadata.
Enums§
- Distortion
Params - Serializable distortion model parameters.
- Intrinsics
Params - Serializable intrinsics parameters.
- Projection
Params - Serializable projection model parameters.
- Sensor
Params - Serializable sensor model parameters.
Traits§
- Distortion
Model - Distortion model mapping between ideal and distorted normalized coordinates.
- Estimator
- Generic estimator for RANSAC-like methods.
- Intrinsics
Model - Intrinsics that map sensor-plane coordinates to pixel coordinates.
- Projection
Model - Projection model from a camera direction to normalized coordinates.
- Sensor
Model - Sensor model mapping between normalized and sensor-plane coordinates.
Functions§
- compute_
mean_ reproj_ error - Compute mean per-point reprojection error for a calibrated camera and posed views.
- compute_
rig_ reprojection_ stats - Compute reprojection error statistics for a multi-camera rig dataset.
- compute_
rig_ reprojection_ stats_ per_ camera - Compute per-camera reprojection error statistics for a multi-camera rig dataset.
- distort_
to_ pixel - Apply distortion and convert to pixel coordinates.
- from_
homogeneous - Convert a 3D homogeneous vector back to a 2D point.
- make_
pinhole_ camera - Build a
PinholeCamerafrom intrinsics and Brown-Conrady distortion. - normalized_
to_ pixel - Convert normalized coordinates to pixel coordinates using intrinsics.
- pinhole_
camera_ params - Convert a concrete
PinholeCamerainto serializableCameraParams. - pixel_
to_ normalized - Convert pixel coordinates to normalized coordinates using intrinsics.
- ransac_
fit - Run a generic RANSAC loop for a given
Estimatorimplementation. - to_
homogeneous - Convert a 2D point in Euclidean coordinates into homogeneous coordinates.
- undistort_
pixel - Undistort pixel coordinates to normalized coordinates.
Type Aliases§
- Camera
Model - Concrete camera type built from parameters (f64).
- Iso3
- 3D rigid transform (SE(3)) using
Real. - Mat3
- 3×3 matrix with
Realentries. - Mat4
- 4×4 matrix with
Realentries. - Pinhole
Camera - Concrete pinhole camera alias used across single-camera workflows.
- Pt2
- 2D point with
Realcoordinates. - Pt3
- 3D point with
Realcoordinates. - Real
- Scalar type used throughout the library (currently
f64). - Vec2
- 2D vector with
Realcomponents. - Vec3
- 3D vector with
Realcomponents.