CSE445Computer Vision

Pinhole Camera and Projection

World, camera, and image frames tied together by K, R, and t, with perspective's scale ambiguity.

Key Terms

Pinhole ModelIntrinsics KExtrinsics R,tPerspective DivisionProjection MatrixScale Ambiguity

Python Tools

NumPyOpenCVMatplotlib

Textbook Reference

Szeliski Ch.2Hartley & Zisserman Ch.6

Topics Covered

  1. 1Coordinate frames: world, camera, image, and pixel
  2. 2Intrinsic matrix K: focal length, principal point, and skew
  3. 3Extrinsics R and t and the camera center
  4. 4The 3x4 projection matrix P = K[R|t] and perspective division
  5. 5Depth-scale ambiguity and the loss of metric information under projection

Learning Outcomes

  • Assemble the full projection matrix from intrinsic and extrinsic parameters
  • Project 3D points to pixels and explain perspective division
  • Explain why a single view cannot recover absolute scale

Lecture Infographics

1 image file

Camera Projection Pipeline

World > Camera > Image > Pixel frame - all four coordinate transformations at once

1

World Frame

3D global coordinates

A 3D point P_w is expressed in the world coordinate frame — a fixed global reference shared by all objects. Measured in real-world units (e.g. metres).

X_wY_wZ_wO_wP_w

Formula

Pw=[XwYwZw1]TP_w = \begin{bmatrix} X_w & Y_w & Z_w & 1 \end{bmatrix}^{\mathsf T}

Homogeneous 3D point in the fixed world frame.

Next: R, t (extrinsic) →
2

Camera Frame

Extrinsic [R | t]

The extrinsic matrix [R|t] is a rigid-body transform that converts world coordinates into the camera's local frame. The camera optical axis points along +Z_c.

X_cY_cZ_cO_cP_cpZ_c = depth

Formula

Pc=RPw+tP_c = R P_w + t
[R∣t]\begin{bmatrix} R \mid t \end{bmatrix}

Extrinsics map world coordinates into the camera frame.

Next: ÷ Z_c (perspective) →

Extrinsic [R | t]

[R11R12R13txR21R22R23tyR31R32R33tz0001]\begin{bmatrix}R_{11} & R_{12} & R_{13} & t_x \\ R_{21} & R_{22} & R_{23} & t_y \\ R_{31} & R_{32} & R_{33} & t_z \\ 0 & 0 & 0 & 1\end{bmatrix}
3

Image Plane

Perspective divide

Dividing by depth Z_c performs perspective projection onto the normalised image plane at z = 1. Points on the same ray through the optical centre map to the same image point.

xyO (0,0)r=1p(x, y)yx

Formula

x=XcZc,y=YcZcx = \frac{X_c}{Z_c}, \qquad y = \frac{Y_c}{Z_c}

Depth divides the camera point, creating perspective shrinkage.

Next: K (intrinsic) →

Projection P = K [R | t]

[fx0cx00fycy00010]\begin{bmatrix}f_x & 0 & c_x & 0 \\ 0 & f_y & c_y & 0 \\ 0 & 0 & 1 & 0\end{bmatrix}

p~ = P * P~_w

4

Pixel Frame

Intrinsic matrix K

The intrinsic matrix K scales by focal lengths (f_x, f_y) and offsets by the principal point (c_x, c_y) to produce discrete pixel coordinates (u, v) on the image sensor.

(c_x, c_y)p(u, v)u →↓ v

Formula

u=fxx+cxu = f_x x + c_x
v=fyy+cyv = f_y y + c_y

Intrinsic K

[fx0cx0fycy001]\begin{bmatrix}f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1\end{bmatrix}

Pinhole Camera Model — Ray Projection

Scene (World)CameraImage Sensoroptical axisimage planepinhole(optical centre)f (focal length)P₁P₂P₃p₁p₂p₃inverted& flipped

Each scene point P projects through the optical centre onto the image plane. The projection is perspective: a ray from P through the pinhole hits the image plane at p = (f·X_c/Z_c, f·Y_c/Z_c). The image is inverted and depth information is lost.

Lecture PDFs

Pinhole Camera and Projection

The embedded PDF preview is disabled to reduce Vercel bandwidth usage. Open the lecture file directly in Google Drive for viewing, downloading, or presenting.