Depth of field and depth of focus
Depth of field is the range of object distances that an optical system images acceptably sharply; depth of focus is the matching range of positions for the image plane or sensor. In a diffraction-limited system both scale as λn/NA²: under half a micrometer for an oil-immersion objective.
Depth of field is the range of object distances that an optical system images acceptably sharply; depth of focus is the matching range of image-plane positions, where a sensor or film can sit and still record a given object sharply. Both shrink as the numerical aperture grows: as in a diffraction-limited system, and as for a camera judged by its circle of confusion. For a diffraction-limited system, the Rayleigh quarter-wave criterion gives a total depth
measured on the side the NA refers to, in a medium of index : about 55 µm for a 0.10 NA objective at 550 nm and about 0.4 µm in the specimen for a 1.40 NA oil-immersion objective. Camera lenses are judged instead by a blur spot on the sensor, the circle of confusion, and a 50 mm lens at f/4 focused at 3 m on a full-frame camera keeps everything from 2.6 m to 3.5 m acceptably sharp.
Depth of field and depth of focus
The two are the same tolerance seen from the two sides of the lens, related by the longitudinal magnification , where is the transverse magnification and and are the indices on the object and image sides. The consequences run in opposite directions for cameras and microscopes. A camera focused on a distant scene has a depth of field of meters and a depth of focus at the sensor of tens of micrometers, so the sensor must sit precisely at the image plane. A 100× microscope objective with NA 1.40 in oil has an image-side NA of 0.014, which gives a depth of focus of 2.8 mm at the camera, but a depth of field of 0.4 µm in the specimen: the camera position hardly matters, while the specimen must be held in focus to a fraction of a micrometer.
Diffraction-limited depth
Moving a point source a distance out of focus adds a wavefront error at the edge of the pupil of about . The Rayleigh criterion allows a quarter wave, which gives , a total depth of ; within it the peak intensity of the image stays above about 80% of its best-focus value. Values at 550 nm:
| Numerical aperture | Medium | Depth, |
|---|---|---|
| 0.10 | Air | 55 µm |
| 0.25 | Air | 8.8 µm |
| 0.40 | Air | 3.4 µm |
| 0.65 | Air | 1.3 µm |
| 1.40 | Oil, | 0.43 µm |
The formula is paraxial and overestimates the depth at high NA. The exact quarter-wave result is with , which gives 1.15 µm at NA 0.65 and 0.29 µm for the 1.40 oil objective.
Depth of field of a microscope
A microscope image is recorded by a camera or seen by the eye, which cannot resolve arbitrarily small blur. The usual formula for the total depth of field adds a geometric term for the detector to the diffraction term:
where is the smallest distance the detector resolves in the image plane, such as the pixel size, and is the total magnification onto it. With 6.5 µm pixels, a 10×/0.25 objective gives µm, and a 100×/1.40 oil objective gives µm. With a camera the diffraction term usually dominates; the detector term matters most at low magnification with coarse pixels. A confocal microscope, which rejects out-of-focus light with a pinhole, turns this shallow depth into a thin optical section, and focus stacking combines images taken at several focus positions into one image that is sharp throughout.
Depth of field of a camera lens
For photography and machine vision, the blur allowed at the sensor is the circle of confusion , often taken as the sensor diagonal divided by 1500:
| Sensor format | Circle of confusion |
|---|---|
| Full frame (36 × 24 mm) | 0.029 mm |
| APS-C | 0.019 mm |
| Micro Four Thirds | 0.015 mm |
| Phone camera (about 6.4 mm diagonal) | 0.004 to 0.005 mm |
Machine vision systems often set to one or two pixels instead. For a lens of focal length at f-number , the hyperfocal distance is
and a lens focused at a distance keeps objects sharp from
with the far limit at infinity once ; for much larger than these become and . For much smaller than , the total depth of field is about . A 50 mm lens at f/4 on a full-frame camera has m:
| Focus distance | Sharp from | to |
|---|---|---|
| 10 m | 6.8 m | 18.6 m |
| 3 m | 2.6 m | 3.5 m |
| 0.5 m | 0.490 m | 0.511 m |
The Depth of Field Calculator evaluates these limits and the hyperfocal distance for any lens and focus distance, and the microscope formula above for any objective and camera.
At the sensor, the depth of focus for a distant subject is : ±0.058 mm at f/2 and ±0.23 mm at f/8 with mm.
Stopping down increases the depth of field in proportion to , but the Airy disk grows as : 21.5 µm at f/16 and 29.5 µm at f/22 for 550 nm light, which at f/22 equals the full-frame circle of confusion. Beyond that point diffraction softens the whole image.
Lithography
Projection lithography prints at the highest NA available, and its depth of focus shrinks accordingly. With the scaling :
| Generation | NA | ||
|---|---|---|---|
| KrF | 0.60 | 248 nm | 0.69 µm |
| ArF | 0.90 | 193 nm | 0.24 µm |
| ArF immersion | 1.35 | 193 nm | 0.11 µm |
| EUV | 0.33 | 13.5 nm | 0.12 µm |
| High-NA EUV | 0.55 | 13.5 nm | 0.045 µm |
The immersion row leaves out the index of the water in which the image forms, ; with it, gives 0.15 µm, and the exact quarter-wave depth, without the paraxial approximation, is about 0.10 µm. Production processes quote with a process factor of order one. Wafer flatness, focus control and resist thickness all have to fit within that budget.
Laser beams
For a focused Gaussian beam the natural depth is set by the Rayleigh range,
where is the waist radius and the far-field half-angle. Over the beam radius stays within of its waist: a 10 µm waist radius at 1064 nm gives µm, a depth of 0.59 mm. Laser machining often uses a tighter tolerance, such as a 5% growth in spot size, which shortens the usable depth. The trade between spot size and depth of focus when choosing a focusing lens is tabulated in Focusing a Laser Beam.
Extending the depth of field
Stopping down trades resolution for depth, as described above. Focus stacking records several images at different focus positions and merges the sharp parts. Wavefront coding places a cubic phase plate in the pupil so that the blur becomes nearly independent of focus, then removes it by deconvolution. Light-field cameras record the direction of the incoming rays with a microlens array, which lets focus be chosen after capture at a cost in resolution, and electrically tunable lenses sweep the focus quickly enough to scan a volume.
Common questions
What is the difference between depth of field and depth of focus?
Depth of field is measured in object space: how far the subject can move and stay sharp. Depth of focus is measured in image space: how far the sensor can move. They describe the same tolerance and are related by the longitudinal magnification, the square of the transverse magnification (times the index ratio).
How does aperture affect depth of field?
Closing the aperture raises the f-number and lowers the NA, and the depth grows: in proportion to for a camera lens, and as for a diffraction-limited system. Closing one stop, a factor of in f-number, increases a camera's depth of field by about .
Does focal length change the depth of field?
At the same subject distance and f-number, the depth of field falls as . At the same framing, where a longer lens is used from farther away to keep the subject the same size, the depth of field is nearly the same for any focal length.
Why is the depth of field of a microscope so small?
Because the depth scales as , and microscope objectives have the largest NAs in imaging: at NA 1.40 it is below half a micrometer.
References: M. Born and E. Wolf, Principles of Optics, 7th ed. (Cambridge University Press, 1999). E. Hecht, Optics, 5th ed. (Pearson, 2017). S. F. Ray, Applied Photographic Optics, 3rd ed. (Focal Press, 2002). E. R. Dowski and W. T. Cathey, "Extended depth of field through wave-front coding," Applied Optics 34, 1859 (1995). B. E. A. Saleh and M. C. Teich, Fundamentals of Photonics, 3rd ed. (Wiley, 2019).