Intrinsics Matrix
The intrinsics matrix maps from the sensor coordinate system (normalized or sensor-transformed coordinates) to pixel coordinates. It encodes the camera's internal geometric properties: focal length, principal point, and optional skew.
Definition
where:
- — focal lengths in pixels (horizontal and vertical). These combine the physical focal length with the pixel pitch: where is the focal length in mm and is the pixel width in mm.
- — principal point in pixels. The projection of the optical axis onto the image plane. Typically near the image center but not exactly at it.
- — skew coefficient. Non-zero only if pixel axes are not perpendicular. Effectively zero for all modern sensors; calibration-rs defaults to
zero_skew: truein most configurations.
Forward and Inverse Transform
Sensor to pixel (forward):
where are sensor coordinates (output of the distortion + sensor stages).
Pixel to sensor (inverse):
The IntrinsicsModel Trait
#![allow(unused)] fn main() { pub trait IntrinsicsModel<S: RealField> { fn sensor_to_pixel(&self, sensor: &Point2<S>) -> Point2<S>; fn pixel_to_sensor(&self, pixel: &Point2<S>) -> Point2<S>; } }
The FxFyCxCySkew<S> struct implements this trait:
#![allow(unused)] fn main() { pub struct FxFyCxCySkew<S: RealField> { pub fx: S, pub fy: S, pub cx: S, pub cy: S, pub skew: S, } }
Coordinate Utilities
The coordinate_utils module provides convenience functions that combine intrinsics with distortion:
pixel_to_normalized(pixel, K)— apply to get normalized coordinates on the planenormalized_to_pixel(normalized, K)— apply to get pixel coordinatesundistort_pixel(pixel, K, distortion)— pixel → normalized → undistort → return normalizeddistort_to_pixel(normalized, K, distortion)— distort → apply → return pixel
These functions are used extensively in the linear initialization algorithms, which need to convert between pixel and normalized coordinate spaces.
Aspect Ratio
For most cameras, because pixels are not perfectly square. The ratio reflects the pixel aspect ratio. Typical industrial cameras have aspect ratios very close to 1.0 (within 1-3%).
OpenCV equivalence:
cv::initCameraMatrix2Dprovides initial intrinsics estimates. The matrix format is identical to OpenCV'scameraMatrix.