vision-calibration-core
Core math types, camera models, and RANSAC primitives for calibration-rs.
This crate provides the foundational building blocks used by all other crates in the workspace.
Features
- Linear algebra types:
Real,Vec2,Vec3,Pt2,Pt3,Mat3,Iso3(via nalgebra) - Composable camera models: projection + distortion + sensor + intrinsics pipeline
- Distortion models: Brown-Conrady (k1, k2, k3, p1, p2) with iterative undistortion
- Sensor models: Identity and Scheimpflug/tilt (OpenCV-compatible)
- Deterministic RANSAC: model-agnostic robust estimation engine
- Synthetic data: helpers for generating test/benchmark data
Camera Model
Cameras are modeled as a composable pipeline:
pixel = K(sensor(distortion(projection(dir))))
Where:
projection: camera-frame direction → normalized coordinates (e.g., Pinhole)distortion: warp normalized coordinates (Brown-Conrady radial + tangential)sensor: apply homography (Identity or Scheimpflug tilt)K: intrinsics matrix mapping to pixels (fx, fy, cx, cy, skew)
Usage
use ;
// Build a camera with pinhole projection and Brown-Conrady distortion
let k = FxFyCxCySkew ;
let dist = BrownConrady5 ;
let camera = new;
// Project a 3D point
let p_cam = new;
if let Some = camera.project_point
Synthetic Data Generation
use planar;
// Generate a 6x5 chessboard with 40mm squares
let board_points = grid_points;
// Generate 5 camera poses looking at the board
let poses = poses_yaw_y_z;
// Project all views (requires a camera)
let views = project_views_all?;
RANSAC
use ;
// Implement RansacModel for your problem, then:
let config = RansacConfig ;
let ransac = new;
let result = ransac.run?;
Modules
| Module | Description |
|---|---|
math |
Type aliases and homogeneous coordinate helpers |
models |
Camera, projection, distortion, sensor traits and impls |
ransac |
Generic RANSAC engine with configurable parameters |
synthetic |
Deterministic synthetic data generation |
types |
Common observation and result types |
See Also
- vision-calibration-linear: Linear solvers using these primitives
- vision-calibration-optim: Non-linear refinement
- Book: Core Concepts