33.4 Phase-coded apertures⧉
The previous chapter put a patterned amplitude mask in the aperture and turned the defocus blur into a barcode that carries depth: a different, identifiable blur at every distance, from which a decoder reads both a depth map and an all-in-focus image. A pupil can modify both amplitude and phase. This chapter is the other: instead of blocking light in a pattern (amplitude), shape the phase of the wavefront, or sweep the plane of focus during the exposure, so that the blur varies less with depth over a designed range. The goal is the mirror image of coded aperture. There we kept the depth signature and read it; here we deliberately erase it, so that a single deconvolution by one fixed, known kernel sharpens the whole scene at once. The reward is an extended depth of field from one wide-open shot, with reduced focus sensitivity and, ideally, no absorption by the coding element.
The unifying picture is a single comparison across depths (Figure 33.4.1). An ordinary lens has a PSF that is a tight spot in focus and balloons into a wide disc as the object moves away from the focus plane. That complicates deblurring, because the kernel depends on unknown scene depth. The three designs of this chapter each flatten that variation in a different way: a fixed cubic phase plate makes the PSF a near-constant streak; a focus sweep makes the time-integrated PSF a near-constant blob; a lattice of sub-lenses keeps a sharp core present at every depth. These designs aim to make one calibrated reconstruction useful across the working depth range. Residual PSF variation, diffraction, and noise still limit the recovered detail.
33.4.1 A reminder on wavefront coding⧉
The first member of this family is the one we have already met in full: wavefront coding, the chapter that opened the part, Chapter 33.1, Wavefront coding. It deserves only a reminder here, because it is the template the other two designs vary.
Dowski and Cathey's 1995 idea was to drop a thin, transparent cubic phase plate into the pupil, a plate whose thickness, and hence the phase delay it adds, follows $\phi(x,y)=\alpha\,(x^3+y^3)$, flat in the middle and steepening toward the rim Dowski & Cathey 1995. Because it is a phase element it delays light rather than blocking it, so an ideal element does not absorb light; real coatings, scattering, and finite apertures still incur losses. That is the contrast with the amplitude mask of Chapter 33.3, Coded aperture. What the cubic profile buys is a PSF that is a blurred, asymmetric little streak which stays nearly the same across a large range of defocus. (The formal reason, recapped only in passing, is that a cubic phase makes the lens's ambiguity function (its frequency response laid out for all defocus values at once) nearly flat along the misfocus direction, so the response does not change as the object moves.) The captured image is uniformly blurred and frankly ugly, but because the blur is fixed, known, and free of the zeros that plague a clear disc, one regularized deconvolution can sharpen depths within the design range and recover frequencies retained with adequate signal-to-noise ratio. One shot, wide open, no focusing, an extended depth of field, at the cost of a noise penalty from the inverse filter and faint edge artifacts. The full development, including why the cubic falls out of the stationary-phase argument, is in Chapter 33.1, Wavefront coding; we need here only the shape of the move, because the next two designs reach the same depth-invariant PSF without a static phase plate.
33.4.2 Focus sweep⧉
Wavefront coding makes the blur depth-invariant by fixing the optics and accepting a strange PSF. Focal sweep reaches the same place by a route that needs no exotic glass at all: it makes the blur depth-invariant by moving the focus through the whole range during a single exposure (Figure 33.4.2). The idea predates computational photography. Häusler proposed sweeping focus to extend depth of field in microscopy back in 1972 Häusler 1972, and Nagahara, Kuthirummal, Zhou and Nayar brought it to photography as flexible depth of field in 2008 Nagahara et al. 2008 (flexible depth of field).
The mechanism is direct. Leave the shutter open and, during that one exposure, translate the sensor or drive the focus of the lens (with calibration for any accompanying magnification change) smoothly from one end of the focal range to the other. At any instant only one depth is in sharp focus and everything else is defocused; but over the whole sweep, every object depth passes through perfect focus for a brief moment and is defocused by varying amounts the rest of the time. The sensor integrates all of these instants into one picture.
Here is the approximate depth-invariance argument. As focus passes a point's depth, its defocus disc shrinks toward the diffraction-limited spot and grows again. The recorded PSF integrates these instantaneous PSFs, with a central peak contributed near focus and a broader halo contributed away from focus. A point at another depth passes through the same small-blur configurations at a different time. If the sweep is sufficiently broad and its trajectory gives similar weight to those configurations, interior depths have similar integrated PSFs. A finite sweep does not give every depth the identical sequence of disc sizes: the start and end of the sweep truncate different parts of that sequence. The approximation deteriorates near the range boundaries. One calibrated deconvolution can therefore extend depth of field, but does not exactly invert every depth.
The engineering has a few flavors. The most literal is a moving sensor or moving lens element (for example, with a piezo or voice-coil actuator) that ramps focus linearly during the exposure; Nagahara et al. built exactly this and showed that the integrated PSF is stable enough across depth that a single deconvolution recovers the extended-depth-of-field image. One can also realize the sweep all-optically, with no moving parts, by a pupil design that mixes focal lengths, which is precisely the bridge to the next section. And because the sweep is programmable, the same hardware gives "flexible" depth of field: sweep the full range for everything-in-focus, sweep a sub-range to keep a chosen band sharp while the rest blurs, or even sweep non-uniformly to allocate sharpness where you want it. The cost is familiar from coded imaging: the integrated PSF, like the cubic one, attenuates high frequencies, so the deconvolution amplifies noise, but no light is blocked, and the optics are an ordinary lens plus an actuator.
33.4.3 The lattice-focal lens⧉
The focus sweep spreads its focal lengths across the depth range in time. The lattice-focal lens of Levin, Hasinoff, Green, Durand and Freeman (2009) does it spatially, with no moving parts, by tiling the aperture into subsquares, each ground or set to focus at a different depth Levin et al. 2009 (4D frequency / lattice-focal) (Figure 33.4.4). The pupil becomes a patchwork of sub-lenses, a lattice, whose focal lengths are spread across the working range.
The consequence for the PSF is illustrated in Figure 33.4.1. At a given depth, a tile focused near that depth contributes a relatively sharp core, while other tiles contribute defocused light. Moving through the working range changes which tiles supply that core. A finite set of focal lengths covers a continuous depth interval only insofar as the tiles' depths of field overlap. The smaller subapertures also broaden the diffraction-limited spot. The combined PSF varies with depth, but can preserve useful contrast across the range more evenly than a lens focused at one plane.
What matters here is how it was derived. Levin et al. did not guess the tiling; they derived it from a frequency-domain optimality argument in the 4-D light field, the same analysis that is the subject of Chapter 33.6, Theoretical analysis of imaging systems in the 4D light field Fourier domain. The question they posed was: across a whole depth range, how should a lens distribute its limited aperture so that the camera's optical transfer function (OTF) is as large as possible at the worst depth, subject to the aperture, depth range, and spatial-frequency band being modeled? A standard lens spends its entire aperture on one focus, so it is superb at that depth and terrible elsewhere; the analysis shows that the optimal allocation for depth-of-field extension instead splits the aperture into pieces focused at staggered depths, whose individual OTFs, summed, tile the depth-frequency plane so the response is distributed more evenly over the chosen depth-frequency region. The lattice-focal lens realizes this allocation within the paper's model and design constraints, rather than establishing an optimum over all optical systems. It is the part's clearest example of coded optics designed not by intuition but by solving for the best operator in the 4-D light-field spectrum.
33.4.4 Where it sits⧉
Phase-coded apertures complete the pupil's two-way choice. Chapter 33.3, Coded aperture, shapes the pupil's amplitude to make the defocus blur depth-dependent but identifiable, keeping depth so it can be read out; this chapter shapes the pupil's phase (wavefront coding), or sweeps its focus in time (focal sweep), or splits it into depth-staggered sub-lenses (lattice-focal), to make the blur depth-invariant or at least always well-conditioned, throwing depth away in exchange for one clean deconvolution and an extended depth of field. These are design choices, not a universal division of labor: phase masks can also encode depth, and amplitude masks can be optimized for other tasks.
The three designs here are also three points on one spectrum of how you spend a lens's degrees of freedom over depth. Wavefront coding spends a fixed phase profile; focal sweep spends time; the lattice-focal lens spends area. The last of these was found by explicitly optimizing the camera's projection in the 4-D light-field Fourier domain, the subject of Chapter 33.6, Theoretical analysis of imaging systems in the 4D light field Fourier domain. There is a temporal sibling: just as focal sweep makes the defocus blur depth-invariant by integrating over focus, motion-invariant photography makes the motion blur approximately speed-invariant over a selected one-dimensional velocity range by sweeping the camera during the exposure Levin et al. 2008 (motion-invariant). The coded exposure of the next chapter, Chapter 33.5, Code in time (phase, amplitude), codes that same temporal dimension. The deconvolution that decodes all of them (inverting a known, well-conditioned blur, and telling a good restoration from a ringing one) is the machinery of Chapter 16.4, Blind deblurring. Here we needed only the promise these designs share with wavefront coding: a calibrated blur with adequate frequency response over the desired band can be inverted with regularization, subject to noise and model error. Engineer the pupil's phase or its focus to produce one, and depth of field stops being something you buy with light and becomes something you compute.