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 lengths and principal point.
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.
The pixel axes are assumed perpendicular, so has no skew term (it is effectively zero for modern sensors).
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 FxFyCxCy<S> struct implements this trait:
#![allow(unused)] fn main() { pub struct FxFyCxCy<S: RealField> { pub fx: S, pub fy: S, pub cx: S, pub cy: S, } }
Coordinate Utilities
Four functions at the root of vision_calibration_core 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.