BookNotesSlidesP-sets Syllabusdraft · v0.2.64.1
◀▲⌂▶
💬Comments welcome. To leave a note, select any text and click the note / highlight button that pops up — or open the panel with the tab at the top-right (‹). Notes are visible only inside our private review group.
Course notes · 28 sections from the book · 16 optionalPDFessentials+ usefuleverythingthe full book ↗
💡 In a hurry? Jump to this chapter’s 16 big lessons ↓

Lecture Notes 17 — Lenses⧉

Course notes cut from Computational Photography, an AI-powered Slopendium for this lecture. Each section links back to its home in the book; sections marked optional go beyond what the lecture needs.

Contents · 25 sections on this page, from 12 chapters of the book
1INTRO
2FUNDAMENTALS OF IMAGING
5PHOTOGRAPHY
15DEMOSAICKING AND JOINT METHODS
22COMPOUND LENSES, AND ABERRATION CORRECTION

Titles jump to the section below; ↗ opens it in the book.

From digital to computational photography⧉

Computation is the new optics⧉

optional

In a conventional camera, the lens forms an optical image and film or a sensor records it. Better lenses, emulsions, sensors, and exposure control improve that measurement. Processing has always influenced the final photograph, including through chemical development and printing; computation greatly expands the operations we can apply.

Computational photography allows the final picture to differ substantially from the optical image. We can combine exposures, estimate missing values, and use measurements of depth or ray direction. The attainable result depends on the complete system: capture, reconstruction, and display.

The optical image need not look like the desired result. It can instead be designed to preserve information that an algorithm can recover. This is optics and computation co-design: choose the measurement and reconstruction together. A coded measurement is useful only if the desired information survives with enough signal relative to noise.

Consider extending depth of field. Wavefront coding Dowski & Cathey 1995 and the lattice-focal lens Levin et al. 2009 (4D frequency / lattice-focal) deliberately blur the optical image over a range of depths. They aim to make the blur more consistent and easier to invert than ordinary defocus, so one reconstruction can sharpen objects at different distances (Figure 1.1.3). In the usual incoherent imaging model, the sensor receives nonnegative sums of intensities; computation can also subtract and apply nonlinear operations. Deconvolution uses that freedom, at the cost of noise amplification and possible artifacts. The useful depth range and recoverable detail remain finite. See Part 33, Computational optics and coded imaging.

fig-lattice-focal-result
Figure 1.1.3 (reproduced). A camera co-designed with its algorithm: the lattice-focal lens Levin et al. 2009 (4D frequency / lattice-focal). Top: a standard lens holds only one subject in focus, while the lattice-focal lens captures an image that is uniformly, invertibly blurred at every depth, so a single deconvolution brings the whole group sharp at once. The raw capture looks wrongly blurred, which is exactly the point: the optical image need not resemble the final one. Bottom: the optical element itself, a lattice of small subsquares of different focal lengths mounted on the main lens like a screw-in filter, with its point-spread functions calibrated at three depths (90, 150, 180 cm). From Levin, Hasinoff, Green, Durand & Freeman 2009.

“Computation is the new optics” describes this expansion of image formation: we can improve the picture by changing the computation as well as the lens.

Light and optics⧉

Reflection, refraction, and what happens at a surface⧉

optional

A central goal of imaging is to route light through a scene to the right place on a sensor. For this, we mostly deal with three types of interactions with matter and optical elements: reflection, refraction, and diffraction (Figure 2.1.12).

fig-reflection-refraction-diffraction
Figure 2.1.12 (reproduced). Three things light does at a surface. Reflection: a ray bounces off a smooth surface with the angle of reflection equal to the angle of incidence (θᵢ = θᵣ), both measured from the surface normal. Refraction: a ray crossing into a denser medium bends toward the normal because light slows down, obeying Snell's law n₁ sin θ₁ = n₂ sin θ₂; past the critical angle, a ray crossing into a rarer medium cannot escape at all and undergoes total internal reflection (a faint reflected ray is always present). Diffraction: a wave passing a small aperture or edge spreads instead of traveling straight, through an angle θ ≈ λ/d: the narrower the aperture relative to the wavelength, the wider the spread, which is why stopping a lens down too far softens rather than sharpens an image. Reflection and refraction are the everyday cases; diffraction returns in the final section.

Reflection is the simplest: a ray striking a smooth surface bounces off so that the angle going out equals the angle coming in, both measured from the surface normal ($\theta_i = \theta_r$). That single rule explains mirrors and, as we will see, the bright highlights on shiny objects. The reflection angle does not vary with wavelength, which is why mirror optics does not generate chromatic aberrations. One constraint remains: reflection sends light back toward where it came from, so it is awkward to place a sensor there without occluding some of the incoming light. This is why telescopes and mirror (catadioptric) lenses usually carry a small secondary mirror in the middle that turns the light back the other way, through a hole in the primary, to a sensor tucked safely behind it (Figure 2.1.13).

fig-mirror-lens
Figure 2.1.13 (reproduced). Image formation by reflection instead of refraction: a mirror (catadioptric) lens seen head-on. Light enters the ring-shaped front, reflects off a large primary mirror at the back, then off the small central secondary mirror (the disc seen head-on) and out through a hole in the primary to the sensor behind. Folding the path with mirrors packs a long focal length into a stubby barrel, reflection introduces no chromatic aberration, and the blocked center is why such lenses render out-of-focus highlights as little rings ("donut" bokeh). Photograph by Frédo Durand.

Refraction is what happens when light crosses from one medium into another, such as air into glass or air into water. Light has a lower phase velocity in a medium with a higher refractive index, and the ratio of vacuum speed to the speed inside is the medium's refractive index $n$ (about 1.0 for air, 1.33 for water, 1.5 for typical glass). Because the wave slows, it bends. The reason is geometric: when a slanted wavefront reaches the boundary, the side that enters the denser medium first slows first and falls behind, so the whole wavefront pivots toward the slower side, the way a marching band wheels when the file on one end takes shorter steps (you can watch this unfold in Figure 2.1.14). The amount of bending follows Snell's law:

$$ n_1 \sin\theta_1 = n_2 \sin\theta_2. $$

In that same simulation, the plane wave's wavefronts crowd together as they cross into the slower medium (the wavelength shortens by $1/n$) while bending toward the normal, so Snell's law emerges from the wave equation rather than being asserted. It is also the entire reason a lens works; the fuller lens geometry is deferred to the Lens image formation chapter, but the bending rule is the same one here.

fig-refraction-wave-sim
Figure 2.1.14 (reproduced). Refraction as a wave effect. A live 2-D solution of the wave equation: a plane wave descends at an angle and crosses a horizontal interface into a slower medium (higher index $n$, lower half). Where the speed drops, the wavefronts crowd together (wavelength $\to \lambda/n$) and bend toward the normal: exactly $n_1\sin\theta_1 = n_2\sin\theta_2$, now emergent from the dynamics. Interactive: raise $n₂$ and the bending grows; change the incidence angle and the on-figure readout checks Snell's relation; move the wavelength slider and watch it crowd by $1/n$ in the denser medium. Press Play, or move a slider to jump to the new steady state. Companion to Figure 2.1.46.
💡 Big lesson (L2.4) — Snell's law

At a boundary between two media, light bends by $n_1\sin\theta_1 = n_2\sin\theta_2$, toward the normal entering a denser medium, away from it on the way out. This single rule is the seed of all lens optics: every focal length, every ray trace, the thin-lens equation, and every aberration is Snell's law applied at curved glass surfaces. Pair it with the fact that the index $n$ depends on wavelength (the next lesson) and you also get dispersion. Almost everything optical in this book traces back to it.

Dispersion. There is a wrinkle: the refractive index is not a single number but depends on wavelength, $n(\lambda)$, and for ordinary glass it is slightly larger toward the blue than toward the red. Snell's law then bends each color by a slightly different amount, so a single beam of white light fans out into its spectrum. This is dispersion: it is what a prism does, and what paints a rainbow when sunlight refracts through a raindrop. It is also the sharpest difference between refraction and reflection, since a mirror bends every wavelength by exactly the same angle while a lens does not. That wavelength dependence is a gift for spreading light into a spectrum and a curse for forming an image, because a simple lens focuses blue slightly nearer than red and cannot bring every color to one point at once. The resulting color fringing, chromatic aberration, is one of the central problems of lens design, and taming it, with glasses with different dispersions and lens elements of opposing optical powers, special low-dispersion glass, and more elements, is much of the long story of Part 22, Compound lenses, and aberration correction.

fig-prism-dispersion
Figure 2.1.15 (reproduced). Dispersion in a prism. Because the refractive index varies with wavelength (Cauchy's law: $n$ higher toward the blue), each color bends by a slightly different amount at each glass face, so a single white ray entering the prism fans out into a spectrum. This is just Snell's law applied wavelength-by-wavelength, the same physics behind the rainbow and behind chromatic aberration in lenses. Drag the incoming ray, or change the glass index and dispersion.

Diffraction, the spreading of a wave at a small aperture, is the third interaction, and because it sets a fundamental resolution limit it gets its own section at the end of this chapter. Reflection and refraction are naturally handled with ray optics and form the basis of lens design. Diffraction requires a wave perspective but is often a secondary issue in photographic optics, mostly boiling down to reducing sharpness when an aperture is too small.

fig-diffraction-single-slit
Figure 2.1.16 (reproduced). Diffraction at a single aperture, two ways (companion to the grating figure). Huygens wavelets (diagram): the open slit acts as a row of wavelet sources across its width w; straight ahead they are all in phase (the bright central lobe), while at the angle where the path difference across the whole width is one wavelength, w·sinθ = λ, the top half of the slit cancels the bottom half (the first dark minimum). The lobe's angular half-width is therefore about λ/w, so a narrower slit spreads light wider (and a smaller camera aperture blurs more). Full wave simulation: the same slit solved as the 2-D wave equation, the fan emerging from the dynamics. Set the wavelength and the slit width; absorbing borders keep waves from reflecting off the window.

Diffraction is not only a nuisance, though. When light meets a set of small openings, or any structure patterned at the scale of its wavelength (a diffraction grating, a fine periodic microstructure), the spreading waves interfere into strong, orderly beams, so diffraction becomes a way to route light rather than merely blur it. Like refraction it depends on wavelength, so it too separates colors, but in a different way: where glass bends blue light the most, a grating sends the longer red wavelengths to the wider angles. That opposite-signed color behavior is both an opportunity and a challenge for building optics out of diffraction, and we return to it later.

fig-diffraction-grating
Figure 2.1.17 (reproduced). A diffraction grating, two ways, sharing geometry and controls (wavelength λ, slit spacing d, and the angle of incidence θ₀). A strip on the right shows the intensity profile versus position on a distant screen: sharp peaks at the orders in the diagram, and in the wave simulation the measured intensity (the field's power, time-averaged along the screen column), which peaks near the same order directions. Huygens wavelets (diagram): each slit re-emits half-circle wavelets (successive crests color-coded, cycling through a few colors, so you can follow them), and in the directions where neighboring slits differ by a whole number of wavelengths (path difference d·(sinθ_m − sinθ₀) = m·λ) the crests line up into a straight emergent wavefront, a diffraction order. Choose which order to emphasize (0, ±1, ±2): its in-sync wavelet crests are thickened and joined slit-to-slit into that order's wavefront, with the orders 0, ±1, ±2 fanning out. Full wave simulation: the same grating solved as the 2-D wave equation, the orders emerging from the dynamics; press Play, or move a slider to jump to the steady state. In the diagram, Play moves the crests outward, and the emphasized order's wavefront travels with them. Sweep the wavelength and the orders move, longer λ diffracting to larger angles, which is why a grating spreads white light into a spectrum, dispersing the opposite way to a prism; tilt the incidence and the whole fan swings with it. Switch the illumination to white light to superimpose the visible wavelengths at once (in the wave simulation they are injected together into the field): every order but the 0th fans out into a spectrum, longer λ (red) going to the wider angle, while the 0th order stays white where all wavelengths overlap. The slit plane absorbs the incident wave rather than mirroring it back, and all four window edges are absorbing (Mur + sponge), so waves leave off-screen instead of reflecting.

Reflection versus refraction, vs diffraction for building optics. These ways of redirecting light have complementary strengths, and the trade-off runs through all of lens and mirror design. Reflection's great advantage is that it is independent of wavelength: a mirror bends every color by exactly the same angle, so it introduces no chromatic aberration. Its drawback is geometric, because it sends light back the way it came: to catch the focused image you must place a sensor in the returning beam, where it sits in the path of the incoming light and blocks part of it. That is the central nuisance every reflecting (mirror) telescope has to engineer around. Refraction has the opposite profile. It merely bends light, which then carries on in roughly its original direction, so nothing has to sit in the incoming path. But it bends different wavelengths by different amounts, so a single lens focuses the colors in slightly different places, and forcing them all back to one point takes more, and more complex, glass (the long story of Part 22, Compound lenses, and aberration correction). Diffraction is the third and most modern strategy: instead of a bulk shape (a curved mirror or a thick lens), a surface patterned at the scale of the wavelength, a grating, a Fresnel zone plate, or a metasurface, redirects light by interference. Its appeal is that it can be flat and thin, and that its dispersion runs opposite to glass, so a little diffractive structure can help cancel a lens's chromatic aberration. Its costs mirror that strength: it is even more strongly wavelength-dependent than glass, and a grating splits light among several diffraction orders, so only part of the energy lands where you want it and the rest becomes stray light. That is why diffractive elements remain a specialty, powerful for narrow-band and computational optics and for the flat metalenses of Part 33, Computational optics and coded imaging, rather than the everyday way to build a camera lens.

Reflection, refraction, and diffraction are the classical trio, but they are not the last word on steering light. Structured and complex materials can redirect it in ways a smooth surface cannot, most of them wave effects harnessed on purpose: a gradient-index medium that curves rays as they travel, a sub-wavelength metasurface that stamps an arbitrary phase profile from a flat film, a photonic microstructure whose interference sculpts the beam, or a programmable modulator that rewrites the wavefront on the fly. We meet a first taste of this in the next part, where a nano-prism disperses each pixel's colors onto separate photodiodes instead of absorbing them (Chapter 4.6, Sensing color: multiplexing strategies), and we take up the general toolkit later, among the exotic and advanced optics of the computational-optics part.

Video 1. Video: But why would light 'slow down'? (Optics puzzles), by 3Blue1Brown (YouTube).

Wave effects, diffraction, and the diffraction limit⧉

optional

The wave picture imposes a limit on every imaging system ever made. When light passes through a small aperture or skims a sharp edge, it does not continue in perfectly straight rays: it diffracts, bending and spreading out. And, counterintuitively, the smaller the aperture, the more the light spreads (Figure 2.1.45). A wide opening lets the wavefront through almost undisturbed; a narrow one forces it to fan out, through an angle of roughly $\theta \approx \lambda / D$ for an aperture of diameter $D$.

fig-diffraction-aperture-size
Figure 2.1.45 (reproduced). A smaller aperture diffracts more. Light passing a large aperture continues nearly straight; passing a small aperture it fans out far more widely, through an angle of order θ ≈ λ/D. The narrower the opening, the larger the spread, the opposite of the ray-optics intuition, and why shrinking a camera's aperture past a point blurs rather than sharpens. This is a schematic simplification: the diffracted wave has no hard edge or "cone": its intensity simply falls off with angle (shown here by fading the wavefronts), and the true pattern has the side lobes and smooth envelope of the wave-equation solution in the next figure (Figure 2.1.46).

Where does that spreading come from? It is purely a property of waves, and we can watch it happen by solving the wave equation directly. Send a flat wavefront at an opaque barrier with a single slit and let the wave evolve in time: in front of the slit the wavefronts stay flat, but the moment they pass through, they bow into expanding circular arcs and fan outward (Figure 2.1.46). Narrow the slit relative to the wavelength and the fan opens wider: exactly the $\theta \approx \lambda / D$ behavior, now an emergent consequence of the wave dynamics rather than a rule asserted.

fig-diffraction-wave-sim
Figure 2.1.46 (reproduced). Diffraction, simulated. A live 2-D solution of the wave equation: a plane wave arrives from the left and passes through a single slit in an opaque barrier. Before the slit the wavefronts are flat; after it they bend into expanding arcs and spread, and the time-averaged intensity on the far screen forms the single-slit pattern, a broad central lobe flanked by weaker side lobes. Narrowing the slit (or lengthening the wavelength) widens the spread. This is the near-field (Fresnel) pattern at that fixed screen distance, not the textbook far-field sinc²: a narrow slit is already effectively in its far field and shows one broad lobe, while a wide slit still roughly projects its own width, fringed by edge diffraction; the region left of the slit also shows genuine standing-wave interference between the incoming wave and the part reflected off the barrier. Interactive: press play and vary the slit width and wavelength to watch the wave evolve.

The Airy disk. The consequence for imaging is unavoidable: a finite aperture cannot focus light to a perfect point. Even a flawless, aberration-free lens images a single distant point not as a point but as a small bright blur, the Airy disk, surrounded by faint rings, whose angular radius is

$$ \theta \approx 1.22\,\frac{\lambda}{D}, $$

giving a blur-spot diameter on the order of $2.44\,\lambda N$, where $N = f/D$ is the lens's f-number (Figure 2.1.47). The Airy pattern describes an aberration-free, uniformly illuminated circular pupil in the scalar far-field model. Other pupil shapes or weightings change its central lobe and sidelobes; the quoted diameter measures the first dark ring, not the entire extent of the blur.

fig-airy-disk
Figure 2.1.47 (reproduced). The Airy disk: the diffraction-limited blur. A perfect lens images a point source not as a point but as a bright central disk ringed by faint maxima, the Airy pattern. Its angular radius is θ ≈ 1.22 λ/D; the central spot's diameter is ≈ 2.44 λN in f-number terms. This is the smallest spot the lens can make: the floor on resolution set by diffraction, independent of any aberration.

The diffraction limit. Because two nearby point sources blur into two overlapping Airy disks, there is a finest detail a lens can resolve: the diffraction limit. By the Rayleigh criterion, two points are just resolvable when the center of one Airy disk falls on the first dark ring of the other, again at $\theta \approx 1.22\,\lambda/D$. The headline is that a larger aperture diffracts less and resolves finer detail. It is worth putting numbers to that, because the limit is not an abstraction: it decides whether a given lens can read a license plate across a street or separate two stars (Figure 2.1.48).

fig-diffraction-limit-calculator
Figure 2.1.48 (reproduced). What a given aperture can actually resolve. The Rayleigh angle $\theta = 1.22\,\lambda/D$ turns into a finest resolvable angle and, once multiplied by the subject distance, a finest resolvable detail on the subject; the same physics fixes the Airy disk's diameter $2.44\,\lambda N$ at the sensor, drawn to scale against a 4 µm pixel grid so you can see when the blur outgrows a pixel and resolution stops being the sensor's business. The focal length, f-number, and aperture diameter are linked by $N = f/D$, so moving any one drives the dependent one and the three can never disagree. Wavelength is fixed at 550 nm, mid-visible green. Interactive: set the lens and the subject distance and read both limits.
💡 Big lesson (L2.10) — the smaller the aperture, the more diffraction blurs

Counter to ray-optics intuition, a smaller aperture spreads light more: the diffraction blur (the Airy disk) grows as $\sim\!\lambda N$ with f-number, so stopping down past a point softens the image instead of sharpening it. The flip side is the rule behind every instrument that must resolve fine detail: only a large aperture can diffract little and resolve finely, which is exactly why microscopes and telescopes are built around large lenses and mirrors, and why a phone camera's tiny aperture hits a hard resolution wall it cannot pass. It is the optical cousin of "you can't sample your way past Nyquist."

This produces the photographer's sweet spot. Open the aperture wide and aberrations (the imperfections of real glass, deferred to the Optics part) dominate, softening the image. Stop the aperture far down and diffraction dominates, softening it again. Somewhere in between, typically a couple of stops down from wide open, the two effects are jointly minimized and the lens is at its sharpest. "Stopping down too far softens the image" is not a defect of cheap lenses; it is physics, and the trade-off is made quantitative with the modulation transfer function in the Optics part.

fig-optics-bench
Figure 2.1.49 (reproduced). A build-it-yourself optical bench. Interactive: drop light sources and optical elements onto the bench: generators (from a single wavelength up to full daylight spectra), lenses, prisms, glass disks, mirrors, apertures, beam splitters, filters, spectral-BRDF objects, and sensors, then drag, rotate, scale, and tune each one. A single switch runs the same scene as recursive ray tracing (Snell refraction with dispersion, Fresnel reflection, and coatings) or as a live 2-D wave simulation (FDTD), or both at once, so you can watch a plane wave crowd and bend through a lens exactly as the rays converge. Every bench you build rides its own shareable link.

fig-diffraction-softening
Figure 2.1.50 (reproduced). Diffraction softening a photograph, one f-number at a time. Each pixel of the crop is treated as a sensor pixel of the chosen pitch, and the crop is convolved in linear light with the Airy pattern for that f-number and wavelength, drawn beside it on the same pixel grid with its first dark ring marked. The readout compares the lens's cutoff frequency 1/(λN) with the sensor's Nyquist 1/(2p): once the cutoff falls below Nyquist, stopping down further costs detail the sensor could otherwise have recorded. One wavelength stands for all three channels. Interactive: set the f-number, the wavelength and the pixel pitch, and change the photograph.

Pinhole image formation and linear perspective⧉

Pinhole imaging and the perspective projection⧉

optional

The simplest fix is a wall with a hole in it. Put a barrier between the scene and the sensor and punch a tiny hole, a pinhole, and almost every ray is blocked. For each point on the sensor exactly one ray survives: the single ray from the scene that happens to pass straight through the hole. That one-ray-per-point rule is precisely the selection we needed, and an inverted image appears (Figure 2.2.2). This is the camera obscura (Latin for "dark room"), known to Mozi in ancient China and to Aristotle, used by Renaissance painters as a drawing aid, and still the cleanest way to understand every camera built since (Figure 2.2.5 and Figure 2.2.6). You can make one yourself: a darkened room with a small hole in the window shade projects the street outside, upside down, onto the opposite wall. Doing it once makes the geometry below concrete.

💡 Big lesson (L2.11) — image formation is choosing which rays reach each point

Forming an image is, at bottom, controlling which ray (or rays) of light contribute to each point of the image. A bare sensor fails because every scene point sends light to every pixel. The sum is a flat gray. A pinhole admits one ray per point (sharp, but dim); a lens gathers a whole cone of rays from one scene point and bends them back to one image point (bright, but only for one focal plane); an open hole with no focusing mixes many rays and blurs. Every imaging idea in this book (focus and depth of field, coded apertures, light fields, even a CT scanner) is a different answer to the one question: which rays land here?

fig-pinhole-imaging
Figure 2.2.2 (reproduced). Adding a pinhole to the bare sensor of Figure 1. A barrier with a tiny hole admits exactly one ray per scene point, so the canopy (red), mid-trunk (blue) and base (gold) each reach a single photosite and an inverted image forms, where the bare sensor recorded only an average. The catch: almost all the light is blocked, so the image is very dim, which is exactly what the lens (next chapter) fixes.
fig-image-formation
Figure 2.2.3 (reproduced). Interactive: which rays reach each point, Big Lesson L2.11 made playable. Click a sensor pixel (right) to light up the hemisphere of rays it gathers, then switch between a bare sensor, a pinhole, a thin lens, and a real thick lens. The bare sensor integrates its whole hemisphere, so every pixel reads the same average, a flat gray, no image; a pinhole admits a narrow pencil and a dim inverted image appears; a lens gathers a whole cone from each in-focus point and bends it back onto one pixel, bright and sharp. Because a pixel's brightness is proportional to how much light reaches it, you can see the pinhole's darkness and the lens's brightness directly: shrink the hole for sharpness (toggle diffraction to reach the limit), open the aperture for light, drag the subject, or click a scene point to send its rays the other way. The thick lens uses Snell's law on two spherical surfaces, so it even shows spherical aberration.
fig-image-formation-3d
Figure 2.2.4 (reproduced). The same idea in 3D. Orbit a scene (a tree and a person on the ground) with the sensor at right and the optic plane (wall, pinhole, or lens) between them, movable along the axis. Click the sensor to see the cone of rays a pixel gathers, or click the tree, person, or ground to see where that point's rays go; switch between bare sensor, pinhole, thin lens, and thick lens. The inset shows the image the sensor actually records, rendered from a camera at the aperture: flat gray for the bare sensor, a dim sharp image for the pinhole, and a bright image with real depth of field for the lenses, the focused subject sharp, the tree behind it blurred. The 3-D tree and human meshes were generated with Meshy.
fig-camera-obscura
Figure 2.2.5 (reproduced). The camera obscura. Light from a sunlit scene passes through a small hole in the wall of a darkened room and forms an inverted image on the opposite wall (here an artist's rendering). Only the single ray from each scene point that threads the hole reaches the wall, so each point of the wall is tied to one direction in the scene. The principle was known in antiquity and used by painters as a drawing aid.
fig-camera-obscura-apparatus
Figure 2.2.6 (reproduced). A portable camera obscura, from Diderot and d'Alembert's Encyclopédie. The same principle, built into a box: a small aperture (often with a simple lens) projects the scene onto a ground-glass screen or, via a mirror, onto paper for tracing. The drawing aid that taught a generation of artists linear perspective is the direct ancestor of the camera.

You can still shoot one today: replace a camera's lens with a pinhole and you get a real pinhole photograph (Figure 2.2.7). It reveals the catch the idealized "one ray per point" story hides: a real hole has finite size (and diffraction sets a floor on how small it can usefully be), so each image point actually collects a small disc of rays, not one, so the picture is soft everywhere. There is no lens focus setting, and the depth of field is very large. Finite-hole geometric blur nevertheless depends on object distance, especially for nearby objects; diffraction adds another source of softness. A gentle vignetting darkens the corners, where rays strike the sensor at a glancing angle. The result is dim, soft, and has very large depth of field, exactly the trade the lens of the next chapter renegotiates, buying brightness and sharpness at the price of a single plane of focus.

fig-pinhole-self-portrait
Figure 2.2.7 (reproduced). A real pinhole photograph: the author, shot with a pinhole in place of a lens. With no lens to focus a cone of rays, every point of the image gathers a small disc of light, so the picture is soft throughout; but with no focal plane, that softness is uniform: the face and the background tree share one deep depth of field. The darkened corners are the pinhole's natural vignetting. This is what the idealized geometry below looks like in practice, and why the lens is worth its one plane of sharp focus.
fig-pinhole-camera-photo
Figure 2.2.8 (reproduced). The pinhole camera used to make the self-portrait in the previous figure: an ordinary camera body with a body cap in place of the lens, pierced with a drill to make the tiny hole (drill the cap off the camera, not while it is mounted ;-). No glass, no focal plane: just the aperture and the sensor behind it. The hole sits roughly 20 mm from the sensor, so it gives a fairly wide-angle view. (Author's photograph.)
Figure 1. community Upload your own pinhole photograph to share with other readers.

The geometry of a pinhole. To make the picture precise, place the pinhole at the origin and point the camera down the $z$ axis, into the scene, our standing convention (Conventions, Notation & Style#Geometry & coordinate systems: $x$ right, $y$ down, $z$ forward). A scene point sits at world coordinates $(X, Y, Z)$; its one surviving ray runs straight to the pinhole and continues on to strike the sensor. Because the physical sensor sits behind the pinhole, the image it forms is inverted, upside down and flipped left-to-right, exactly as on the wall of the dark room. That inversion is a nuisance to reason about, so throughout the book we use a trick: imagine a virtual image plane the same distance in front of the pinhole. No light actually lands there (it is not physical), but it carries the identical image right-side up, so we never have to mentally flip anything (Figure 2.2.10).

The distance from the pinhole to the image plane controls the field of view for a given sensor size: the bigger it is, the narrower the view. For this purpose it plays exactly the role that the focal length $f$ plays for lenses, so we will use that term throughout, even though, strictly speaking, "focal length" should only apply to lenses. This distance is also what changes when you zoom in or out: a short focal length puts the image plane close to the pinhole, so a wide swath of the scene lands on a sensor of given size (a wide-angle view); a long focal length pushes the plane far away, magnifying a narrow slice (a telephoto view). The exact relation between focal length and the field of view (FOV), for a sensor of a given size, is

$$ \text{FOV} = 2\arctan\!\left(\frac{\text{sensor size}}{2f}\right), $$

which just says: the wider the sensor or the shorter the focal length, the more of the world you take in.

💡 Big lesson (L2.12) — field of view depends on the sensor size

For a pinhole a fixed distance $f$ from the sensor, the field of view is set by the sensor size: $\text{FOV}=2\arctan(\text{sensor}/2f)$. Hold $f$ fixed and slide a larger sensor behind the same pinhole and you take in more of the world; a smaller sensor crops to a narrower view. So "how wide a shot is" is never a property of the pinhole (or, next chapter, the lens) alone: it is the pinhole-to-sensor distance and the sensor size, together. This is the geometric root of the crop factor and of "35 mm-equivalent" focal lengths (next chapter), and the reason the same lens is wide on a big sensor and tele on a small one.

(Pinholes are not merely a teaching device: several animal eyes, such as the nautilus's, are essentially pinhole cameras, trading sharpness for the simplicity of needing no lens; the eye's full evolutionary path (from a bare photoreceptor patch to the lens eye) appears in Chapter 3.6, Animal eyes.)

fig-pinhole-fov
Figure 2.2.10 (reproduced). Pinhole imaging geometry, drawn as a side (y-z) view with z pointing right into the scene and y pointing down. A scene point's ray passes through the pinhole; on the physical image plane behind the pinhole the image is inverted, while the virtual image plane the same distance f in front carries the same image upright, the convention we adopt. The pinhole-to-plane distance is the focal length f: a short f gives a wide field of view, a long f a narrow one, by FOV = 2·arctan(sensor / 2f).

Since zooming is just changing this pinhole-to-sensor distance, it comes to the same thing as cropping: keep the central part of a wider shot, rescale it to fill the frame, and you get the same ideal perspective framing as a longer focal length from the same projection center (Figure 2.2.11). We will see the formal reason once we split the projection into its pieces, but the equivalence already holds.

💡 Big lesson (L2.13) — cropping is the same as zooming in

From a pure geometric-projection standpoint, cropping an image and zooming in (lengthening the focal length) are one and the same operation. Both leave the perspective projection (the divide-by-$Z$ onto the normalized plane) completely untouched and change only the pixel stage $K$: a crop keeps a smaller patch of the projected image and rescales it to fill the frame, which is exactly what a larger $f_x, f_y$ does. So a 2× crop and a 2× zoom give the identical framing and identical perspective, differing only in resolution: the crop simply has fewer pixels to show for it. This is why "digital zoom" is geometrically free but costs detail, and why the crop factor between sensor sizes acts as a focal-length multiplier.

fig-crop-focal-length
Figure 2.2.11 (reproduced). Cropping = longer focal length. Left, a full-frame capture of a scene; right, the central crop enlarged to the same output size. The crop is geometrically identical to a photo taken with a longer focal length (a narrower field of view); only the pixel-mapping stage K changed, not the underlying projection. The crop just has fewer pixels to work with.

The perspective projection equation. Now read off where a scene point lands. In the side view of Figure 2.2.12, the ray from $(X, Y, Z)$ to the pinhole and the image plane at distance $f$ form two similar triangles. The large triangle has height $Y$ and base $Z$ (the point's height and depth), and the small one has height $y'$, the image coordinate, and base $f$. Similar triangles share their ratio of height to base, so $y'/f = Y/Z$, and the same holds horizontally. The image coordinates of the point are therefore

$$ x' = f\,\frac{X}{Z}, \qquad y' = f\,\frac{Y}{Z}. $$

That is, linear perspective projection of a 3D point consists in a division of its $X$ and $Y$ coordinates by its depth $Z$ and a multiplication by the focal length $f$. This is consistent with higher magnification for a larger focal length and with the foreshortening of points at large depth. That single division by $Z$ is the heart of linear perspective. It is why distant things look smaller (double the depth, halve the image size), why railroad tracks appear to converge, and why a photograph carries a sense of depth that a flat scan of a document does not. Almost everything else in this chapter's geometry is a consequence of dividing by $Z$. The "linear" in linear perspective, by the way, is the painter's term for the rule that straight lines in the world stay straight in the picture, the one nice property the projection keeps, which we make precise two sections from now.

💡 Big lesson (L2.14) — linear perspective is a divide by depth

With the camera at the origin looking down $z$, a scene point $(X,Y,Z)$ lands at $(f X/Z,\; f Y/Z)$: the whole of perspective is dividing by depth. That one division produces everything we call perspective: farther things appear smaller (double the depth, halve the size), parallel lines converge to vanishing points, and the picture gains its sense of space. It is also why depth is the hard thing to recover: the division throws $Z$ away, and a single image cannot tell a small near object from a large far one. Every stereo, structure-from-motion, and depth-estimation method in later parts is, in effect, trying to undo this divide.

fig-perspective-projection
Figure 2.2.12 (reproduced). The perspective projection equation by similar triangles. Side (y-z) view: a scene point at height Y and depth Z, the pinhole at the origin, and the image plane at distance f. The ray through the pinhole makes two similar triangles, giving y'/f = Y/Z, hence y' = f·Y/Z (and x' = f·X/Z horizontally). The image coordinate is the world coordinate divided by depth and scaled by focal length, the "divide by Z" that shrinks distant objects. Drag the point (push it deeper and watch y' shrink) or drag the image plane to change f.
fig-perspective-projection-3d
Figure 2.2.13 (reproduced). Perspective projection in 3D. A scene point P = (X, Y, Z) and its image point p = (x', y') on the image plane, with the projection rays drawn in three dimensions. Complements the 2D similar-triangles view of Figure 2.2.12 by showing the full geometry: the same point, the same pinhole, the same f, now seen in space. A low-poly house replaces the single point; drag to orbit and see the projection cone traced by every corner's ray through the pinhole, and slide the house nearer or farther to watch the projected image grow or shrink (÷Z). Because the sensor is a fixed size, a longer f pushes the image plane back and narrows the angle of view. Tick "actual pinhole" to move the image plane behind the pinhole, where the real camera-obscura image forms upside down (inverted in both X and Y): the upright front plane is the mathematician's convenient fiction, while the inverted back plane is the physics.
Video 2. Video: Perspective projection in 5 minutes, by Graphics in 5 Minutes (YouTube).

Lens image formation⧉

in the book↗

A pinhole forms an image by throwing away almost all the light; only the rays through the tiny hole survive. That is a serious problem: a pinhole sharp enough to make a crisp image passes so little light that exposures take seconds, and (as Chapter 2.1, Light and optics explains) shrinking the hole eventually blurs the image anyway. We want to collect a wide cone of light from each scene point, far more light than a pinhole, and still focus it to a single image point. That is exactly what a lens does, and the price to pay is that we get a single plane of focus and a finite depth of field.

fig-lens-imaging
Figure 2.3.1 (reproduced). The third imaging scenario, and the sum of the first two. Where the bare sensor (Figure 2.3.1 of the previous chapter) averaged every direction and the pinhole (Figure 1b there) admitted a single ray per point, a lens gathers a whole cone of rays from each scene point, canopy (red), mid-trunk (blue), base (gold), and focuses them back to one photosite. The image is the same inverted one as the pinhole's, but now bright and sharp, because (almost) all of each point's light is used instead of thrown away. The bill (one plane of focus and a finite depth of field) comes due over the rest of this chapter.

The two image-formation playgrounds from the pinhole chapter return here, now opened on the thick lens rather than the bare sensor. They carry the same four scenarios as before (bare sensor, pinhole, thin lens, thick lens); flip between them and notice how much brighter and sharper the lens images are than the pinhole's, and far more so than the bare sensor's flat average. The lens earns that by gathering a whole cone of rays from each point instead of the single ray a pinhole keeps.

fig-image-formation-lens
Figure 2.3.2 (reproduced). The 2-D image-formation playground again, opened on the thick lens. Same four scenarios as in the pinhole chapter (bare sensor, pinhole, thin lens, thick lens): switch among them and watch the image go from a flat average (bare sensor) to dim but sharp (pinhole) to bright and sharp (lens), because the lens collects a whole cone of rays per point instead of one. Click a pixel to see the cone it gathers, or a scene point to see where its rays land. Notice how much more light reaches each pixel once a lens replaces the pinhole.
fig-image-formation-3d-lens
Figure 2.3.3 (reproduced). The same experiment in 3-D, on the thick lens: orbit the scene, click the sensor to see the cone of rays one pixel now gathers, and read the recorded image in the inset. Compare the lens against the pinhole and the bare sensor with the scenario buttons, and notice how much brighter and sharper the lens image is while it stays in focus.

Recall the framing from the pinhole chapter: image formation is about choosing which rays contribute to each image point (→ see Big lesson L2.11). The pinhole answered with one ray per point; the lens gives a richer answer.

💡 Big lesson (L2.18) — a lens makes a large set of ray from an in-focus point reconverge to one image point

Where a pinhole keeps only one ray, a lens gathers a whole cone of rays leaving a scene point and bends them back to a single image point, but only for points at the focus distance. That is the lens's compromise: vastly more light (a bright image) in exchange for a single plane of sharp focus, with everything nearer or farther spread into a blur disk (the circle of confusion). The aperture sets how wide that cone is, and hence the depth of field. Every later idea about focus, bokeh, refocusing, and light fields is a variation on "which cone of rays reconverges where."

We follow that tradeoff in three steps. First, a single lens bending light by refraction: Snell's law at two curved surfaces, with the Fermat "equal optical path" view alongside. Then the thin lens: the small-angle linearization of that law that hands us the focus equation, conjugates, magnification, and the f-number in a few clean lines. Finally, depth of field: the range of distances a single focus plane keeps acceptably sharp, which gets its own chapter (Chapter 2.5, Depth of field). Throughout, we are using the paraxial model; what it throws away (aberrations, color) points forward to Part 22, Compound lenses, and aberration correction.

Single lenses: refraction and Snell's law⧉

in the book↗

A real lens is a piece of glass bounded by two curved surfaces, that is, two interfaces: air-to-glass and glass-to-air. It works by refraction: the bending of light as it crosses between media of different refractive index, introduced in Chapter 2.1, Light and optics. At each interface a ray bends according to Snell's law (Descartes' law, if you are French):

$$ n_1 \sin\theta_1 = n_2 \sin\theta_2, $$

where $n_1, n_2$ are the refractive indices on the two sides and $\theta_1, \theta_2$ the angles measured from the surface normal. Drawn on a deliberately thick lens, with the two interfaces far apart, you can watch the bending happen twice (once entering the glass, once leaving) and the net effect of the two curved surfaces is to steer a parallel bundle of rays so they converge to a focal point (Figure 2.3.4 and Figure 2.3.5). A curved interface bends each ray by an amount that depends on where it strikes the surface, and the curvature is chosen so that all the rays from one scene point are redirected to meet at one image point. That is the whole job of a lens: bend a wide cone back to a point.

fig-single-lens-refraction
Figure 2.3.4 (reproduced). A single lens focusing by refraction at two interfaces. A lens is glass with two curved surfaces. Parallel incoming rays refract by Snell's law n₁ sin θ₁ = n₂ sin θ₂ at the first (air→glass) interface and again at the second (glass→air) interface; the two bends together converge the parallel rays to a focal point. The thin-lens idealization (collapsing both bends into one plane) is overlaid for comparison.
fig-snell-two-interface
Figure 2.3.5 (reproduced). Snell's law at both surfaces of a thick lens. A ray arriving parallel to the axis refracts at the curved front surface (air→glass), crosses the glass, and refracts again at the curved back surface (glass→air); the angle of incidence and angle of refraction are marked at each interface, measured from the local radial surface normal, with the indices n₁ (air) and n₂ (glass). The two refractions add up to bend the ray toward the optical axis, where it meets the focus. A faint second ray shows the convergence. This is the accurate two-surface picture that the thin lens later collapses into a single plane.
fig-xkcd-1791
Figure 2.3.6 (reproduced). xkcd #1791 "Refractor vs Reflector", Randall Munroe, xkcd.com/1791 (CC BY-NC 2.5).

A second, equivalent view: Fermat and equal path lengths. There is a wave-side way to see why a lens focuses. Kept alongside the ray picture, it explains why the curvature has to be just so. A lens focuses because every ray from the object to the focus travels the same optical path length, geometric distance weighted by the refractive index of each medium it crosses (Figure 2.3.7). Between an on-axis object point and image point, a peripheral route has greater geometric length than the axial route. The thicker center of a converging lens adds more optical delay to the axial route, compensating for that difference. The lens's shape is exactly what makes these trade off perfectly, so all the rays arrive at the focus in phase and interfere constructively, building a bright point. Fermat's principle states that a ray follows a stationary optical path. Equal optical path across the pupil is the stronger condition for perfect coherent focusing between a chosen pair of conjugate points; aberrations are departures from it.

fig-fermat-equal-path
Figure 2.3.7 (reproduced). The Fermat (equal-path) view of focusing. Several rays leave one object point, pass through different parts of the lens, and meet at the focus. The central ray's longer geometric path is spent partly in slow glass; the edge ray's shorter path is almost all in fast air. The lens shape equalizes the optical path length (geometric length × refractive index) of every route, so all rays arrive in phase and interfere constructively. The wave counterpart of the Snell's-law ray picture.

How strongly a lens bends light (its focal length) is set by the curvature of its two surfaces and the glass index, through the thin-lens maker's equation in air:

$$ \frac{1}{f} = (n - 1)\left(\frac{1}{R_1} - \frac{1}{R_2}\right), $$

with signed radii $R_1,R_2$, positive when the center of curvature is downstream along the light direction. Lens thickness adds another term for a thick lens. More curvature, or a higher index, means a shorter focal length (stronger bending). We can watch this happen directly by solving the wave equation: send a point source's diverging wave into a slab of glass and let the wave evolve (Figure 2.3.8). Because the glass is thickest on the axis, it slows the middle of each wavefront most, and that is exactly enough to bend a diverging wavefront into a converging one, which collapses to an image point on the far side. In the paraxial thin-lens approximation, the focus follows the lensmaker and imaging equations; a thick lens requires its principal planes and thickness correction, and tightening the curvature or raising the index pulls it inward, just as $1/f=(n-1)\,2/R$ predicts.

fig-thick-lens-wave-sim
Figure 2.3.8 (reproduced). A thick lens focusing, simulated. A live 2-D solution of the wave equation: a point source on the left radiates circular waves that cross a biconvex glass slab in which the wave travels slower (index $n$). The glass is thickest on the axis, so it retards the center of each wavefront most, turning the diverging wave into a converging one that collapses to an image point, the Fermat/equal-path view made literal. The focus obeys the lensmaker's equation $1/f=(n-1)\,2/R$ and the imaging equation $1/v=1/f-1/u$, both shown live on the figure. Interactive: sweep the surface curvature $R$, the glass index $n$, and the source distance $u$ and watch the focus move. The lens sits in an opaque mount so all light goes through the glass; absorbing borders, so nothing reflects off the window edges.

This whole picture, though, already assumes the rays make small angles with the axis: it is paraxial. At large angles the rays from a single point do not all meet at exactly one place, and the image degrades; those departures are aberrations, the subject of the OPTICS part, where compound lenses (many elements) are designed to cancel them. Our own eyes are refracting systems too: the cornea and the lens are the two main bending elements, doing for the retina what a camera lens does for the sensor.

Thin lens optics⧉

in the book↗

The two-interface, Snell's-law lens is accurate but cumbersome. For everything in this book except the dedicated optics chapters, we replace it with a linearization called the thin lens, and two assumptions do all the work. First, the rays stay near the axis and make only small angles, so Snell's law can be linearized: for small $\theta$, $\sin\theta\approx\theta$, the angle and its sine agree and the bending becomes proportional to the angle. Second, the lens is thin enough that we can ignore how far the light travels inside the glass, so both refractions collapse into a single bend at one plane.

Weigh what that buys and what it costs (Figure 2.3.9). The small-angle (paraxial) swap is exactly why the focus equation $\tfrac{1}{f}=\tfrac{1}{u}+\tfrac{1}{v}$ (below) comes out so clean, and why "every ray from one object point converges to one image point" is true in the model: with $\sin\theta\approx\theta$ a single object point images to a single, perfectly sharp point (stigmatic imaging), and a parallel bundle from infinity converges to one point in the focal plane. A real lens only approximates this. Rays that wander too far from the axis miss the ideal point, the departures we call aberrations (spherical aberration, coma, and the rest). And the model drops color: the real index $n$ varies with wavelength (dispersion), so red and blue bend by slightly different amounts and focus in slightly different places (chromatic aberration), while the single-wavelength version used here assigns one $n$ and one focus. A thin-lens model can retain dispersion by allowing $f$ to depend on wavelength. So the thin lens is a convenient lie, linearizing Snell's law and throwing away color, accurate enough that the whole rest of the book leans on it and wrong in precisely the ways the OPTICS chapters spend their time correcting.

💡 Big lesson (L2.19) — when a quantity is small, linearize: keep the first Taylor term

What we just did to Snell's law is one of the most powerful moves in all of physics and engineering, and the book will reach for it again and again. Replace a messy nonlinear function by its tangent line near the operating point, keep only the first-order (linear) term of its Taylor expansion, and it is an excellent approximation as long as the relevant quantity stays small. Here the small quantity is the angle, $\sin\theta\approx\theta$, and the reward is the entire clean, linear machinery of paraxial optics. The same reflex linearizes brightness change into the optical-flow constraint (a chapter away), drives the Gauss–Newton steps of lens optimization and bundle adjustment, and propagates small noise through a pipeline. Two disciplines keep it sound. Know when it breaks: the approximation is only as good as the terms you dropped are negligible, so always ask "how small is small?" And keep the next term in your pocket: restoring it is not a footnote but a whole theory: for optics that next term is the cubic $-\theta^3/6$, and restoring it is the study of aberrations (next big lesson, and the OPTICS part).

💡 Big lesson (L2.20) — thin-lens optics is a linear (first-order) approximation of Snell's law when angles are small (the paraxial regime)

The clean thin-lens equation $1/f = 1/u + 1/v$ is not a separate law: it is Snell's law L2.4 linearized, kept to first order under the small-angle approximation $\sin\theta\approx\theta$, the regime known as paraxial (rays near the axis, gentle angles, one wavelength). Because it keeps only the linear term, it tells you exactly when the idealization holds and exactly how it breaks: restore the next term $\sin\theta\approx\theta-\theta^3/6$ and the Seidel aberrations appear; let $n$ vary with wavelength and chromatic aberration appears. "Thin lens," "first-order optics," "a linear (paraxial) lens," and "a lens with no aberrations" are all the same approximation, and the OPTICS part is the story of paying back what it borrowed.

fig-thin-lens-approximation
Figure 2.3.9 (reproduced). The thin lens is the small-angle linearization of a real, thick, Snell's-law lens (interactive). A biconvex glass lens is traced two ways: the correct optics (refract by Snell's law at each curved surface, for three wavelengths whose index differs by the dispersion) and the thin approximation (bend once at the center plane, one index, dashed). Near the axis and for one color they agree; away from the axis the correct rays focus short of the ideal point (spherical aberration) and the colors split (chromatic aberration), exactly what the thin lens throws away. A "show" control displays the thick lens alone, the thin approximation alone, or both together. Sweep the thickness, curvature, index, dispersion, and incoming tilt.

Under these two assumptions the geometry collapses to bending at a single plane, and two construction rules locate any image:

  1. A ray arriving parallel to the axis leaves through the focal point $F$, at distance $f$.
  2. A ray through the center of the lens passes undeviated, straight through, as through a pinhole. (This second rule is why a thin lens has the same perspective as a pinhole: the central ray is the chief ray, so the projection geometry of the previous chapter carries over unchanged. The lens only adds light-gathering and focus on top of pinhole projection.)
💡 Big lesson (L2.21) — the two thin-lens ray rules

Parallel rays through a thin lens converge to a point at the focal length, and rays going through the center of a thin lens do not deviate. The first rule is what focal length means (where a far subject's parallel bundle meets) and carries the lens's focusing power; the second carries its perspective, identical to the pinhole's. Between these two construction rules and similar triangles, you can derive all of thin-lens optics.

fig-thin-lens-two-rules
Figure 2.3.10 (reproduced). The two thin-lens ray rules (interactive), in the order of the lesson. Left (rule 1): two bundles of parallel rays, an on-axis bundle meeting at the focal point F and a tilted bundle meeting off-axis, each converging to a single point on the focal plane a distance f behind the lens: the focusing power, and the meaning of focal length. Right (rule 2): a bundle of rays passing through the center of the lens, every one undeviated (straight through, as through a pinhole): the lens's perspective, identical to a pinhole's. Tilt the second bundle and set f on the left; highlight a center ray on the right. Together with similar triangles these two rules give all of thin-lens geometry.
Margin note: "linearization" and "no aberrations" are the same approximation

The thin lens is precisely first-order (paraxial) optics: replace $\sin\theta \approx \theta$, keeping only the linear term of the sine. Keep the next term, $\sin\theta \approx \theta - \theta^3/6$ (third-order optics), and out pop the classical Seidel aberrations: spherical aberration, coma, astigmatism, and the rest. So "the thin-lens linearization" and "a lens with no aberrations" are literally the same assumption, dropped at the same place. The OPTICS part keeps the cubic term.

The focus equation. Place an object at distance $u$ in front of the lens; its sharp image forms at distance $v$ behind, and the two are tied by the thin-lens (conjugate) equation:

$$ \frac{1}{f} = \frac{1}{u} + \frac{1}{v}. $$
fig-thin-lens
Figure 2.3.11 (reproduced). The thin-lens model and its focus equation (interactive). The two interfaces of a real lens are collapsed into one plane; small angles are assumed. An object at distance u images to an inverted picture at distance v, located by two rays: a ray parallel to the axis exits through the focal point F at distance f, and a ray through the lens center passes undeviated; their intersection is the image tip. The undeviated central ray means the thin lens shares the pinhole's perspective. Distances are in millimeters over a normal-lens focal range (35 to 70 mm); the bars underneath show 1/u + 1/v = 1/f made visual, the top bar (1/u then 1/v, end to end) always exactly as long as the 1/f bar below it, on a fixed scale set by the shortest focal length.
💡 Big lesson (L2.22) — the focus equation is symmetric: object and image are interchangeable conjugates

The thin-lens equation $\tfrac{1}{u}+\tfrac{1}{v}=\tfrac{1}{f}$ is symmetric in $u$ and $v$: swap them and it is unchanged, so object and image are interchangeable. Send the light back the other way and the rays retrace exactly the same path (the reversibility of light, made arithmetic). Two consequences fall straight out: an object at infinity images at $v=f$, which is what focal length means, and focusing a camera is nothing but moving $v$ until the chosen object's conjugate lands on the sensor.

💡 Big lesson (L2.23) — the simplest way to focus is to move the sensor: full (unit) focusing

The most basic way to focus follows straight from the equation: move the whole lens relative to the sensor, changing the lens-to-sensor distance $v$ until the chosen subject's conjugate lands on the sensor. This is full or unit focusing, the entire optical unit sliding with its focal length fixed. A bellows, the helicoid focus ring on a simple prime, and a bare enlarger lens all work this way, and it is the mental model to keep. It is only the simplest option, though. A compound lens has many elements, and moving just some of them (front-cell, internal, or rear focusing, sometimes with floating groups) can focus while extending the barrel less, holding aberrations in check across the focus range, or even nudging the effective focal length. Those techniques, and why designers reach for them, come in the OPTICS part's focus section.

Read it back: the reciprocals of the object and image distances add to the reciprocal of the focal length. An object at infinity ($1/u \to 0$) images at exactly $v = f$: that is what "focal length" means for a lens, the image distance for a far subject. As the object comes closer, $1/u$ grows, so $1/v$ must shrink: the image moves farther back. Focusing a camera is nothing more than adjusting $v$ (moving the lens, or the sensor) until the image of the subject you care about lands exactly on the sensor (Figure 2.3.12). Each object distance has exactly one image distance that focuses it (they are conjugates) and an object placed right at the focal point $F$ sends out rays that exit parallel, imaging at infinity (the reverse of the first case).

Symmetry and reversibility. Notice that the focus equation is symmetric in the two distances: writing it $1/f = 1/s_o + 1/s_i$, with $s_o$ the object distance and $s_i$ the image distance, nothing distinguishes the two: swap them and the equation is unchanged. This is no accident; it is the reversibility of light paths made arithmetic. Object and image are conjugate: send light the other way, and the rays retrace exactly the same path, so the old image plane now acts as object and the old object plane as image. The two are conjugate planes, and the magnification swaps with them: $m = -s_i/s_o$ simply inverts ($m \to 1/m$) when you exchange the roles. This object↔image reciprocity runs all through optics: it explains reversibility at exchanged conjugates, although reversing a real asymmetric lens while retaining the original object and image distances can change its aberrations, and (a case we meet in the OPTICS part) why a lens's entrance and exit pupils are themselves conjugates: images of the same aperture seen from the two sides.

fig-thin-lens-conjugates
Figure 2.3.12 (reproduced). Thin-lens conjugates. For object distance u and image distance v, 1/f = 1/u + 1/v. An object at infinity images at v = f; a far object just beyond f; a close object far behind the lens; an object at the focal point F sends rays out parallel (image at infinity). Each object distance pairs with exactly one image distance: focusing a camera moves the sensor/lens to put the chosen conjugate on the sensor. Drag the object distance past the focal length: the conjugate curve $v = f\,u/(u-f)$, tracked live by the schematic below, flips the image from real (positive v) to virtual (negative v).

The image is inverted and resized; the magnification is

$$ m = -\frac{v}{u}, $$

the ratio of image to object distance (the minus sign records the flip).

💡 Big lesson (L2.24) — magnification is the ratio of projected size to real-world size

Magnification is the size of a subject's image divided by the subject's actual size in world units (meters): $m = -v/u$ is exactly that ratio (image height over object height). Photographers quote it as a reproduction ratio: 1:1 ("life size") means the image on the sensor is as large as the subject itself; 1:2 means half life size. What fraction of the frame a subject then occupies depends on the sensor size: the same magnification fills more of a small sensor than a large one. On a full-frame ($24\times36$ mm) camera a $1{:}2$ reproduction images a subject about $48\times72$ mm to exactly fill the frame; put that same subject on a smaller sensor at the same magnification and it overflows. So magnification is a property of the optics-and-distance alone, while "how big it looks in the picture" also needs the sensor size.

Finally, the lens has an aperture (the diameter $D$ of the opening that admits light) and photographers describe it not by $D$ directly but by the f-number

$$ N = \frac{f}{D}, $$

the ratio of focal length to aperture diameter. A small f-number ($f/1.4$) is a wide opening; a large one ($f/16$) is a narrow opening: the number is under the divider, so it runs backwards from how much light gets through. The f-number controls two things at once, exposure and blur. We meet the blur in Chapter 2.5, Depth of field, next; the aperture and the f-number get a fuller treatment at the end of this chapter (why the ratio makes brightness portable, and the $\sqrt2$ stop series), and the exposure practice built on it is taken up in Chapter 5.2, Exposure and capture timing.

The same focus equation explains why macro photography is hard. Rewrite it as $1/v = 1/f - 1/u$: to focus a close subject, $u$ shrinks, so $1/u$ grows, so $1/v$ has to shrink, which means $v$, the lens-to-sensor distance, has to grow. High magnification is the same statement, since $m=-v/u$: getting to 1:1 (life size) requires $v=u=2f$, twice the infinity-focus distance, and going beyond 1:1 pushes $v$ larger still. An ordinary lens simply cannot rack its focusing helicoid out that far. The fix is to physically move the lens farther from the sensor, which is exactly what an extension tube (a hollow, glassless spacer) or a bellows (a continuously adjustable one) does (Figure 2.3.13): they add nothing optical, they just buy the large $v$ the equation demands. This is also why a lens's closest focus distance and its maximum magnification are the same spec seen two ways, and why dedicated macro lenses provide the necessary conjugate range through extension, internal optical changes, or both.

fig-extension-tube
Figure 2.3.13 (reproduced). An extension tube: spacing for close focus. A glassless spacer inserted between lens and camera body increases the lens-to-sensor distance $v$. Because $1/u+1/v=1/f$, focusing close (small $u$) demands a large $v$, and the extra $v$ raises the magnification $m=-v/u$ toward 1:1 and beyond, which is precisely why macro work needs extension tubes or bellows rather than glass alone. (Author's photograph.)

Aperture and the f-number⧉

optional

For a compound lens, $D$ denotes the entrance-pupil diameter, the image of the aperture stop seen from object space. It need not equal the physical iris diameter. The simple cone argument below assumes a thin lens focused near infinity; pupil magnification and finite conjugates modify the close-focus relation.

We met the f-number $N = f/D$ a moment ago; it gets a section of its own, because it is one of the few numbers a photographer touches every time they shoot, and because why it is written as a ratio is instructive. The aperture is a physical thing, the diameter $D$ of the opening that admits light. Yet lenses are never marked in millimeters of opening; they are marked $f/2.8$, $f/5.6$, $f/11$, the focal length divided by that diameter. The slash is literal: $f/2.8$ means "the focal length, split into 2.8," an opening $D = f/2.8$ wide. Because $D$ sits in the denominator, the scale runs backwards from intuition, a small f-number is a wide opening (lots of light, shallow depth of field) and a large f-number is a narrow one. Once you internalize that the number is a divisor, "$f/1.4$ is bright and $f/22$ is dim" stops feeling backwards.

Why quote the opening as a fraction of focal length at all, rather than its raw diameter? Because the fraction, not the diameter, is what fixes the brightness of the image. The light delivered to a point on the sensor arrives as a cone: the rays that clear the aperture and reconverge there. The wider that cone, the more light. Its half-angle $\theta$ satisfies $\tan\theta = (D/2)/f = 1/(2N)$, so the cone depends only on the ratio $N$, never on the focal length by itself (Figure 2.3.14). Double the focal length and double the diameter, and the opening is physically twice as big, yet the cone, and therefore the brightness, is unchanged, because $N$ is unchanged. This is the whole reason the ratio exists: it makes a brightness setting that transfers. Set any lens to $f/2.8$, a $24$ mm or a $600$ mm, and each throws the same irradiance onto the sensor, even though the $600$ mm's opening is enormous by comparison. A raw diameter could never do that; the ratio nets out the focal length exactly. (The transfer is only mostly exact: vignetting darkens the corners, oblique rays fall off toward the frame edge, and at close focus the effective f-number increases to $N_\text{eff} = N(1+|m|)$ for the symmetric thin-lens model, with signed magnification $m$, the "bellows factor" behind macro's light loss. The geometry above is the clean first-order truth those are corrections to.)

fig-aperture-fnumber-cones
Figure 2.3.14 (reproduced). Why the f-number is written as a ratio, read off the light cone. Left: the same f-number gives the same cone, and hence the same brightness, at any focal length. A short lens (aperture $D$ at distance $f$) and a long lens (aperture $2D$ at distance $2f$) have the identical $N = f/D = 4$, so their converging cones share the very same half-angle $\tan\theta = 1/(2N)$; the long lens's opening is physically twice as wide yet pours no more light onto the sensor point, because only the ratio matters. Right: at a fixed focal length, opening up (a smaller f-number) widens the cone. The light collected follows the opening's area, $\propto D^2 \propto 1/N^2$, so $f/2, f/4, f/8$ pass $1, \tfrac14, \tfrac1{16}$ of the light; halving the area (one stop) takes a $\sqrt2$ step in $N$, which is the whole reason the aperture series climbs $f/2, 2.8, 4, 5.6, 8, \dots$

The same cone picture explains the aperture scale's numbers, $f/1.4, f/2, f/2.8, f/4, f/5.6, f/8, f/11, f/16$, a march in steps of $\sqrt2$. Light gathered goes as the opening's area, which goes as the diameter squared, so at a fixed focal length the light scales as $D^2 \propto (f/N)^2 \propto 1/N^2$. A stop, photography's unit, is a factor of two in light. To halve the light you must halve the area, and halving an area means shrinking the diameter by $\sqrt2$, i.e. multiplying $N$ by $\sqrt2$. That is the entire origin of the series: each full stop is one $\sqrt2$ step in f-number and one factor of two in light (Figure 5.2.4; and panel B of Figure 2.3.14). It is why the numbers look irregular but are really a clean geometric progression, and why aperture, shutter, and ISO can all be counted in the same stops (the exposure triangle of Chapter 5.2, Exposure and capture timing).

💡 Big lesson (L2.25) — the f-number is the aperture diameter as a fraction of the focal length

$N = f/D$: the f-number tells you the width of the opening measured in focal lengths, not in millimeters. $f/4$ means the opening is one quarter of the focal length across. Writing the aperture this way is what makes it a portable brightness setting: because the cone of light converging on each sensor point has half-angle $\tan\theta = 1/(2N)$, the ratio alone sets the image brightness, so the same f-number gives the same exposure on any lens, whatever its focal length or physical size. The denominator is why a small number is a big opening, and the area-goes-as-diameter-squared law ($\text{light}\propto 1/N^2$) is why the stop series climbs by $\sqrt2$.

Finally, a caveat that matters when light is precious. The f-number is a purely geometric quantity: it assumes a perfect, lossless lens and predicts the light such a lens would gather. Real glass is not lossless, every air-to-glass surface reflects a little, the elements absorb a little, and a complex zoom with twenty elements can quietly swallow up to a stop before any light reaches the sensor. The T-stop (transmission stop) folds those losses in, the f-number of an ideal lossless lens passing the same light, $T = N/\sqrt{\tau}$ for transmittance $\tau$, so a lens engraved $f/2.0$ may test at $T/2.3$. For still photographs, through-the-lens metering often compensates for transmission loss, but the difference still matters when comparing photon collection; cinematographers, who must intercut shots from different lenses at a matched brightness, buy lenses marked in T-stops. The full treatment, and why it matters for metering, is in Chapter 5.2, Exposure and capture timing (f-stops versus T-stops).

Exposure and capture timing⧉

f-stops versus T-stops⧉

optional

Two lenses at f/2.8 need not transmit the same amount of light. The geometric f-number describes the entrance pupil. A T-stop includes transmission $\tau$:

$$T=\frac{N}{\sqrt{\tau}}.$$

A lens at f/2 with transmission 0.81 is approximately T/2.22. Its geometrical depth of field still depends on f/2. Through-the-lens metering can compensate for transmission loss in an automatic exposure; calibrated T-stop markings are useful when matching shots across lenses. Corner falloff and close-focus exposure changes require additional corrections, so a single T-stop is not a per-pixel radiometric calibration.

A transmission rating describes the lens under a specified measurement, but illumination can still vary across the frame. Oblique rays may see a smaller effective opening, and lens elements or the barrel can clip part of their bundle. In simple models the geometric falloff follows a cosine-fourth law; real wide-angle lens designs can depart from that model. Mechanical clipping often decreases when the aperture is stopped down.

A lens-shading correction multiplies darker corner values to make a uniform scene look more uniform. It multiplies their noise too. For example, a factor-of-two corner correction restores the mean brightness but also doubles the measured noise standard deviation at that location. It cannot replace the photons that the corner failed to collect. Exposure, vignetting correction, and visible corner noise should therefore be evaluated together.

Consider cutting between shots made with a prime and a zoom, with lighting and shutter time fixed. Equal f-numbers need not give equal recorded brightness if the two lenses transmit different fractions of the incident light. Through-the-lens automatic metering can compensate by changing another setting, but a manually controlled cinema setup needs a repeatable mark on the lens itself. T-stop calibration supplies that transmission-aware mark. The f-number remains the relevant geometric quantity for the ray cone and depth of field; matching exposure does not make two lenses optically identical.

Viewpoint, lenses, and focus⧉

Aperture and the diaphragm⧉

optional

The diaphragm changes the entrance-pupil diameter and therefore the f-number. Its widest opening admits the most light. Stopping down increases the range of acceptable focus, but eventually diffraction reduces fine contrast throughout the image. There is no universally best aperture: a landscape with an important foreground may benefit from more depth of field even when fine detail becomes slightly softer.

A variable-aperture zoom can lose its widest opening as focal length increases. Check the actual aperture after reframing. Many phone modules have a fixed aperture and obtain much of their subject isolation through estimated-depth processing. Optical defocus still exists on a phone, particularly at close range; “small sensor” does not mean everything is in focus.

The two aperture limits are named in opposite directions: maximum aperture is the widest opening and smallest f-number; minimum aperture is the narrowest opening and largest f-number. A zoom marked f/3.5–5.6 can open to f/3.5 at one end but only f/5.6 at the other. Keeping the same maximum f-number while focal length grows requires the entrance pupil to grow proportionally, which constrains the optical design.

The diaphragm blades also shape the opening. Their number and curvature affect out-of-focus highlights and diffraction spikes around bright points, as discussed in Chapter 23.1, Bokeh, focus stacking, and depth-of-field control. Clicked aperture controls help select repeatable steps; a continuously adjustable control can make an aperture change smoother during a video shot. Exposure range, defocus appearance, and control behavior are separate lens properties.

Joint demosaicking and denoising⧉

Correcting chromatic aberration jointly⧉

optional

Lateral chromatic aberration provides a concrete interaction: color channels can depict the same scene edge at different sensor positions, weakening a demosaicker's shared-edge assumption.

Start with the optics. A real lens does not bend all wavelengths equally: its glass is dispersive, so red, green, and blue focus and, more relevantly here, magnify slightly differently (the full catalog is in Chapter 22.1, Aberrations and optical challenges, and the cures in Chapter 22.2, Aberrations correction). Lateral (or transverse) chromatic aberration is the magnification version: because the three colors are imaged at very slightly different scales, a scene point away from the optical center lands at a slightly different radius in each channel. At the image center the three coincide; toward the corners they separate, radially. At a high-contrast edge near the frame edge (a dark window frame against bright sky, exactly the worst case) the red edge, the green edge, and the blue edge can land several pixels apart (Figure 15.8.3). In a simplified example each channel is sharp but displaced. Real lenses can combine lateral displacement with defocus and other aberrations.

Color-difference reconstruction uses the fact that channels often share edges. When those edges are displaced, their differences contain narrow bands of contrast. Interpolating the differences can spread or distort these bands (Figure 15.8.3). Independent-channel interpolation and explicitly aberration-aware methods make different assumptions.

Rescaling demosaicked channels can correct much of a lateral displacement, but may leave artifacts introduced during reconstruction. Including per-channel warps in the forward model lets the estimator use the raw samples at their calibrated positions. This motivates joint correction; it does not prove that every sequential correction is too late or that only a joint solver can work.

The general construction composes per-channel warps with optical blur and CFA sampling.

Biscarrat et al. Biscarrat et al. 2026 build a learned version of this idea. Once lateral chromatic aberration is described as a per-channel warp, the red and blue samples of a raw image no longer sit on the pixel grid, and their offsets grow toward the corners. Rather than resampling them onto a grid first, their network keeps each sample at its calibrated sub-pixel position and predicts, for every output pixel, a continuous reconstruction kernel evaluated at the nearby samples. The kernel adapts to local image content and noise level. The same architecture merges an aligned raw burst, where sub-pixel offsets come from hand motion instead of the lens, and it demosaicks, denoises and corrects lateral chromatic aberration from a single raw frame in one step.

fig-lateral-ca-demosaic
Figure 15.8.3 (reproduced). Why chromatic aberration must be corrected inside the reconstruction. Left: a 1-D intensity profile across a high-contrast edge near the frame edge. Lateral chromatic aberration magnifies the three colors slightly differently, so the red, green, and blue edges land several pixels apart (here a ~5-pixel red-to-blue separation) instead of on top of one another; each channel sharp, but radially shifted. Right: the misaligned channels combined directly, which is the false color a demosaicker assuming aligned channels bakes in when it interpolates the color differences $R-G$ and $B-G$ as if smooth. With red rising first, then green, then blue, the edge picks up a red fringe where only red has risen and a yellow one where red and green have risen but blue has not. The artifact is baked in during demosaicking, so a lateral-CA corrector running afterward cannot remove it; the correction belongs inside the joint solve.
💡 Big lesson

Preserve the original measurements when reconstruction stages depend on one another. A joint forward model can account for blur, color displacement and sampling together; incorrect calibration or priors can still produce a wrong result.

💡 Big lesson (do not order operations that interact)

Model the interactions between stages and compare their complete outputs. Joint estimation can avoid premature intermediate decisions, but its advantage depends on the models, data and solver.

Imagine a high-contrast vertical edge whose red image falls slightly to the right of its green image. A demosaicker that assumes co-located edges may interpret the displaced red samples as a genuine color change and interpolate accordingly. A later channel warp can align the main edges while leaving some of that interpolation error. Including the displacement in the sampling model lets the reconstruction compare samples at their appropriate locations from the start.

This motivates a joint treatment, but does not make every sequential correction invalid. A raw-domain correction or a demosaicker designed to tolerate displaced channels can also work. The concrete advantage of the joint model is that its data term knows the geometry while estimating the missing colors.

A displaced step makes the color-difference problem explicit. Let green rise from dark to bright at one column, and let red make the same transition two columns later. Between those positions, green is bright while red is still dark, so $R-G$ contains a narrow negative band even though the surfaces on either side are neutral. Interpolating this band under a smooth-color-difference assumption can spread it to neighboring pixels. Bringing the reconstructed channels into alignment afterward corrects their displacement but need not undo that interpolation error. Including the calibrated channel positions during reconstruction lets the estimator compare samples that refer to the same scene location.

Aberrations and optical challenges⧉

in the book↗

The thin lens of FUNDAMENTALS is simple: feed it a point of light and it gives you back a point. Every real lens disappoints that promise, and it does so in a number of characteristic ways. This part studies those failures: how they arise, how lens design reduces them, and how computation corrects what remains.

The organizing fact is simple. The thin lens is right only because it keeps just the first term of everything. Snell's law of refraction, $n_1\sin\theta_1 = n_2\sin\theta_2$, is non-linear, but for small angles $\sin\theta \approx \theta$ and it goes linear; that linearization is what makes a single focal length $f$ and the clean equation $1/f = 1/u + 1/v$ work. Restore the next term of the expansion,

$$ \sin\theta \;\approx\; \theta - \frac{\theta^3}{6}, $$

and the cubic correction means rays through the edge of the aperture no longer land exactly where the central rays do. Let the refractive index depend on wavelength, $n(\lambda)$, a property called dispersion, and red and blue focus in different places. Add that real glass has thickness, real lenses have many surfaces, and real barrels have mounts, dust, and air gaps, and you have the full set of challenges below. Every one of them is geometry or physics the thin lens chose to ignore; manufacturing defects such as decentering can add further errors to these nominal-design limitations.

A piece of luck: the next term is cubic, not quadratic. Because $\sin\theta$ is an odd function, its Taylor series contains only odd powers (there is no $\theta^2$ term), so the first error in $\sin\theta\approx\theta$ is the cubic $\theta^3/6$, and likewise $\tan\theta\approx\theta$ errs only at order $\theta^3$. That single fact is why paraxial optics is so much better than it has any right to be: the linear model is accurate effectively to second order, not only first, with error that stays tiny over a surprisingly wide range of angles before the cubic term becomes significant (Figure 22.1.1). The flip side is that when it does break, it breaks as $\theta^3$. Those third-order terms are exactly the five so-called Seidel aberrations that organize this chapter.

fig-small-angle
Figure 22.1.1 (reproduced). How good is the paraxial approximation? Left: the linear reference θ against sin θ and tan θ, which coincide near the origin and peel away. Right: the relative error of each linear approximation, with the angles where it passes 1% and 10%. sin θ ≈ θ holds under 1% to about 14° and under 10% to about 45°; tan θ ≈ θ is looser. The point: because sin and tan are odd, the first correction is the cubic θ³, so the error grows only as θ². Paraxial optics is accurate well past where intuition expects. Paraxial optics also linearizes cos θ ≈ 1, but cos is even, so its error is quadratic ($1-\cos\theta \approx \theta^2/2$) rather than cubic; cos barely enters the imaging equations, though, which is why it isn't one of the two curves plotted here.
fig-thin-lens-vs-real
Figure 22.1.2 (reproduced). The convenient lie and its repair bill. Left: the ideal thin lens, where every ray from the object point converges to a single sharp image point, the picture FUNDAMENTALS drew. Right: the same point through a real single element, where marginal rays cross the axis early, off-axis rays smear, colors separate, and a fan of rays lands as a fuzzy patch instead of a point. The gap between the two panels is the subject of this entire part.

You can see the breakdown directly (Figure 22.1.3): trace a fan of parallel rays through a single lens in two ways: once with exact Snell refraction at the curved surface, and once with the paraxial thin-lens model that sends every ray through one focal point. Stopped down, the two are indistinguishable; opened up, the real marginal rays bend too hard and cross the axis short of the paraxial focus, and the single focus dissolves into a smear. The longitudinal gap between the rim focus and the paraxial focus is spherical aberration measured directly (the cubic term made visible), and you can shrink it by stopping down or raising the index, exactly the levers a real lens uses.

fig-paraxial-vs-snell
Figure 22.1.3 (reproduced). One lens, traced two ways. Parallel rays through a single plano-convex element: solid rays refracted by the exact Snell's law at the curved surface, dashed rays following the paraxial (thin-lens) idealization that bends every parallel ray through the one focal point F. Near the axis they agree; the real marginal rays cross the axis short of F, and the longitudinal gap is spherical aberration, the leading cubic term the linearization dropped. Open the aperture to grow it; raise the index or stop down to shrink it.

Taxonomy of challenges⧉

in the book↗

An ideal thin lens is summarized by one power or focal length. A physical singlet already has two surface curvatures, a thickness, and a glass choice; fixing its power still leaves some freedom to bend its shape. But a photograph demands that the lens satisfy many constraints at once: bring every field point to focus, at every wavelength, across the whole aperture, onto a flat sensor, with no stray light and no geometric warp. Those limited degrees of freedom cannot generally meet all these demands, which is the deep reason a real photographic lens is a stack of six, ten, or twenty elements (the subject of Chapter 22.5, A short bestiary of classic designs). The defects sort into a few families:

A useful way to keep them straight is by what they do to the light. Most aberrations misplace energy: they take rays that should have met at a point and spread them into a blur, so they cost sharpness and you cannot perfectly undo them after the fact. Distortion is the exception: it keeps every point sharp and merely puts it in the wrong place, which is why it is the one defect that software corrects almost perfectly. Vignetting loses energy unevenly across the frame. Flare adds energy where it does not belong. We meet them in roughly that order. Throughout, the look of each defect, the spot it paints on the sensor, its point-spread function (PSF), the lens's answer to a single point of light, is summarized in the part's master figure.

fig-seidel-aberrations
Figure 22.1.4 (reproduced). The five monochromatic (Seidel) aberrations side by side, spherical, coma, astigmatism, field curvature, and distortion, each shown as a ray diagram together with the blur signature it paints on a star or a grid. The reference figure for the whole part; later chapters return to it. (Chromatic aberration, a separate family, is shown in Figure 22.1.8.)

Spherical aberration⧉

in the book↗

What it is. In a typical under-corrected positive spherical lens, rays that pass through the edge of the aperture are bent too strongly and cross the axis nearer the lens than rays through the center. There is no single focal plane: the marginal rays focus short, the paraxial rays focus long, and in between they form a waist of least confusion. This is the most direct consequence of keeping the cubic $\theta^3$ term. The sign can reverse in other prescriptions; the defining feature is the dependence of focus on pupil radius.

What it looks like. A soft, low-contrast image with a glowing halo around bright points and highlights: the sharp core sits on a luminous skirt of the mis-focused marginal rays. It is worst wide open, because that is when the aperture admits the outer rays at all, and it visibly cleans up as you stop down, which masks the offending edge of the lens. It also shows up as focus shift: the plane of best focus moves as you change aperture.

Why. The spherical surface, prized because any two pieces of glass ground against each other tend naturally toward a sphere, is simply the wrong shape for perfect focus; the correct surface is an asphere. The cure, an aspheric element or a split of optical power across several elements, is explained in Chapter 22.2, Aberrations correction. Some lenses leave it in on purpose: the dreamy soft-focus portrait look is under-corrected spherical aberration (see Chapter 22.7, Special optics).

fig-spherical-aberration
Figure 22.1.5 (reproduced). Spherical aberration. A fan of rays from an on-axis point: those through the rim of the aperture (marginal rays) cross the axis closer to the lens than those through the center (paraxial rays), so there is no single focus, only a "circle of least confusion." The resulting image of a bright point is a sharp core wrapped in a soft glowing halo, worst wide open and tightened by stopping down.
fig-aberration-explorer
Figure 22.1.6 (reproduced). A single strong lens element and a bundle of parallel rays arriving from infinity at a chosen field angle, traced exactly by Snell's law. On-axis, the marginal rays cross the axis short of the paraxial rays, so the point images as a smear, not a point (spherical aberration); with several wavelengths the differing index per color spreads the foci and paints a chromatic fringe. Tilt the beam off-axis and the spot flares into the one-sided comet of coma.

Coma⧉

in the book↗

What it is. Coma is the off-axis cousin of spherical aberration: for a point that is not on the optical axis, the rays through different zones of the aperture image it at different magnifications, so instead of a clean point they pile up into a one-sided, comet-shaped smear (the name is from coma, a comet's tail). The blur is asymmetric. It has a bright head and a flaring tail pointing radially, toward or away from the center of the frame, which is what makes it so recognisable and so ugly.

What it looks like. Stars, streetlights, and specular highlights toward the edges and corners of the frame grow little wings or tails; a field of night-sky stars that are crisp dots in the center turn into tiny comets at the margins. Like spherical aberration it is worst wide open and improves on stopping down.

Why. It is one of the five Seidel terms, an inevitable consequence of the cubic expansion for off-axis points. It belongs to the family of odd aberrations that cancel by symmetry at unit-magnification symmetric conjugates in a system symmetric about the aperture stop. At infinity focus the cancellation is not automatic, but approximate symmetry remains a useful design starting point (the double-Gauss design, discussed in Chapter 22.5, A short bestiary of classic designs), which is exactly why symmetric designs dominate fast normal lenses. Full treatment of the cure is in Chapter 22.2, Aberrations correction.

fig-coma
Figure 22.1.7 (reproduced). Comatic aberration, in 2-D. An off-axis bundle of parallel rays meets the lens; the chief ray through the center lands at the ideal image height, but rays through successive annular zones of the aperture cross the image plane at progressively different heights, piling the point up into a one-sided comet: a bright head at the ideal spot and a flaring tail pointing radially. Worst wide open; canceled by symmetry about the stop.

Astigmatism⧉

in the book↗

What it is. Off-axis refraction can give different focusing powers in the meridional and sagittal ray sections, even after coma is corrected. This is not caused simply by an elliptical-looking aperture: detail oriented radially (the sagittal direction, pointing toward the frame center) and detail oriented tangentially (perpendicular to it) come to focus at two different depths. There is no single plane where both are sharp: at one focus the radial spokes of a wheel snap in while the rim blurs, and a little farther along it reverses. An off-axis point never collapses to a dot. It stretches into a short line that swings through ninety degrees as you rack focus.

What it looks like. You cannot get radial and tangential fine detail crisp at the same field position at once: a smear that changes orientation as you refocus, worst toward the corners. Together with field curvature (next), it is why uncorrected simple lenses are mushy off-center even when the middle is sharp.

Why. The third of the five Seidel terms, again a consequence of the cubic expansion off-axis. Its cure (balancing element powers and the placement of the stop, and trading it off against field curvature on the Petzval surface) is in Chapter 22.2, Aberrations correction.

Field curvature⧉

in the book↗

What it is. Even when every point is individually in sharp focus, the surface on which those sharp points lie is not flat. It is a bowl, the Petzval surface, curving toward or away from the lens. But the sensor is flat. So if you focus to make the center crisp, the corners fall off the curved focal surface and go soft; refocus for sharp corners and the center softens.

What it looks like. Center-sharp, corner-soft (or the reverse) in a way that no single focus setting fixes it. The softness is built into the geometry, not into where you put the focus ring. It is the bane of flat subjects like document copying, brick walls, and star fields, and it is why a "flat-field" lens is a prized and specially corrected thing.

Why. The fourth Seidel aberration, governed by the Petzval sum of the elements' powers and glasses. The cure is a dedicated field-flattener element near the focal plane, treated in Chapter 22.2, Aberrations correction.

Chromatic aberration⧉

in the book↗

What it is. Glass bends blue light more than red because the refractive index falls with wavelength, a property called dispersion. So a lens has, in effect, a slightly shorter focal length for blue than for red, and the colors do not share a focus. The strength of a glass's dispersion is summarized by its Abbe number,

$$ V_d \;=\; \frac{n_d - 1}{n_F - n_C}, $$

a ratio of the mid-spectrum refraction to the spread between blue ($F$) and red ($C$) lines; a high $V_d$ means low dispersion. Chromatic aberration (CA) comes in two flavors:

What it looks like. Axial CA gives color halos around high-contrast edges, classically a green-to-magenta glow that flips sign as you rack through focus, and it is a big contributor to the purple fringing you see on backlit branches and chrome trim (part CA, part sensor blooming and flare). Lateral CA gives colored fringes that grow toward the corners: a red edge on one side of a dark line and a blue edge on the other, strongest at the frame's margins and absent at the center.

Why. Purely the wavelength dependence $n(\lambda)$; it would vanish in a single-color world. The classic cure is the achromatic doublet, a low-dispersion crown element paired with a high-dispersion flint so the color errors cancel at two wavelengths, and, for the demanding cases, apochromats with special low-dispersion glasses. Lateral CA, being a per-color magnification error, is essentially a geometric rescale and is therefore highly correctable in software; axial CA, a genuine per-color blur, is not. The full story of both cures, in glass and in code, is in Chapter 22.2, Aberrations correction.

fig-chromatic-aberration
Figure 22.1.8 (reproduced). Chromatic aberration. Axial (top): red, green, and blue rays from an on-axis point focus at different depths, so no single plane is sharp in all colors, the cause of color halos that flip sign through focus. Lateral (bottom): the colors focus in one plane but at different magnifications, so an off-axis edge splits into colored fringes that widen toward the corners. Both stem from the index varying with wavelength, $n(\lambda)$.
fig-lateral-chromatic
Figure 22.1.9 (reproduced). Lateral (transverse) chromatic aberration, in 2-D. An off-axis white bundle is brought to the sensor plane, but because magnification varies with wavelength the red, green, and blue images land at different heights, a radial red-to-blue split that is zero at the center and grows toward the corners. Being a per-channel magnification error rather than a depth error, it is essentially a geometric rescale, which is why software corrects it almost perfectly (unlike axial CA).

Wave effects and diffraction⧉

optional

What it is. Everything above treated light as rays. But light is a wave, and a wave passing through an aperture diffracts. It spreads. Even a geometrically perfect, aberration-free lens cannot focus a point to a point; the best it can do is a small bright disc ringed by faint haloes, the Airy pattern, whose angular scale is set by the wavelength $\lambda$ and the aperture diameter $D$:

$$ \theta_{\mathrm{first\ dark}} \;\approx\; 1.22\frac{\lambda}{D}. $$

This is a floor, not a defect of any particular lens. It is the diffraction limit. A bigger aperture (larger $D$) diffracts less; a smaller one diffracts more.

The pattern is the aperture's Fourier transform. More precisely, the diffraction pattern a point source makes is the Fourier transform of the aperture (its squared magnitude, to be precise; this is the point-spread function of a diffraction-limited lens). A round hole transforms into the Airy disc and its concentric rings; and because a wider function has a narrower transform, a bigger aperture makes a smaller spot, which is exactly the $\theta \approx \lambda/D$ limit, now read as a statement about Fourier transforms. The same fact explains sunstars, the radiating spikes around a bright streetlight or the sun in a stopped-down frame: they are the Fourier transform of the polygonal opening the diaphragm blades form, each straight blade-edge throwing a perpendicular streak of light, so an iris of $n$ blades makes a star with $n$ points when $n$ is even and $2n$ when $n$ is odd. This is the same Fourier transform that runs through Chapter 6.3, Linearity, Fourier, aliasing and deblurring. There it diagonalizes blur; here the lens computes one optically, in the time it takes light to cross the aperture.

What it looks like. Counterintuitively, stopping down, which cures the geometric aberrations above, eventually softens the whole image again, because the shrinking aperture raises the diffraction floor. Many lenses have a sharpness optimum below maximum aperture, with the location depending on field position, focus, wavelength, and the chosen metric, where the aberrations have mostly faded but diffraction has not yet taken over; close down further (a high f-number) and the picture goes uniformly mushy. Diffraction also caps the finest detail a sensor of given pixel size can usefully resolve.

Why. It comes from the wave nature of light, not a flaw in the glass, so it is a limit rather than a correctable defect. It connects forward to the part's recurring theme: because the smallest blur a lens can make is the diffraction spot, the PSF is never a true point, and engineering or inverting that PSF, by deconvolution, by coded apertures and wavefront coding, is the computational side of the story (forward-referenced to Chapter 22.2, Aberrations correction and the Advanced part). The full optics of the Airy pattern and the resolution limit belong to the Fourier-optics treatment cited below; here we only flag that the floor exists.

Flare and coating⧉

optional

What it is. Aberrations are wanted rays landing in the wrong place; flare is unwanted light reaching the sensor at all. At every air–glass surface a few percent of the light reflects instead of transmitting: about 4% per uncoated surface, from the Fresnel reflectance $R = \big((n_1-n_2)/(n_1+n_2)\big)^2$. In a lens with a dozen surfaces those stray reflections bounce around and arrive as junk light. A ray that reflects twice can refocus into a discrete, often aperture-shaped bright blob, called a ghost, typically strung along a line from a strong light source through the frame center. Many faint scatters and reflections sum into veiling glare, a low-frequency wash that lifts the blacks and crushes contrast.

What it looks like. Shooting into the sun or with a bright source just outside the frame: a chain of colored polygonal ghosts marching across the picture, streaks and stars, and an overall milky loss of contrast in the shadows. The more elements a lens has, the worse it would be. $N$ surfaces give $O(N^2)$ pairs of surfaces that can inter-reflect, one cost of the many-element designs the rest of the part relies on.

Why. Fresnel reflection at each interface. The thing that made many-element lenses practical is the anti-reflection coating: a thin transparent film with quarter-wave optical thickness at a design wavelength, $n_{\mathrm{film}}t=\lambda_0/4$ at normal incidence, whose two surface reflections interfere destructively and nearly cancel the reflection over a band, the faint colored sheen on a modern lens. Coatings drop per-surface reflection from ~4% toward a few tenths of a percent. The numbers compound. Through twelve uncoated surfaces the image keeps $0.96^{12}\approx 61\%$ of the light; at 0.5% per surface it keeps $0.995^{12}\approx 94\%$. A ghost needs two reflections, so its strength goes as the square of the reflectance: $0.04^2=1.6\times10^{-3}$ of the source uncoated against $0.005^2=2.5\times10^{-5}$ coated, 64 times weaker for each pair of surfaces. Alongside coatings, lens hoods and internal baffles keep stray off-axis light from entering in the first place. This chapter only names flare as one of the optical challenges; the physics of thin-film coatings, hoods, baffles, and computational deflare is the subject of Chapter 22.10, Glare suppression.

fig-lens-flare-ghosting
Figure 22.1.13 (reproduced). Flare and ghosting. A bright source sends most of its light to the sharp image, but at each air–glass surface ~4% reflects (Fresnel). A ray that reflects twice refocuses as a ghost, a discrete, aperture-shaped blob usually strung along the line from the source through the frame center, while countless weak scatters sum into a contrast-killing veiling glare. Anti-reflection coatings cut the per-surface reflection toward a few tenths of a percent; the cures are detailed in Chapter 22.10, Glare suppression.

You can watch the ghosts form by tracing a single ray through a real lens (Figure 22.1.14).

fig-lens-flare
Figure 22.1.14 (reproduced). Flare, traced (interactive). A full recursive ray trace of the Cooke triplet from the optics ray-tracer: at every air–glass surface the ray both refracts (transmits) and reflects (Fresnel, ~4% uncoated, angle-dependent), and every branch is followed until it leaves the lens or falls below a brightness floor. Set where the ray meets the first element and its direction; the sensor at right marks every place light lands. The bright spot is the real image (the all-refraction path); the orange spots are ghosts from even numbers of internal reflections, strung along the axis toward the source. Raise the reflection limit to see higher-order ghosts, and toggle an anti-reflection coating (0.3% per surface) to watch them nearly vanish, the whole point of coating a lens. Interactive: aim one ray into the triplet and follow its reflected and refracted branches to every landing point on the sensor, with and without an AR coating.

Seen quantitatively, the coating's quarter-wave trick is the same thin-film interference that colors a soap bubble (Chapter 2.1, Light and optics, Figure 2.1.33), now turned to the opposite use: instead of reinforcing a color it is tuned to cancel the reflection. Two interactive views make the mechanism concrete. The first plots the reflectance of bare, single-coated, and double-coated glass across the whole visible band and across the angle of incidence at once (Figure 22.1.15): a single quarter-wave film of magnesium fluoride cuts the ~4% bare-glass reflection to about 1% near its design wavelength, and a matched double layer (a low index over a higher one) drives it almost to zero across a band, while both climb back toward grazing incidence. The second rebuilds the soap-bubble wave picture as a coating on glass (Figure 22.1.16): five waves strike the surface and each reflected wave shrinks as you set the film thicknesses, nearly vanishing where the film's two surface reflections cancel, with the color of the leftover reflection shown as a swatch, the faint sheen of a coated lens.

fig-coating-reflectance
Figure 22.1.15 (reproduced). Anti-reflection coatings, over wavelength and angle, interactive. Bare crown glass reflects about 4% per face; a single quarter-wave film (magnesium fluoride, $n = 1.38$) makes its two surface reflections interfere destructively and cuts that to ~1% near the design wavelength; a matched double layer (low index over high) cancels it almost completely across the visible band. Choose the coating and drive the angle and wavelength. An animated wave picture shows, for three wavelengths at once, each interface's individual reflection (faint) merging into their interference sum (bold), adding up for bare glass, largely canceling for a single coating, and nearly vanishing for the matched double coating, and three plots give the exact thin-film reflectance (characteristic-matrix method, unpolarized): versus wavelength at the chosen angle, versus angle at the chosen wavelength (reflection always climbs toward grazing), and a 2-D map over both with a crosshair at the current setting. Interactive: pick no / single / double coating and sweep angle and wavelength; read the reflectance as a wave amplitude, as curves versus wavelength and versus angle, and as a 2-D map over both.
fig-coating-thin-film
Figure 22.1.16 (reproduced). An anti-reflection coating, wave by wave, interactive. The thin-film picture of the soap bubble, rebuilt as a coating on glass ($n_s = 1.52$). Five waves across the visible band strike the surface at the chosen angle; each reflected wave is shorter than its incident one by the reflectance. Bare glass reflects ~4% at every wave; add a single quarter-wave film or a matched double layer and set the two thicknesses, and the reflected waves shrink toward nothing where the film's surface reflections cancel. Each reflected amplitude is $\\sqrt{R(\\lambda)}$ from the exact characteristic-matrix result; a plot gives the reflected light across the whole band (with bare glass as a dashed reference), and a swatch shows the color of the leftover reflection. Interactive: choose no / single / double coating, set the outer and inner film thicknesses, and watch five reflected waves shrink while the reflected-light-per-wavelength plot dips, reaching near zero for a matched double layer.

Modern lenses push past the quarter-wave film, which has two limits: its ideal single-layer index is $\sqrt{n_\text{glass}}\approx 1.23$, below the index of most conventional dense coating materials, and a fixed film cancels only near one wavelength and one angle, so reflections return at the steep angles where ghosts are worst. Two families of nano-coating get around both. The first builds a film riddled with nanometer voids or hollow silica spheres, so its effective index is a blend of glass and air, low enough (around 1.1) to be the matching layer no bulk material provides: Nikon's Nano Crystal Coat uses gaps between nanoparticles, and Canon's Air Sphere Coating incorporates air in a silica-based film. Sony's Nano AR is another nanostructured anti-reflection technology; the trade names do not imply identical material or fabrication recipes. The second gives up the flat interface: a dense array of subwavelength wedges or cones a few hundred nanometers tall makes the index climb gradually from air to glass, so there is almost no boundary to reflect from, over a wide band and a wide range of angles. This is the moth-eye structure of Canon's SWC, copied from the moth's cornea, with performance depending on wavelength, angle, and the particular surface design. Both are subwavelength structures, which they share with metalenses and metasurfaces, but they only grade or interfere the index and impose no engineered phase profile: they are effective-medium anti-reflection, not the wavefront-shaping of metaoptics. Making them is the hard part: fabrication routes include grown nanostructures, nanoimprinting, and nanoparticle or porous films. Their uniformity and durability on curved optics are part of the design problem; these are families of processes, not a single recipe shared by all brands. Their details, and computational deflare, are in Chapter 22.10, Glare suppression.


With the bestiary in hand, the rest of the part divides cleanly. The defects you have just met are met in turn by more glass (the compound designs of Chapter 22.5, A short bestiary of classic designs, each element added to cancel a specific term) found by the optimization of Chapter 22.4, Lens optimization, and finally by computation, which calibrates and corrects whatever the glass leaves behind. The analytic heart, where each aberration's cause and cure is developed in full (the Seidel sum, the achromat condition, lens-profile correction, and deconvolution by the measured PSF), is Chapter 22.2, Aberrations correction. Keep this catalog beside it: it is the list of diseases that the rest of the part exists to treat.

Aberrations correction⧉

in the book↗

Every aberration in Chapter 22.1, Aberrations and optical challenges, including spherical aberration, coma, astigmatism, field curvature, distortion, and axial and lateral chromatic aberration, can be reduced, and the cures fall into two complementary families. You can fight the defect in the glass, by shaping and combining elements, choosing glasses, and stopping down; or you can let the optics get only close and finish the job in software, by remapping, rescaling, and deconvolving in the image-signal processor. This chapter takes the two families in turn. It develops the part's main tradeoffs, partly in optics and partly in computation.

The two families of cure⧉

optional

The descriptions are settled; what is left is the engineering. A useful way to organize it is by what the defect did to the light, because that decides which family of cure can reach it. Distortion and lateral chromatic aberration primarily misregister image positions, while vignetting attenuates the signal. Warping and gain correction can compensate these effects, at the cost of resampling and amplified corner noise, and increasingly the optics is designed expecting that. Blur defects, including spherical aberration, coma, astigmatism, and axial chromatic aberration, genuinely spread a point into a blob, which is much harder to undo after the fact; they are fought first in glass (the right surface shapes, the right glass pairings, a smaller aperture) and only what the glass leaves behind is handed to a calibrated deconvolution. So the chapter goes glass first, then computation, and within each, the cures are organized by the defect they target, because in a real lens, each element, surface, and glass choice usually influences several aberrations at once.

Correction in glass⧉

optional

The first line of defense is the optics itself, and the strategy is always the same: add free parameters until you have enough to cancel the aberration you care about. In practice that means a well-corrected photographic lens is usually a compound system: a column of several curved elements in groups, and cutting one open shows the machinery directly (Figure 22.2.1). Four classic moves cover almost all of it.

fig-compound-lens-cutaway
Figure 22.2.1 (reproduced). Inside a compound lens. A sectioned Canon lens reveals what "correction in glass" actually looks like: not a single element but a stack of several curved elements, grouped and spaced, with the diaphragm among them. No one surface can bring every ray, color, and field angle to a common focus, so the job is split across elements of different shapes and glasses whose aberrations partly cancel (crown and flint for color, opposing curvatures for spherical and field), while the barrel moves groups to focus and zoom.

The headline move for color is the achromat, the cemented crown-plus-flint doublet that is the minimum system able to correct chromatic aberration. The idea is to make the dispersion of two elements cancel while their focusing power adds. Pair a positive (converging) element of low-dispersion crown glass with a negative (diverging) element of high-dispersion flint glass. The crown does most of the focusing; the flint, being weaker in power but stronger in dispersion, undoes the crown's color spreading without undoing all of its focusing. Quantitatively, if the two thin elements have powers $\phi_1, \phi_2$ (power $=1/f$) and Abbe numbers $V_1, V_2$ (the dispersion measure $V_d=(n_d-1)/(n_F-n_C)$ defined in Chapter 22.1, Aberrations and optical challenges), the primary longitudinal color between the selected wavelengths cancels, in the thin-element contact approximation, when

$$\frac{\phi_1}{V_1} + \frac{\phi_2}{V_2} = 0,$$

the achromat condition: the powers, each weighted by the glass's dispersion (divided by its Abbe number), sum to zero. Since $V_1, V_2 > 0$, the two powers must have opposite sign: one converging and one diverging, which gives the familiar positive-crown/negative-flint positive achromat when $V_1>V_2$. Negative achromats, air-spaced pairs, and other glass combinations also exist. Solving the condition jointly with the requirement that the total power $\phi_1 + \phi_2$ hit the desired focal length pins down both elements. An achromat makes two wavelengths (say blue $F$ and red $C$) share a focus exactly, with the in-between green error (the residual secondary spectrum) reduced to a tiny fraction of the original. As a bonus, the extra surfaces let the designer also tame the doublet's spherical aberration, which is why the achromatic doublet is the workhorse front element of so many lenses.

fig-achromat-doublet
Figure 22.2.2 (reproduced). The achromatic doublet: crown plus flint. Cross-section of a cemented doublet: a thick positive crown element (low dispersion, high $V_d$) bonded to a thinner negative flint element (high dispersion, low $V_d$). Top: a single element alone, with blue focusing short and red focusing long (axial CA). Bottom: the doublet, in which the flint's strong, opposite-sign dispersion bends blue and red back to a common focus, while the net power still converges the light to the design focal length. A callout gives the achromat condition $\phi_1/V_1 + \phi_2/V_2 = 0$ (powers weighted by dispersion cancel) and notes the small residual secondary spectrum (green slightly off).

When two wavelengths are not enough, as in long telephotos and astrophotography where the residual secondary spectrum is visible as a faint color halo on highlights, the apochromat (or superachromat) corrects three or more wavelengths at once. This needs glasses with unusually favorable dispersion curves: extra-low-dispersion (ED) glass, special-dispersion "fluorite-equivalent" glasses, or actual fluorite (calcium fluoride) crystal, which has both very low dispersion and an anomalous dispersion curve that lets the designer flatten the color error across the whole visible band. ED elements are why a modern super-telephoto can render a backlit bird's feather edges without a magenta-and-green seam; they can be expensive; white barrels on some telephotos address solar heating rather than identifying the glass type, which is precisely the kind of cost that motivates handing the residual to software instead.

A wholly different way to bend color the right direction is diffraction rather than refraction. A diffractive (kinoform) surface, a fine concentric microstructure etched into one face, focuses by interference, and its power is linear in wavelength, the opposite sign of glass and far stronger: its effective Abbe number is about $-3.45$, against $+30$ to $+85$ for glass. So a tiny diffractive correction etched onto an ordinary singlet cancels that singlet's color with one element instead of a cemented pair. This is the principle behind Canon's DO (diffractive optics) and Nikon's PF (phase Fresnel) telephotos, which are dramatically shorter and lighter than the equivalent all-glass apochromat. The interactive figure below traces real rays through all three cures so you can watch the focus spread collapse.

fig-chromatic-correction
Figure 22.2.3 (reproduced). Curing chromatic aberration, three ways. An interactive 2-D ray trace at many wavelengths through a single lens (every color focuses at a different distance, blue short, red long), an achromatic doublet (a low-dispersion crown cemented to an opposite-power high-dispersion flint pulls blue and red back to one focus, shrinking the spread by an order of magnitude), and a hybrid refractive+diffractive lens (a diffractive surface, Abbe number $-3.45$, cancels the singlet's color with one element). Switch between a fan of rays at one wavelength (slide it and watch the focus crawl along the axis) and one ray fanned into the whole spectrum; the right-hand plot is the focus shift versus wavelength, monotonic for the singlet, nearly flat once corrected. (The dispersion model is a two-term fit to each glass's Abbe number, so it shows the primary correction rather than the residual secondary spectrum that distinguishes a true apochromat.)

The headline move for spherical aberration is the aspheric element. As described in Chapter 22.1, Aberrations and optical challenges, a spherical surface focuses its edge rays short; an aspheric surface, whose profile departs from a sphere by a designed polynomial, gives the designer an extra knob to kill spherical aberration (and to flatten the field) with far fewer elements than the alternative of splitting power across many spherical surfaces. This is the enabling technology of compact fast primes and especially of cell-phone cameras, whose tiny stacks of five-to-eight molded elements would be impossible with spheres alone. There is a manufacturing sidebar worth keeping: spherical surfaces are easy to make precisely because any two surfaces ground together with abrasive between them naturally wear toward a sphere: geometry hands you the sphere for free. Aspheres lack this convenient spherical generating process. They can be ground and polished, diamond-turned where the material permits, or precision-molded by pressing glass or plastic against a figured die. That is exactly why cheap molded plastic and glass aspheres were the breakthrough that gave phone cameras their optical edge: the surface that is hardest to grind is easy to mold in volume.

fig-aspheric-elements
Figure 22.2.4 (reproduced). One aspheric surface versus a stack of spheres. An interactive 2-D finite-ray trace of an on-axis collimated beam through the book's three running designs (a single element, a cemented doublet, a Cooke triplet), where every curved interface can morph from a sphere to an asphere. All-spherical, the edge rays focus short of the paraxial focus and the fan smears into a caustic (spherical aberration); dragging asphericity up bends each profile away from a sphere by its designed conic and folds the marginal rays back onto the axis, collapsing the RMS spot by roughly an order of magnitude with no extra glass. A second slider stops the aperture down, showing the blunt alternative from the same section: discarding the outer rays shrinks the aberration even with plain spheres. The right panel magnifies the focus so the blur cone visibly tightens to a point.

Finally, the fix that costs nothing and adds no glass: stopping down. Most of the aberrations that matter, including spherical aberration, coma, and the optical part of vignetting, scale with how far out in the aperture the offending rays travel, so closing the iris to use only the well-behaved central zone reduces their contribution together. Primary lateral color and distortion do not generally disappear on stopping down. This is why nearly every lens is sharpest a couple of stops down from wide open rather than at its maximum aperture. The catch, from FUNDAMENTALS, is that you cannot keep stopping down forever: at small apertures diffraction takes over and softens everything, so there is a sweet spot, often below full aperture but dependent on the lens, field point, and metric, where the aberrations have shrunk but diffraction has not yet bitten. Beyond it, closing further trades aberration blur for diffraction blur and the image gets worse. Stopping down is the photographer's blunt instrument; the precise fixes live in the glass, and what neither the glass nor the iris can reach economically is handed to computation.

Computational correction⧉

in the book↗

Everything above fights the aberration in the optics. The computational-photography move is to let the optics get the image only close and finish the job in the image-signal processor (ISP), shifting the design's operating point on the cost-versus-quality front (cross-ref Chapter 22.4, Lens optimization). Two tools do the bulk of it, and they map cleanly onto the two kinds of aberration: geometric (a sharp image in the wrong place) versus blur (light spread out of place).

The first tool is lens-profile correction, and it handles all three of these profile-correctable effects. For each lens, and for each combination of focal length, aperture, and focus distance, the manufacturer or a community database measures a profile: a table of how that lens distorts, vignettes, and color-fringes. Then the ISP simply plays the profile in reverse on every frame. Geometric distortion is undone by a radial warp, resampling each pixel along a corrective function of its distance from center, $r' = r\,(1 + k_1 r^2 + k_2 r^4 + \cdots)$. The direction of this map must be specified: a forward Brown–Conrady polynomial maps undistorted coordinates to distorted source coordinates, which is exactly what output-to-input resampling needs. Its mathematical inverse is not generally another polynomial with negated coefficients. Resampling restores geometry but can change sharpness, crop the image, and stretch corner samples. Vignetting is undone by a radial gain map, brightening the corners back to the center's level. The same map corrects both the lens's optical vignetting and the FUNDAMENTALS $\cos^4$ falloff in one pass (cross-ref the natural-illumination falloff there). Lateral CA is undone by rescaling each color channel radially about the center by the tiny per-channel factor the profile records, collapsing the red-to-blue fringe back to a single edge. All three are widely used, particularly in camera-generated images, though raw converters and lens combinations differ in which profiles they apply. Phone lenses in particular are designed expecting this correction, deliberately leaving in heavy barrel distortion (it lets the optics be smaller and faster) on the understanding that software will straighten it. This is routine optics-plus-computation.

fig-lens-profile-correction
Figure 22.2.5 (reproduced). Lens-profile correction in the ISP. A pipeline diagram. Left, the raw frame off the sensor: barrel-distorted, dark in the corners (vignetting), with colored fringes toward the edges (lateral CA). A measured lens profile, indexed by lens, focal length, and aperture, supplies three correction maps: a radial geometric warp (undo distortion), a radial gain map (undo vignetting, including the $\cos^4$ falloff), and a per-channel radial rescale (undo lateral CA). Right, the corrected output: straight lines, even brightness, clean edges. A note flags that this fixes only the geometric defects (distortion, vignetting, lateral color) and not the blur-type ones.

The second tool reaches the blur-type defects, and it is where this chapter rejoins the deblurring machinery from the single-image part. An aberrated lens does not just displace points. For spherical aberration, coma, astigmatism, and axial CA, it genuinely spreads each point into a small blob, the lens's point-spread function (PSF). The forward model is the one convolution we keep returning to: within a small region with approximately constant PSF, the recorded image is the ideal scene convolved with that PSF, plus noise,

$$y=x*k+n.$$

Here $x$ is the ideal image, $k$ the local PSF, $n$ the noise, and $y$ the observation. Across the full frame, use a space-varying operator $y(p)=\sum_q k(p,q)x(q)+n(p)$ rather than one convolution.

If we know the PSF, we can try to invert that convolution, by deconvolution, and recover the sharp scene. And for a known lens we can know the PSF, by measuring it (shoot a point source or a calibration target through the lens). This difference from blind motion deblurring matters: here the kernel is calibrated, not guessed, so the inversion is a non-blind deconvolution, the easier problem. It uses exactly the regularized-inverse toolbox from Chapter 6.3, Linearity, Fourier, aliasing and deblurring, the Wiener filter prototype

$$\hat X = \frac{\overline{K}\,Y}{|K|^2 + \mathrm{SNR}^{-1}},$$

where $X,Y,K$ are Fourier transforms and $\mathrm{SNR}^{-1}=S_n/S_x$ is the ratio of noise and signal power spectra at that frequency. This is not the local amplitude SNR used in the noise chapter. The filter at each frequency divides the blur back out where there is signal worth recovering and suppresses frequencies where the lens left too little signal relative to noise. The one twist particular to lenses is that the PSF is spatially varying (it is tight in the center and grows comatic and stretched toward the corners), so the deconvolution must use a different kernel per region of the frame, a calibrated map of PSFs rather than one global blur. Kee et al. Kee, Paris et al. 2011 (spatially-varying optical blur) do exactly this end to end: calibrate a lens's spatially-varying PSF across the field (and across zoom/aperture) and remove the resulting optical blur by per-region non-blind deconvolution.

fig-psf-deconvolution
Figure 22.2.6 (reproduced). Deconvolution by the measured PSF. Top, the measured PSF of a lens at one field position: a small asymmetric blob (comatic toward the corner), captured by imaging a point source. Middle, the recorded image: scene $*$ PSF, softened by that blur. Bottom, the result of non-blind deconvolution by the known kernel (a Wiener / regularized inverse), with detail restored. An inset shows the same correction applied with different PSFs at center vs. corner (the spatially-varying case), and a second inset shows the failure mode: where the PSF's spectrum dipped to zero, the inversion only amplifies noise, recovering nothing.

The limits are the same as in any deblurring problem. Deconvolution amplifies noise at exactly the frequencies the lens attenuated most, its modulation transfer function (MTF) dips toward zero there, so it can sharpen what was merely attenuated but cannot recover what was destroyed: information the optics drove below the noise floor is gone, and pushing the inverse harder there only manufactures grain and ringing. The spatial variation adds bookkeeping (a grid of kernels, blended across the frame). And axial CA, being a differently-defocused-per-color blur, is partially correctable this way but never as cleanly as lateral CA's one-line warp.

All of this fights the blur the lens accidentally made. A forward-looking extension of this chapter, and a bridge to the Advanced part, is to engineer the PSF rather than just correct it: design the lens (or a coded aperture, or a phase mask) so that its blur is deliberately chosen to invert cleanly, with better-conditioned transfer over the intended recovery band, and even to encode depth in its shape. That is wavefront coding and coded-aperture imaging (Dowski and Cathey, 1995), and the end-to-end / differentiable-optics idea of optimizing the lens and the reconstruction algorithm together, which this part has been building toward. In that view, aberrations become signals to be designed.

Lens optimization⧉

Tradeoffs: the design is always a compromise⧉

optional

If the merit function could be driven to zero, lens design would be a solved, dull problem. It cannot, and the reason is that the design lives under hard constraints while several desirable axes pull against each other. A lens cannot maximize sharpness, speed, compactness, and low cost at the same time. The clear-eyed picture of a lens is a point on a Pareto front, a surface where improving any one quality necessarily worsens some other (Figure 22.4.5).

The axes that fight:

This is where computation helps. If the optics is allowed to be merely good enough and cheap rather than perfect, software can finish the job: the lens-profile correction and deconvolution of the Aberrations chapter undo residual distortion, vignetting, and even some blur after the fact. The effect is to shift the operating point along the Pareto front by accepting an optical design that is a little softer or a little more distorted, when the residual remains within the reconstruction pipeline's capabilities, and spend the savings on size, speed, or cost. Lens and algorithm split the work.

fig-lens-design-tradeoff
Figure 22.4.5 (reproduced). The lens-design Pareto cartoon. The competing qualities, speed (low f-number), small size/weight, low cost, and high sharpness, are drawn as axes pulling against one another. No design reaches the ideal corner where all are maximized; every real lens is a point on the trade-off surface, where buying more of one quality spends another (a faster lens grows larger and pricier; a cheaper lens softens). Computational correction shifts the chosen operating point: let the optics be cheaper or smaller, and recover sharpness or geometry in software afterward.

The end-to-end turn. A stronger version of this idea, and the one the Advanced part develops in full, is to stop optimizing the optics in isolation at all. Classical lens design minimizes a merit function defined on the optics (spot size, wavefront error) as if a sharp geometric image were the final product. But it is not: the sensor and a reconstruction algorithm come after the glass, and what we actually care about is the quality of the final picture. So make the whole pipeline, including the lens, sensor, and reconstruction network, differentiable end to end, and optimize the merit of the output image, with the optical parameters and the algorithm's parameters trained jointly. When you do this, the optimizer is free to discover lenses that look "wrong" by classical optical metrics (a deliberately blurred or coded PSF, a design no hand-calculator would ever have drawn) because that PSF, paired with its matched reconstruction, yields a better final image than a classically sharp lens would. This is the same optimization machinery once more, now with the loss moved all the way to the end of the pipeline and the lens treated as just another layer of learnable parameters. Coded apertures, wavefront coding, and differentiable optics in the Advanced part are this idea carried to its conclusion, the ultimate expression of optics and computation as two ends of one design space.

Tolerancing: from the nominal design to a manufacturable one⧉

optional

Everything so far has quietly assumed a perfect world. The optimizer hands back a prescription (a table of radii, thicknesses, glasses, and air gaps) and the spot diagrams that go with it are computed as if every one of those numbers were realized exactly, every surface ground to its ideal sphere, every element seated dead-center on the axis. Call that the nominal design. The trouble is that no shop builds the nominal design. A radius comes off the grinder a fraction of a percent off target; the glass in this particular melt has an index a few parts in ten thousand from the catalog value; an element sits a few microns decentered in its barrel and a hair tilted. A design that is paper-sharp at the nominal can be junk on the bench. Tolerancing is the discipline that closes this gap: it budgets the inevitable errors, predicts how the lens will actually perform once those errors are baked in, and (this is the part that surprises people new to the field) it is very often what really sets the cost and the element count, far more than the nominal design ever did. Two lenses can have nearly identical nominal performance and differ tenfold in price because their manufacturing tolerances, materials, assembly, and quality-control requirements differ.

The error sources. It helps to enumerate what actually goes wrong, because each entry is a parameter the optimizer treated as exact and the factory cannot. Surface by surface, the radius of curvature comes out slightly wrong (the tool wears, the polish runs long); each thickness and air-gap spacing lands within some machining and assembly tolerance; the glass index and dispersion vary not just by manufacturing slop but melt to melt: the same catalog glass type, poured in different batches, differs measurably, which is why precision lenses are sometimes recomputed for the measured index of the actual melt. On top of those per-number errors are the shape and placement errors the prescription does not even list: wedge (the two faces of an element not quite parallel/coaxial, so it acts like a weak prism), surface irregularity (the polished surface departing from a perfect sphere: bumps and astigmatic figure the test interferogram catches), and, at assembly, the decenter and tilt of each element, and its roll when the element is not rotationally symmetric. The decenters and tilts are usually the most damaging because they break the rotational symmetry the design relied on: a perfectly centered system has no on-axis coma, but a decentered one does.

Sensitivity analysis versus Monte Carlo. With a list of error sources and a guess at how big each can be, there are two complementary questions to ask, and the software answers both. The first is sensitivity analysis: perturb one tolerance at a time, re-evaluate the merit function (or the MTF), and see how much the performance moves. This ranks the tolerances. It tells you which of the many parameters drive cost most strongly, the ones whose tight tolerance you are really paying for, and which can be sloppy with no consequence. The second question is statistical: given the whole distribution of errors at once, what does the population of as-built lenses actually look like? That is answered by Monte Carlo analysis, which draws many random lenses, each with every parameter perturbed by a random draw from its tolerance distribution, evaluates each, and builds up the distribution of as-built performance. From that distribution you read the yield: the fraction of production lenses that will clear the acceptance threshold (Figure 22.4.6). Sensitivity analysis tells you where to spend your tolerance budget; Monte Carlo tells you what you will actually ship and at what scrap rate. The two together are how a design that looks fine on paper is judged buildable or not.

Compensators. The lever that makes tight tolerances affordable is the compensator: a small number of adjustments deliberately left free, to be set per unit at assembly, that absorb the accumulated error. The most common is simply refocus: many cameras can refocus, so the nominal back-focal distance need not be held perfectly; the factory (or the autofocus) takes up the slack. Beyond that, a designer may leave one air-space adjustable, to be shimmed to its best value while the lens is on the test bench, or leave one element's centering free to be shimmed or actively aligned until the on-axis image is clean. Because a compensator can claw back the performance that the random errors threw away, some other tolerances can be loosened, according to the modes of error the compensator actually corrects. Loosening tolerances is exactly how a lens gets cheaper. Tolerancing is therefore not just a pass/fail check at the end; it feeds back into the design, sometimes pushing the designer to add an element or rearrange the form specifically to make the lens tolerant, even at a small cost in nominal performance. The nominal design, the one optimized in the previous sections, is often the easier part. Obtaining good nominal spot diagrams is only part of the problem; what decides whether a lens is cheap, feasible, and shippable is its as-built performance and its yield. And this loops straight back to the theme of the chapter. One way to survive loose tolerances is to budget them generously and then lean on computational correction to recover the residual, the lens-profile correction and PSF deconvolution of the Aberrations chapter clawing back the distortion, vignetting, and softness that loosened tolerances let through. A lens that the pipeline is going to sharpen and de-distort anyway need not hold its corners to interferometric perfection on the production line. This is the same bargain as the Pareto shift above, now stated in the language of the factory: loosen the optics, lean on computation, and the cost falls. It is one more reason the pairing of cheap optics with computation keeps winning.

fig-tolerance-budget
Figure 22.4.6 (reproduced). From nominal to as-built. Left: a sensitivity-analysis bar chart, performance (MTF at a chosen frequency, or RMS spot) plotted as each tolerance is perturbed one at a time, ranking which errors (a particular surface's radius, an element's decenter or tilt, a melt-to-melt index shift) drive the loss and which are harmless. Right: a Monte-Carlo histogram of as-built performance, with the nominal design marked as a single sharp value, and around it the broad spread produced by drawing many random lenses with all tolerances perturbed at once, with an acceptance threshold drawn in so the shaded tail below it reads directly as the manufacturing yield. Adding a compensator (refocus, an adjustable air-space) narrows the spread and pushes more of the population above the line. (Deferred: to be generated.)

A short bestiary of classic designs⧉

The lens as a system: cardinal points, pupils, f-number, T-stop⧉

optional

In most calculations, you almost never need to think about the individual elements. In first-order paraxial optics, a centered compound system behaves, for the purpose of locating conjugate planes, like an equivalent lens, provided you measure distances from the right reference planes and the aperture at the right opening. Those reference planes and openings are the system's cardinal points and pupils, and they are what a lens's published specifications (focal length, f-number, angle of view) actually refer to.

Principal planes and the thick-lens equation. A thin lens has one obvious plane to measure from: the lens itself. A thick, multi-element system has no single such plane, but it has two effective ones, the front and rear principal planes, written $H$ and $H'$. They are the planes from which object and image distances must be measured for the familiar equation to hold: with $u$ measured from $H$ and $v$ measured from $H'$,

$$ \frac{1}{f} = \frac{1}{u} + \frac{1}{v} $$

holds for a system with the same surrounding medium on both sides and the usual real-conjugate distance convention, with $f$ the system's effective focal length. The whole black box then acts like a single thin lens placed at $H$ for the object side and at $H'$ for the image side. The two planes need not lie inside the glass at all, and indeed, as we just saw, the telephoto and retrofocus designs are precisely tricks for moving $H'$ to where it is wanted. This is also why the effective focal length (measured from $H'$) and the back focal length (measured from the last glass surface to the sensor) are different numbers: the telephoto's effective focal length is large while its back focal length is small, and the retrofocus is the reverse. (Figure 22.5.6)

Nodal points. A second pair of cardinal points, the nodal points, are defined by a different property: a ray aimed at the front nodal point leaves the rear nodal point traveling parallel to its original direction: it crosses the axis undeviated in angle. When the lens has air on both sides (the ordinary camera case) the nodal points coincide with the principal points. Nodal points are often confused with a panorama pivot. The appropriate pivot in the central-camera approximation is the entrance pupil, discussed next, not generally either nodal point.

fig-principal-planes-pupils
Figure 22.5.6 (reproduced). The cardinal points and pupils of a compound lens, drawn as a black box with the internal elements faint. Marked: the front and rear principal planes H and H′ (from which object distance u and image distance v are measured so that 1/f = 1/u + 1/v holds for the whole system), the coinciding nodal points, the aperture stop inside the lens, and its two images: the entrance pupil (seen from the object side) and the exit pupil (seen from the image side). The effective focal length f is measured from H′; the entrance-pupil diameter D_EP is the opening that sets the f-number N = f / D_EP, and the angle of view is the cone of rays the entrance pupil admits.

Entrance and exit pupils. Somewhere inside the lens is the aperture stop: the diaphragm whose blades you open and close. But you rarely see the stop directly; you see its image formed by the glass in front of or behind it. Looking into the front of the lens, the apparent opening is the entrance pupil (EP): the image of the aperture stop projected into object space by the elements ahead of it. Looking into the back, you see the exit pupil, the image of the stop projected into image space by the elements behind it. The entrance pupil matters enormously because it is the opening that actually gathers light: a scene point sends into the lens exactly the cone of rays that fills the entrance pupil. So the entrance pupil (not the physical front element, and not the physical stop) is the effective aperture of the system. It is also the true center of perspective: rotating the camera about it minimizes parallax in the central-camera approximation; a real wide-angle lens can have a field-dependent apparent pupil, so no single pivot is perfect over every direction. This explains why panoramic rotation is usually arranged around the entrance pupil rather than a nodal point.

The f-number, pinned to the entrance pupil. FUNDAMENTALS defined the f-number $N = f/D$ as focal length over aperture diameter, controlling both light-gathering (a stop is a factor of $\sqrt 2$ in diameter, a factor of $2$ in area and exposure) and depth of field. Now we can say which diameter: the entrance-pupil diameter $D_{\text{EP}}$, so that

$$ N = \frac{f}{D_{\text{EP}}}. $$

Using the front-element diameter instead is a genuine mistake. In a retrofocus or telephoto lens, the front element can be much larger or smaller than the entrance pupil, and only $D_{\text{EP}}$ gives the right light-gathering and depth of field. Off-axis, the barrel and the front and rear elements can clip the pupil (the oblique cone of light no longer passes cleanly), which darkens the corners (optical vignetting, distinct from the natural $\cos^4$ falloff of FUNDAMENTALS) and squeezes out-of-focus highlights into "cat's-eye" shapes. We pick that up in Depth of field; here it is enough to note that the pupil, not the stop, is what gets vignetted.

The T-stop. The f-number quietly assumes that all the light entering the entrance pupil reaches the sensor: that the lens transmits 100% of it. Real glass absorbs a little and, more importantly, every air–glass surface reflects a few percent (which we attack with coatings in Glare suppression), so a multi-element lens transmits only a fraction $\tau < 1$ of the light. Two lenses of the same f-number can therefore deliver different actual exposures. Cinematographers, who cannot tolerate a brightness jump when they switch lenses, mark their lenses not in f-stops but in T-stops, which fold in the measured transmittance:

$$ T = \frac{N}{\sqrt{\tau}}. $$

The square root appears because exposure goes as the inverse square of the f-number (it is an area), so a transmittance $\tau$ reduces the effective area by $\tau$ and raises the equivalent f-number by $1/\sqrt{\tau}$. A T-stop of $T$ thus means "this lens gives the exposure that a perfect (lossless) $f$/$T$ lens would," which is exactly the number you need to set exposure reliably. As coatings push $\tau$ toward 1 (with the actual value depending on lens, wavelength, and aperture), the T-stop creeps back toward the f-number.

How many elements, in practice. Putting it together: the visible cost of canceling every aberration in glass is the element count, and modern lenses are extravagant. A high-performance zoom or a fast prime commonly runs 10 to 20-plus elements in several groups, sprinkled with aspheric surfaces and exotic low-dispersion glasses to do more correction per element (both detailed in Aberrations correction). Even a smartphone "lens," for all that it looks like a single dot, is a stack of five to eight tiny molded plastic or glass elements, several strongly aspheric. Every one of those elements is there to cancel something. The central argument of this part is that not everything must be corrected in glass. You can let the optics get close and finish the job in software: correct the residual distortion, vignetting, and color computationally, which is cheaper than another aspheric element. That trade, glass against computation, shapes the chapters ahead, and the cardinal-point picture built here is what lets us reason about it cleanly: it tells us exactly what the optics is promising, so we know precisely what the software must clean up.

Glare suppression⧉

Where stray light comes from: flare, ghosting, veiling glare⧉

optional

Start with the single fact that drives everything in this chapter: at every air–glass interface, some light reflects. How much is given by the Fresnel equation for reflectance at normal incidence,

$$ R = \left(\frac{n_1 - n_2}{n_1 + n_2}\right)^2, $$

where $n_1$ and $n_2$ are the refractive indices on the two sides of the surface. For an ordinary air-to-glass interface, $n_1 = 1$ (air) and $n_2 \approx 1.5$ (a typical crown glass), so

$$ R = \left(\frac{1 - 1.5}{1 + 1.5}\right)^2 = \left(\frac{-0.5}{2.5}\right)^2 = 0.04, $$

about 4% per surface. That number is small but not negligible, and it drives the whole problem. The other 96% refracts through and forms the image; the 4% reflects back into the lens and can create artifacts.

Ghosts. Consider a strong light source (the sun, a streetlamp, a bright reflection) somewhere in or near the frame. Its rays enter the lens and most of the light proceeds normally toward the sensor. But suppose a ray reflects off one surface (losing 96%, keeping 4%), travels back, then reflects again off a second surface (keeping 4% of that), and now heads forward toward the sensor a second time. This doubly-reflected beam has lost the vast majority of its energy (it carries roughly $0.04 \times 0.04 = 0.0016$, less than two-tenths of one percent of the source) but if the source is very bright, that residue is still visibly bright. And because it has traversed the optics along a bent path, it does not focus where the source's real image is. Instead it forms a ghost: a discrete, usually defocused bright blob, frequently shaped like the aperture (because the out-of-focus image of a bright point takes the shape of the diaphragm, recall the bokeh discussion of Depth of field), and typically strung out along the line from the source through the center of the frame, often mirrored to the opposite side. A whole chain of ghosts appears because there are many pairs of surfaces, each pair producing its own double-reflection at its own position. (Figure 22.1.13)

fig-lens-flare-ghosting
Figure 22.1.13 (reproduced). How a ghost is born. A bright source (e.g. the sun) sends rays into a multi-element lens. Most light refracts straight through to form the image. One ray is traced reflecting off a rear surface, traveling back, reflecting a second time off a front surface, and then proceeding to the sensor along a bent path: this double reflection lands as a defocused, aperture-shaped ghost displaced from the source, typically along the source-to-center axis. Several such surface pairs produce a chain of ghosts, and the unfocused remainder adds a low-frequency veiling wash across the frame. The single traced double-bounce is highlighted; faint replicas indicate the other surface pairs.

Flare. When the bright source is just outside the frame, its light still enters the front of the lens at a steep angle and reflects or scatters inside the barrel without forming a clean ghost. The result is streaks, arcs, and a generally washed-out region spilling in from the side where the source sits. This is what photographers loosely call flare: the splashy, often colorful artifact you get shooting toward a light just off the edge of the picture. (Some lens designs, the anamorphic optics of Special optics among them, flare in such a characteristic way that the look is now imitated on purpose.)

Veiling glare. Not every stray ray forms a recognizable ghost or streak. Most of the misdirected light (the countless weak reflections off every surface, plus scatter off the diaphragm blades, the barrel walls, dust, and microscopic imperfections in the glass) does not concentrate anywhere. It just spreads, more or less uniformly, a thin layer of light over the whole image. This is veiling glare: a low-frequency wash that lifts the blacks and crushes the contrast of the picture. It is the most damaging form of glare precisely because it is invisible as an artifact (there is no obvious blob to point at) yet it quietly robs the image of its deep tones. A shadow that should be black instead reads as dark gray; a scene shot into backlight looks flat and milky. Veiling glare is worst when a bright source sits just outside the frame (so the hood, below, is the first defense) or when you shoot directly into the sun.

Why compound lenses make it worse. Here is the part that ties back to Compound lenses and explains why coatings are not optional but mandatory. The ghost-producing mechanism needs a pair of surfaces: light reflects off one, then off another. If a lens has $N$ air–glass surfaces, the number of distinct surface pairs that can produce a double-reflection ghost is

$$ \binom{N}{2} = \frac{N(N-1)}{2} = O(N^2). $$

The count of candidate two-reflection paths grows quadratically; many are blocked or too weak or defocused to appear as separate visible ghosts. A simple triplet has six surfaces: fifteen pairs. A modern fast zoom can have thirty or forty surfaces, which is hundreds of potential ghost paths, and on top of that the cumulative veiling glare grows with the number of surfaces too. Worse, recall from Compound lenses that the T-stop already penalizes a lens for its transmittance loss $\tau$: with 4% lost to reflection at each of, say, thirty surfaces, an uncoated lens would transmit only $0.96^{30} \approx 0.29$: under a third of the light would reach the sensor, and the remaining light would be reflected away, absorbed, or contribute to stray paths. Only a fraction becomes recorded glare. Such losses and ghosts strongly constrain complex uncoated designs. This is the problem that coatings solve, and the entire era of complex, high-element-count photographic lenses was made possible by the coating.

Recap: big lessons in this lecture

We will lean almost entirely on ray (geometric) optics, because nearly every source and interaction we meet is incoherent, and incoherent imaging is linear in intensity. The one piece of the wave picture we hold onto is that the physical color of light is its spectral distribution, the energy it carries at each wavelength. The exceptions to the ray picture are narrow: light squeezed through a small hole (diffraction), a thin film (interference), or a fine structure (structural color), and even structural color we can usually fold into absorption and go on treating the light as rays. Ray optics and incoherent imaging are linear, with one standing catch: the quantities are always positive, so we can add light but never subtract it. Coherent light and full wave optics, where amplitudes add and can cancel, come back only for the advanced topics of metalenses, lensless cameras, and holography, and the particle picture we keep mostly for modeling noise. So most of the time we will picture light as a set of rays traveling in straight lines through homogeneous media, each carrying a radiance that is itself a distribution over wavelength. With that, we have followed light from its source, off a surface, and to the edge of the camera; the chapters that follow take up how eye and camera turn that light into color and into an image.

💡 Big lesson (L2.4) — Snell's law

At a boundary between two media, light bends by $n_1\sin\theta_1 = n_2\sin\theta_2$, toward the normal entering a denser medium, away from it on the way out. This single rule is the seed of all lens optics: every focal length, every ray trace, the thin-lens equation, and every aberration is Snell's law applied at curved glass surfaces. Pair it with the fact that the index $n$ depends on wavelength (the next lesson) and you also get dispersion. Almost everything optical in this book traces back to it.

fig-reflection-refraction-diffraction
Figure 2.1.12 (reproduced). Three things light does at a surface. Reflection: a ray bounces off a smooth surface with the angle of reflection equal to the angle of incidence (θᵢ = θᵣ), both measured from the surface normal. Refraction: a ray crossing into a denser medium bends toward the normal because light slows down, obeying Snell's law n₁ sin θ₁ = n₂ sin θ₂; past the critical angle, a ray crossing into a rarer medium cannot escape at all and undergoes total internal reflection (a faint reflected ray is always present). Diffraction: a wave passing a small aperture or edge spreads instead of traveling straight, through an angle θ ≈ λ/d: the narrower the aperture relative to the wavelength, the wider the spread, which is why stopping a lens down too far softens rather than sharpens an image. Reflection and refraction are the everyday cases; diffraction returns in the final section.
💡 Big lesson (L2.10) — the smaller the aperture, the more diffraction blurs

Counter to ray-optics intuition, a smaller aperture spreads light more: the diffraction blur (the Airy disk) grows as $\sim\!\lambda N$ with f-number, so stopping down past a point softens the image instead of sharpening it. The flip side is the rule behind every instrument that must resolve fine detail: only a large aperture can diffract little and resolve finely, which is exactly why microscopes and telescopes are built around large lenses and mirrors, and why a phone camera's tiny aperture hits a hard resolution wall it cannot pass. It is the optical cousin of "you can't sample your way past Nyquist."

fig-diffraction-wave-sim
Figure 2.1.46 (reproduced). Diffraction, simulated. A live 2-D solution of the wave equation: a plane wave arrives from the left and passes through a single slit in an opaque barrier. Before the slit the wavefronts are flat; after it they bend into expanding arcs and spread, and the time-averaged intensity on the far screen forms the single-slit pattern, a broad central lobe flanked by weaker side lobes. Narrowing the slit (or lengthening the wavelength) widens the spread. This is the near-field (Fresnel) pattern at that fixed screen distance, not the textbook far-field sinc²: a narrow slit is already effectively in its far field and shows one broad lobe, while a wide slit still roughly projects its own width, fringed by edge diffraction; the region left of the slit also shows genuine standing-wave interference between the incoming wave and the part reflected off the barrier. Interactive: press play and vary the slit width and wavelength to watch the wave evolve.
💡 Big lesson (L2.11) — image formation is choosing which rays reach each point

Forming an image is, at bottom, controlling which ray (or rays) of light contribute to each point of the image. A bare sensor fails because every scene point sends light to every pixel. The sum is a flat gray. A pinhole admits one ray per point (sharp, but dim); a lens gathers a whole cone of rays from one scene point and bends them back to one image point (bright, but only for one focal plane); an open hole with no focusing mixes many rays and blurs. Every imaging idea in this book (focus and depth of field, coded apertures, light fields, even a CT scanner) is a different answer to the one question: which rays land here?

fig-pinhole-imaging
Figure 2.2.2 (reproduced). Adding a pinhole to the bare sensor of Figure 1. A barrier with a tiny hole admits exactly one ray per scene point, so the canopy (red), mid-trunk (blue) and base (gold) each reach a single photosite and an inverted image forms, where the bare sensor recorded only an average. The catch: almost all the light is blocked, so the image is very dim, which is exactly what the lens (next chapter) fixes.
💡 Big lesson (L2.12) — field of view depends on the sensor size

For a pinhole a fixed distance $f$ from the sensor, the field of view is set by the sensor size: $\text{FOV}=2\arctan(\text{sensor}/2f)$. Hold $f$ fixed and slide a larger sensor behind the same pinhole and you take in more of the world; a smaller sensor crops to a narrower view. So "how wide a shot is" is never a property of the pinhole (or, next chapter, the lens) alone: it is the pinhole-to-sensor distance and the sensor size, together. This is the geometric root of the crop factor and of "35 mm-equivalent" focal lengths (next chapter), and the reason the same lens is wide on a big sensor and tele on a small one.

fig-pinhole-fov
Figure 2.2.10 (reproduced). Pinhole imaging geometry, drawn as a side (y-z) view with z pointing right into the scene and y pointing down. A scene point's ray passes through the pinhole; on the physical image plane behind the pinhole the image is inverted, while the virtual image plane the same distance f in front carries the same image upright, the convention we adopt. The pinhole-to-plane distance is the focal length f: a short f gives a wide field of view, a long f a narrow one, by FOV = 2·arctan(sensor / 2f).
💡 Big lesson (L2.13) — cropping is the same as zooming in

From a pure geometric-projection standpoint, cropping an image and zooming in (lengthening the focal length) are one and the same operation. Both leave the perspective projection (the divide-by-$Z$ onto the normalized plane) completely untouched and change only the pixel stage $K$: a crop keeps a smaller patch of the projected image and rescales it to fill the frame, which is exactly what a larger $f_x, f_y$ does. So a 2× crop and a 2× zoom give the identical framing and identical perspective, differing only in resolution: the crop simply has fewer pixels to show for it. This is why "digital zoom" is geometrically free but costs detail, and why the crop factor between sensor sizes acts as a focal-length multiplier.

fig-crop-focal-length
Figure 2.2.11 (reproduced). Cropping = longer focal length. Left, a full-frame capture of a scene; right, the central crop enlarged to the same output size. The crop is geometrically identical to a photo taken with a longer focal length (a narrower field of view); only the pixel-mapping stage K changed, not the underlying projection. The crop just has fewer pixels to work with.
💡 Big lesson (L2.14) — linear perspective is a divide by depth

With the camera at the origin looking down $z$, a scene point $(X,Y,Z)$ lands at $(f X/Z,\; f Y/Z)$: the whole of perspective is dividing by depth. That one division produces everything we call perspective: farther things appear smaller (double the depth, halve the size), parallel lines converge to vanishing points, and the picture gains its sense of space. It is also why depth is the hard thing to recover: the division throws $Z$ away, and a single image cannot tell a small near object from a large far one. Every stereo, structure-from-motion, and depth-estimation method in later parts is, in effect, trying to undo this divide.

fig-perspective-projection
Figure 2.2.12 (reproduced). The perspective projection equation by similar triangles. Side (y-z) view: a scene point at height Y and depth Z, the pinhole at the origin, and the image plane at distance f. The ray through the pinhole makes two similar triangles, giving y'/f = Y/Z, hence y' = f·Y/Z (and x' = f·X/Z horizontally). The image coordinate is the world coordinate divided by depth and scaled by focal length, the "divide by Z" that shrinks distant objects. Drag the point (push it deeper and watch y' shrink) or drag the image plane to change f.
💡 Big lesson (L2.18) — a lens makes a large set of ray from an in-focus point reconverge to one image point

Where a pinhole keeps only one ray, a lens gathers a whole cone of rays leaving a scene point and bends them back to a single image point, but only for points at the focus distance. That is the lens's compromise: vastly more light (a bright image) in exchange for a single plane of sharp focus, with everything nearer or farther spread into a blur disk (the circle of confusion). The aperture sets how wide that cone is, and hence the depth of field. Every later idea about focus, bokeh, refocusing, and light fields is a variation on "which cone of rays reconverges where."

fig-image-formation-lens
Figure 2.3.2 (reproduced). The 2-D image-formation playground again, opened on the thick lens. Same four scenarios as in the pinhole chapter (bare sensor, pinhole, thin lens, thick lens): switch among them and watch the image go from a flat average (bare sensor) to dim but sharp (pinhole) to bright and sharp (lens), because the lens collects a whole cone of rays per point instead of one. Click a pixel to see the cone it gathers, or a scene point to see where its rays land. Notice how much more light reaches each pixel once a lens replaces the pinhole.
💡 Big lesson (L2.19) — when a quantity is small, linearize: keep the first Taylor term

What we just did to Snell's law is one of the most powerful moves in all of physics and engineering, and the book will reach for it again and again. Replace a messy nonlinear function by its tangent line near the operating point, keep only the first-order (linear) term of its Taylor expansion, and it is an excellent approximation as long as the relevant quantity stays small. Here the small quantity is the angle, $\sin\theta\approx\theta$, and the reward is the entire clean, linear machinery of paraxial optics. The same reflex linearizes brightness change into the optical-flow constraint (a chapter away), drives the Gauss–Newton steps of lens optimization and bundle adjustment, and propagates small noise through a pipeline. Two disciplines keep it sound. Know when it breaks: the approximation is only as good as the terms you dropped are negligible, so always ask "how small is small?" And keep the next term in your pocket: restoring it is not a footnote but a whole theory: for optics that next term is the cubic $-\theta^3/6$, and restoring it is the study of aberrations (next big lesson, and the OPTICS part).

💡 Big lesson (L2.20) — thin-lens optics is a linear (first-order) approximation of Snell's law when angles are small (the paraxial regime)

The clean thin-lens equation $1/f = 1/u + 1/v$ is not a separate law: it is Snell's law L2.4 linearized, kept to first order under the small-angle approximation $\sin\theta\approx\theta$, the regime known as paraxial (rays near the axis, gentle angles, one wavelength). Because it keeps only the linear term, it tells you exactly when the idealization holds and exactly how it breaks: restore the next term $\sin\theta\approx\theta-\theta^3/6$ and the Seidel aberrations appear; let $n$ vary with wavelength and chromatic aberration appears. "Thin lens," "first-order optics," "a linear (paraxial) lens," and "a lens with no aberrations" are all the same approximation, and the OPTICS part is the story of paying back what it borrowed.

fig-thin-lens-approximation
Figure 2.3.9 (reproduced). The thin lens is the small-angle linearization of a real, thick, Snell's-law lens (interactive). A biconvex glass lens is traced two ways: the correct optics (refract by Snell's law at each curved surface, for three wavelengths whose index differs by the dispersion) and the thin approximation (bend once at the center plane, one index, dashed). Near the axis and for one color they agree; away from the axis the correct rays focus short of the ideal point (spherical aberration) and the colors split (chromatic aberration), exactly what the thin lens throws away. A "show" control displays the thick lens alone, the thin approximation alone, or both together. Sweep the thickness, curvature, index, dispersion, and incoming tilt.
💡 Big lesson (L2.21) — the two thin-lens ray rules

Parallel rays through a thin lens converge to a point at the focal length, and rays going through the center of a thin lens do not deviate. The first rule is what focal length means (where a far subject's parallel bundle meets) and carries the lens's focusing power; the second carries its perspective, identical to the pinhole's. Between these two construction rules and similar triangles, you can derive all of thin-lens optics.

fig-thin-lens-two-rules
Figure 2.3.10 (reproduced). The two thin-lens ray rules (interactive), in the order of the lesson. Left (rule 1): two bundles of parallel rays, an on-axis bundle meeting at the focal point F and a tilted bundle meeting off-axis, each converging to a single point on the focal plane a distance f behind the lens: the focusing power, and the meaning of focal length. Right (rule 2): a bundle of rays passing through the center of the lens, every one undeviated (straight through, as through a pinhole): the lens's perspective, identical to a pinhole's. Tilt the second bundle and set f on the left; highlight a center ray on the right. Together with similar triangles these two rules give all of thin-lens geometry.
💡 Big lesson (L2.22) — the focus equation is symmetric: object and image are interchangeable conjugates

The thin-lens equation $\tfrac{1}{u}+\tfrac{1}{v}=\tfrac{1}{f}$ is symmetric in $u$ and $v$: swap them and it is unchanged, so object and image are interchangeable. Send the light back the other way and the rays retrace exactly the same path (the reversibility of light, made arithmetic). Two consequences fall straight out: an object at infinity images at $v=f$, which is what focal length means, and focusing a camera is nothing but moving $v$ until the chosen object's conjugate lands on the sensor.

fig-thin-lens-conjugates
Figure 2.3.12 (reproduced). Thin-lens conjugates. For object distance u and image distance v, 1/f = 1/u + 1/v. An object at infinity images at v = f; a far object just beyond f; a close object far behind the lens; an object at the focal point F sends rays out parallel (image at infinity). Each object distance pairs with exactly one image distance: focusing a camera moves the sensor/lens to put the chosen conjugate on the sensor. Drag the object distance past the focal length: the conjugate curve $v = f\,u/(u-f)$, tracked live by the schematic below, flips the image from real (positive v) to virtual (negative v).
💡 Big lesson (L2.23) — the simplest way to focus is to move the sensor: full (unit) focusing

The most basic way to focus follows straight from the equation: move the whole lens relative to the sensor, changing the lens-to-sensor distance $v$ until the chosen subject's conjugate lands on the sensor. This is full or unit focusing, the entire optical unit sliding with its focal length fixed. A bellows, the helicoid focus ring on a simple prime, and a bare enlarger lens all work this way, and it is the mental model to keep. It is only the simplest option, though. A compound lens has many elements, and moving just some of them (front-cell, internal, or rear focusing, sometimes with floating groups) can focus while extending the barrel less, holding aberrations in check across the focus range, or even nudging the effective focal length. Those techniques, and why designers reach for them, come in the OPTICS part's focus section.

💡 Big lesson (L2.24) — magnification is the ratio of projected size to real-world size

Magnification is the size of a subject's image divided by the subject's actual size in world units (meters): $m = -v/u$ is exactly that ratio (image height over object height). Photographers quote it as a reproduction ratio: 1:1 ("life size") means the image on the sensor is as large as the subject itself; 1:2 means half life size. What fraction of the frame a subject then occupies depends on the sensor size: the same magnification fills more of a small sensor than a large one. On a full-frame ($24\times36$ mm) camera a $1{:}2$ reproduction images a subject about $48\times72$ mm to exactly fill the frame; put that same subject on a smaller sensor at the same magnification and it overflows. So magnification is a property of the optics-and-distance alone, while "how big it looks in the picture" also needs the sensor size.

💡 Big lesson (L2.25) — the f-number is the aperture diameter as a fraction of the focal length

$N = f/D$: the f-number tells you the width of the opening measured in focal lengths, not in millimeters. $f/4$ means the opening is one quarter of the focal length across. Writing the aperture this way is what makes it a portable brightness setting: because the cone of light converging on each sensor point has half-angle $\tan\theta = 1/(2N)$, the ratio alone sets the image brightness, so the same f-number gives the same exposure on any lens, whatever its focal length or physical size. The denominator is why a small number is a big opening, and the area-goes-as-diameter-squared law ($\text{light}\propto 1/N^2$) is why the stop series climbs by $\sqrt2$.

fig-aperture-fnumber-cones
Figure 2.3.14 (reproduced). Why the f-number is written as a ratio, read off the light cone. Left: the same f-number gives the same cone, and hence the same brightness, at any focal length. A short lens (aperture $D$ at distance $f$) and a long lens (aperture $2D$ at distance $2f$) have the identical $N = f/D = 4$, so their converging cones share the very same half-angle $\tan\theta = 1/(2N)$; the long lens's opening is physically twice as wide yet pours no more light onto the sensor point, because only the ratio matters. Right: at a fixed focal length, opening up (a smaller f-number) widens the cone. The light collected follows the opening's area, $\propto D^2 \propto 1/N^2$, so $f/2, f/4, f/8$ pass $1, \tfrac14, \tfrac1{16}$ of the light; halving the area (one stop) takes a $\sqrt2$ step in $N$, which is the whole reason the aperture series climbs $f/2, 2.8, 4, 5.6, 8, \dots$
💡 Big lesson

Preserve the original measurements when reconstruction stages depend on one another. A joint forward model can account for blur, color displacement and sampling together; incorrect calibration or priors can still produce a wrong result.

💡 Big lesson (do not order operations that interact)

Model the interactions between stages and compare their complete outputs. Joint estimation can avoid premature intermediate decisions, but its advantage depends on the models, data and solver.