Camera Intrinsics: Focal Length and Center
A camera turns light rays into pixel numbers with four private numbers: two focal lengths and the pixel where the optical axis lands. Those four numbers are the intrinsics, and every measurement starts with them.
Why Does This Exist?
Two cameras photographing the same scene report different pixel numbers for the same 3D point, because their lenses and sensors differ. You cannot invert a single pixel back into a ray, compare two cameras, or measure anything in metric units until you know the four numbers that define the mapping from rays to pixels. Those numbers are the intrinsics.
The pinhole picture behind them lives in image formation and the camera model, and the full parameter map in camera calibration and parameters. This page covers one piece: what contains, what each entry does, and how to project one point by hand.
Think of It Like This
A projector running in reverse
A slide projector throws an image across the room. Move it further back and the picture grows: that throw distance is the focal length. Shift the projector sideways and the whole picture slides: that centering is the principal point.
A camera is the same machine in reverse. Light comes in through the lens instead of going out, but the throw distance still sets how big things land and the centering still sets where the middle lands. The analogy stops at the glass: a projector sheet is flat by design, while a real camera lens bends rays, which is the separate story of lens distortion.
How It Actually Works
Intrinsics live in the camera matrix . Here and are the focal lengths measured in pixels (one per axis, in case pixels are not perfectly square), and is the principal point, the pixel where the optical axis pierces the sensor:
In plain words: says how many pixels one unit of slope buys you horizontally, and says where slope zero lands. A camera-frame point , meaning coordinates relative to the lens with pointing forward, projects as and . The division by depth is the perspective part: twice as far means half as far from the center.
Worked numbers
Take , , and the camera-frame point :
So the point lands on pixel . Move it to depth and both offsets halve: . That halving is why depth can never be read back from one pixel alone, the scale ambiguity that structure from motion has to resolve.
Code
def project(x: float, z: float, f: float, c: float) -> float: return f * x / z + c # similar triangles, then shift to pixels
print(project(1.0, 4.0, 800.0, 320.0)) # -> 520.0print(project(2.0, 4.0, 800.0, 240.0)) # -> 640.0Watch Out For
Reading focal length in millimetres
Datasheets quote lenses in millimetres, but wants pixels. The conversion is . Plug in mm directly and every projection lands off by two orders of magnitude, which looks like a broken rotation rather than a units bug. Convert first, then project.
Assuming the principal point is the image center
The center pixel of a image is , but manufacturing tolerances shift the true by several pixels. Treating the nominal center as truth injects a small constant bias into every back-projection, worst at the frame edges where rays are steepest. Calibrate it instead of assuming it; that is exactly what camera calibration measures.
The Quick Version
- The intrinsic matrix holds focal lengths and plus the principal point .
- Projection divides by depth first, then scales and shifts: .
- Focal length in is measured in pixels, never millimetres.
- The principal point is near the image center but never exactly it.
- One pixel cannot give depth back, because doubling depth halves the offset identically.