Foundations to Frontier
Tests
A. Mathematical Foundations › A13 Physics for Robotics and AI

Basic Optics for Cameras

Cameras are the main sensor of modern robots and spacecraft, and every vision algorithm sits on top of a little optics. This topic covers reflection and refraction (Snell's law, total internal reflection), thin lenses and image formation, the pinhole camera model with intrinsic and extrinsic parameters, field of view, aperture, depth of field, the diffraction limit, and lens distortion. In the research exercise you calibrate a camera from 3-D–2-D correspondences with the Direct Linear Transform, recover focal length and principal point, show how unmodelled lens distortion corrupts the result, and compute ground sampling distance and diffraction limits for drone and satellite cameras.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

How cameras see

Light travels in straight lines until it hits something. When it passes from air into glass or water it bends (refraction), which is how a lens works: it bends all the light coming from one point of an object so that it meets again at one point behind the lens, forming an image. A camera puts a sensor at that spot. The simplest camera of all, a box with a pinhole, makes a dim, upside-down picture with no lens at all.

How a camera lens forms an image (and why things blur)
Fsensorobject
image forms 50.85 mm behind the lens (sensor at 50.85 mm) · magnification -0.0169 (inverted) · blur circle 0.0 µm ≈ 0.0 px → sharp
Rays from the arrow's tip through every part of the lens meet again at one image point (orange). The object side is drawn on a compressed scale. If that point lands in front of or behind the sensor, the rays hit the sensor as a blur circle instead of a point; its size is the aperture diameter f/N times the focus error. Stopping down (larger N) shrinks the blur and deepens the depth of field, at the cost of light and, eventually, diffraction. Pixel size 4 µm.
Why engineers care

Visual odometry, SLAM, object detection, star trackers and Mars rovers’ navigation cameras all turn pixels into geometry. That needs a calibrated camera model: focal length, principal point and lens distortion. Resolution limits (pixels or diffraction) decide what an orbiting camera can see on the ground.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Light bending as it enters water is called…
  2. 2. A pinhole camera's image is…
  3. 3. A longer focal length gives a field of view that is…

Level 1: Beginner

★★☆☆☆ Basic⏱ 25 minSecondary-school mathematics: arithmetic and elementary algebra.

Reflection and refraction

  • Mirrors reflect at equal angles.
  • Snell’s law: n1sin⁡θ1=n2sin⁡θ2n_1\sin\theta_1 = n_2\sin\theta_2, with refractive index n = c/v (air ≈ 1, water 1.33, glass ≈ 1.5). Air to glass at 30° bends to 19.5°.
  • Going from glass to air beyond the critical angle arcsin⁡(n2/n1)\arcsin(n_2/n_1) = 41.8°, light totally reflects. This is how optical fibres work.

Thin lenses

1f=1do+1di,m=−dido.\frac1f = \frac1{d_o} + \frac1{d_i},\qquad m = -\frac{d_i}{d_o}.

Objects at infinity focus at f. A 50 mm lens focused on something 2 m away puts the image 51.3 mm behind the lens, inverted and reduced to 1/39 of its size.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Snell's law:
  2. 2. An object very far away focuses…
  3. 3. Total internal reflection needs light going from…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 35 minUndergraduate students and practising engineers.

The pinhole camera model

A camera-frame point (X, Y, Z) projects to the pixel u=fxX/Z+cxu = f_xX/Z + c_x, v=fyY/Z+cyv = f_yY/Z + c_y. In homogeneous form, with world-to-camera rotation R and translation t:

λ(uv1)=(fx0cx0fycy001)⏟K [R ∣ t](X1).\lambda\begin{pmatrix}u\\v\\1\end{pmatrix} = \underbrace{\begin{pmatrix}f_x&0&c_x\\0&f_y&c_y\\0&0&1\end{pmatrix}}_{K}\,[R\,|\,t]\begin{pmatrix}X\\1\end{pmatrix}.
  • Intrinsics: K holds the focal length in pixels (= focal length / pixel pitch) and the principal point.
  • Extrinsics: (R, t) give the camera’s pose.
  • Field of view: 2arctan⁡(w/2f)2\arctan(w/2f). A full-frame 36 mm sensor behind a 50 mm lens sees 39.6°.

Aperture, depth of field and diffraction

The f-number N = f/D sets the aperture diameter D. Out-of-focus points smear into a blur circle proportional to D, so stopping down (larger N) increases depth of field. But a circular aperture can’t resolve angles below the Rayleigh limit θ=1.22λ/D\theta = 1.22\lambda/D. Hubble’s 2.4 m mirror resolves about 0.058″ at 550 nm. From altitude h, the finest ground detail is about hθh\theta, and the pixel footprint (ground sampling distance) is h⋅pixel/fh\cdot\text{pixel}/f.

Lens distortion

Real lenses bend straight lines, mostly radially: xd=x(1+k1r2+k2r4)x_d = x(1 + k_1r^2 + k_2r^4) in normalized coordinates. Wide-angle and fisheye lenses need strong models. Calibration estimates K and the distortion together (Zhang, 2000).

🐍 Exercise 1: optics toolkit
Implement Snell's law with total internal reflection, the critical angle, the thin-lens equation and magnification, pinhole projection through K and [R | t], and field of view.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Focal length in pixels equals…
  2. 2. Stopping down from f/2 to f/8…
  3. 3. The diffraction limit improves with…

Level 3: Advanced

★★★★☆ Advanced⏱ 35 minGraduate level, with full derivations and proofs.

Similar triangles

A ray from (X, Z) through the pinhole hits the image plane at distance f behind it, at x=fX/Zx = fX/Z, by similar triangles. Dividing by the pixel pitch and adding the principal point gives the pixel coordinate. ∎

Magnification

The ray through the lens centre is undeviated, so object and image subtend the same angle: hi/di=−ho/doh_i/d_i = -h_o/d_o, i.e. m=−di/dom = -d_i/d_o. ∎

Calibration by the Direct Linear Transform

Each correspondence X↔(u,v)X\leftrightarrow(u, v) gives two linear equations in the 12 entries of P = K[R | t]. With ≥ 6 non-coplanar points, the least-squares solution is the right singular vector of the stacked system with the smallest singular value (a2-3-5). Normalizing the coordinates first is essential for accuracy (Hartley and Zisserman, 2004). An RQ decomposition of P’s left 3 × 3 block then separates the upper-triangular K from the rotation R.

Exercise 3.1: Hubble’s resolution

1.22⋅550×10−9/2.4=2.8×10−71.22\cdot550\times10^{-9}/2.4 = 2.8\times10^{-7} rad, or 0.058 arcseconds.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Minimum number of points for the DLT (non-coplanar):
  2. 2. RQ decomposition separates P's left block into…
  3. 3. Pinhole projection follows from…

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

Calibrating a camera, and resolution limits

Calibration. A synthetic camera (f = 900 px, principal point (640, 360)) views 40 points of a 3-D target with 0.5 px noise. Normalized DLT plus RQ decomposition recovers f = (899.7, 899.5) px and principal point (641.6, 360.6), with 0.57 px reprojection error (the noise level). If the lens has radial distortion k₁ = −0.25 that the model ignores, the error jumps to 7.64 px. That’s why real calibration estimates distortion too, and why visual odometry with a badly calibrated wide-angle lens drifts.

Resolution.

  • A drone camera (2.4 µm pixels, 8.8 mm lens) at 100 m sees 2.73 cm per pixel.
  • A satellite camera (6.5 µm pixels, 10 m focal length) at 500 km has 0.325 m pixels.
  • But with a 0.7 m aperture, diffraction limits it to 0.479 m. Its optics, not its pixels, set the resolution.
🐍 Exercise 2 (research): camera calibration and resolution
Estimate a camera's projection matrix by the normalized DLT, decompose it to recover the intrinsics, and measure reprojection error with and without unmodelled lens distortion. Then compute ground sampling distance and diffraction-limited resolution for drone and satellite cameras.

Optics in AI, robotics and aerospace

  • Robot vision: calibrated cameras for visual odometry, SLAM and grasping; stereo depth Z = fB/disparity.
  • Space: star trackers (sub-arcsecond attitude), Mars rover navigation and hazard cameras, Earth-observation and telescope design limited by diffraction.
  • Learning: neural radiance fields and 3-D Gaussian splatting rely on the pinhole model and calibrated poses; data augmentation that respects camera geometry.
  • Sensors beyond visible light: lidar (time of flight), thermal infrared, event cameras.

References

  1. R. Hartley, A. Zisserman (2004). Multiple View Geometry in Computer Vision, 2nd ed. Cambridge.
  2. Z. Zhang (2000). “A flexible new technique for camera calibration.” IEEE TPAMI, 22.
  3. E. Hecht (2017). Optics, 5th ed. Pearson.
  4. R. Szeliski (2022). Computer Vision: Algorithms and Applications, 2nd ed. Springer.