tezvyn:

Pinhole Camera Model: Projecting 3D to 2D

AI-drafted, machine-checkedSource: Wikipedia: Pinhole camera modelbeginner
Pinhole Camera Model: Projecting 3D to 2D

The pinhole camera model is a simple formula for how a 3D world flattens into a 2D image. It's the basis for 3D reconstruction and augmented reality, relating an object's real-world position to its pixels.

WHY IT EXISTS To solve a fundamental problem: how do you mathematically relate a point in the 3D world to its corresponding pixel in a 2D image? Without a predictable model, tasks like measuring distances or reconstructing scenes from photos would be impossible. The pinhole model provides the simplest possible geometric answer to this question.

THE MENTAL MODEL Imagine a dark box with a tiny hole on one side and a translucent screen on the opposite side. A ray of light from an object in the world travels in a straight line, passes through the pinhole, and hits the screen, creating an inverted image. The pinhole camera model is the geometry of these light rays, described with simple math. It connects a 3D coordinate (X, Y, Z) in the world to a 2D coordinate (u, v) on the image plane.

HOW IT WORKS The model defines a relationship based on similar triangles. The center of the camera (the pinhole) is the vertex where two triangles meet. One triangle is formed by the 3D object and the pinhole; the other, smaller triangle is formed by the image plane and the pinhole. By knowing the camera's focal length (the distance from the pinhole to the image plane), you can use the geometric properties of similar triangles to calculate the exact 2D position of the 3D point's projection.

WHEN TO USE IT This model is the foundational assumption in many computer vision algorithms. It's used for camera calibration (finding the camera's parameters), image rectification (removing distortion), and as the basis for more complex models in Structure from Motion (SfM) and Simultaneous Localization and Mapping (SLAM). It is the "hello, world" of 3D vision geometry.

WHEN NOT TO USE IT The model should not be used directly on raw images from real cameras without correction. Real cameras have lenses that introduce non-linear distortions (e.g., barrel or fisheye effects) that violate the straight-line assumption. It also doesn't account for effects like depth of field. You use the pinhole model as a component after you've calculated and corrected for these real-world imperfections.

ONE CANONICAL EXAMPLE A self-driving car's perception system needs to know how far away a pedestrian is. It uses a calibrated camera model based on the pinhole principle. The system can project a hypothetical 3D bounding box of a person into the 2D image. By matching the size of this projected box with the actual pixels of the detected pedestrian, it can solve for the distance (the 'Z' coordinate) of the person in the real world.

Read the original → en.wikipedia.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.