Derivation of the DOF equations

topbar


Many representations of the depth-of-field equations exist. Some are approximate, valid for either the far field or the near field, and some are exact. The great majority of manifestations encountered in text books have in common that the issue of lens (a)symmetry is completely ignored. This is fine as long as an asymmetrical lens is not used at close focus and as long as the limited validity is mentioned, but the latter is rarely the case. The below derivation of the DOF equations makes due allowance for lens design asymmetry. At the downside, the treatment is slightly more cumbersome than it would be for symmetrical lenses and might deter photographers who are uncomfortable with equations. Unfortunately, matters are not always as simple as we would like to believe.


Pupil magnification

A measure for the lens symmetry is the pupil magnification P, also known as the pupil factor. It is defined as

P =
exit pupil diameter
divided by
entrance pupil diameter
(1)

The entrance pupil is the lens aperture that is seen when you look into a lens from the front, the exit pupil is physically the same opening but observed from the rear. For a perfectly symmetrical lens the pupils have the same size and P=1. Departures from a symmetrical design occur, for instance, with the telephoto lens (P<1) and the retrofocus wideangle lens (reversed telephoto design) with P>1. Apart from the DOF, the pupil magnification affects quantities such as the depth of focus, the effective aperture (in relation to exposure) and the field of view. For faraway subjects the pupil magnification has no significant influence on these quantities; it becomes important for image magnifications greater than, say, 0.1. In the very macro regime the impact of a nonunitary P is substantial.


Geometry of image formation

The DOF equations can be derived with the help of the sketches in Fig. 1 and Fig. 2. Ingredients are the entrance pupil E, the exit pupil X, the front principal plane H, the rear principal plane H', and the film. The object distance v and the image distance b are measured relative to the respective principal planes and obey the Gaussian lens formula

1/f = 1/v + 1/b (2)

where f is the focal length. When the lens is focussed at infinity (v = ∞), we read from Eq. 2 that the image is at a distance b=f behind H'. Fig. 1 depicts the infinity scenario. The diameter of the entrance pupil is D and the diameter of the exit pupil measures PD.

Infinity focus

Figure 1. Infinity focus for an asymmetrical lens with P>1.

There is a fundamental expression that relates the half-angle θ of the light cone in image space to the F-number N of a well-corrected lens:

N =
1
divided by
2sinθ
(3)

On the assumption that the angle θ is sufficiently small to justify sinθ ≈ tanθ (paraxial approximation), N equals the true F-number f/D for the infinity scenario of Fig. 1. (At close focus Eq. 3 still holds, but then N must be considered as the effective F-number.) Indeed, at infinity focus the apical angle of the light cone that impinges upon the film is the same for all lenses at the same F-number. It follows that the separation of the exit pupil from the film equals Pf and that the distance between X and H' is (P–1)f. At infinity focus the light cone emanating from X has an intersection of diameter D with H'. Note that Fig. 1 illustrates a case with P>1. When P is smaller than 1, (P–1)f is negative and X would be at the right of H'.

So far we considered infinity focussing. When the lens of Fig. 1 is focussed on an object at a finite distance v from H, the image point is at a distance b>f behind H' (Fig. 2, top sketch). A closer point v1 comes into focus behind the film and a farther point v2 in front of the film (middle and bottom sketch, respectively).

DOF Geometry

Figure 2. Geometry of image formation for an asymmetrical lens. The object point at v is placed in sharp focus, the points at v1 and v2 lead to unsharp imaging on the film.

The equations

To derive the DOF equations, we will start with an inspection of the geometry in image space and work our way back to the object space. From similar triangles in the middle and bottom sketches in Fig. 2 it follows that the size k of the blur patch on the film is given by

k =
PD|b'–b|
divided by
b'+(P–1)f
(4)

where b' is the image distance of an arbitrary point v' in object space. For the concept of DOF it is now assumed that points outside the plane of exact focus do not lead to noticeable unsharpness as long as the diameter of the blur spot does not exceed a certain (small) value C. C is known as the acceptable circle of confusion (COC). Its value is of no importance for the derivation; that comes into play only with the application of the DOF equations.
With the help of Eq. 2 it is possible to eliminate b and b' from Eq. 4 in favor of their object space conjugates v and v'. Eq. 4 can subsequently be solved for v'. No surprise there are two solutions which, after some algebraic rearrangement and upon substitution of k=C, read

v1 =
(P1)(vf)Cf + PDfv
divided by
PC(vf) + PDf
(5)
and
v2 =
(P1)(vf)CfPDfv
divided by
PC(vf) – PDf
(6)

The significance of these two solutions, known as the near point and the far point, is that they mark the boundaries of the region in object space that is considered sharp. v1 and v2 are associated with blur spots on the film of diameter C; the region in between is imaged with a smaller blur and thus considered sharp according to the COC criterion. This region of apparent sharpness is known as the depth of field S. It is the area in front of and behind the plane of sharp focus that will appear sharp to the observer of a photograph. The regions in front of v1 and behind v2 are considered out of focus. The sharpness criterion C is of critical importance and should be tuned to the demands of the observer and the viewing conditions.
The depth of field in front of the subject is v–v1, the front DOF

S1 =
C(vf)×[f + P(vf)]
divided by
PC(vf) + PDf
(7)

and the depth of field behind the object is v2–v, the rear DOF

S2 =
C(fv)×[f + P(vf)]
divided by
PC(vf) – PDf
(8)

The total DOF S, simply known as the depth of field, is given by S1 + S2:

S =
2fDC(vf)×[(P–1)fPv]
divided by
PC2(vf)2PD2f2
(9)

Hyperfocal distance

When the denominator of Eq. 8 is zero, the rear DOF is infinite. This happens for a value of v known as the hyperfocal distance

H =
f2
divided by
NC
+ f (10)

independent of the pupil magnification P. Here, the entrance pupil diameter D has been eliminated with the help of D=f/N. Substitution of v=H in Eq. 7 yields S1=H/2. For given values of f, N, and C, the hyperfocal setting v=H yields the maximum available depth of field, ranging from H/2 to ∞. (Note that the validity of Eq. 8 is restricted to v<=H. When v>H a negative outcome results from Eq. 8, but the rear DOF really remains infinite.)


Image magnification

The image magnification M is defined as the ratio of the image size to the object size. It is related to the object distance v and the image distance b according to

M = b/v (11)

A more manageable expression for the depth of field Eq. 9 is obtained when we get rid of the object distance v with the help of Eq. 11 and Eq. 2. After an algebraic exercise we end up with

S =
2NC(1+M/P)
divided by
M2C2N2/f2
(12)

for M>CN/f, and ∞ otherwise. Eq. 12 simplifies further for situations where CN/f is much smaller than M. Then and only then the focal length can be completely eliminated from the DOF equation:

S
2NC(1+M/P)
divided by
M2
(13)

Since M = b/v = f/(v–f), it is readily verified that the condition CN/f « M corresponds to v « H. Hence, at close focus the depth of field depends only on the image magnification, the F-number, and the pupil magnification, regardless of the focal length. The prerequisite v « H is clearly met for the macro regime, a good approximation for typical head portraits and slightly beyond, but the condition is violated for faraway objects.


Depth of focus

Fig. 3 shows the same scenario as the top sketch in Fig. 2, but with the light cone extended beyond the film. The depth of focus U is defined as the region in front of and behind the focal plane where the diameter of the light cone is smaller than the permissible circle of confusion C. For k=C, the depth of focus stretches over the orange colored area around the film plane.

the depth of focus

Figure 3. Geometry to derive the depth of focus U.

From similar triangles and, again, Eq. 2 and Eq. 11 it can be shown that the depth of focus thus defined is given by

U =
2NC(1+M/P)
(14)

independent of the focal length. The depth of focus is important in relation to focussing precision, camera alignment tolerances and film flatness issues. For instance, a film that bulges will cause noticeable unsharpness of the object on which the lens is focussed if the bulge exceeds U/2. Eq. 14 is exact and resembles the approximate expression for the depth of field in Eq. 13. At unit magnification (1:1 or M=1) the depths of field and focus are equal. An alternative definition for the depth of focus is the distance between the conjugate image points of the near and far points of the depth of field. In Fig. 2 this definition makes U=b1–b2. The difference between the two definitions is negligible in cases of practical interest.


Background blur

Depth-of-field discussions often make reference to the degree of background unsharpness. From Eq. 4 it is derived that a point v' at infinity is imaged on the film as a disk of diameter

k =
Mf
divided by
N
(15)

It follows that for a given F-number and magnification the blurring is proportional to the focal length. Alternatively, we may simply write k = MD to conclude that the blur patch is proportional to the size D of the entrance pupil.


Symmetrical lenses

Most DOF treatments only consider purely symmetrical lenses, for which P=1. With one parameter less to worry about, the DOF equations simplify. Frequently encountered expressions for the near and far points, which are just rearrangements of Eq. 5 and Eq. 6, are

v1 =
hv
divided by
h + (vf)
(16)

and

v2 =
hv
divided by
h – (vf)
(17)

with

h =
f2
divided by
NC
(18)

The quantity h is usually called the hyperfocal distance, but this is not entirely correct as the true hyperfocal distance H is given by Eq. 10. Nonetheless h is a very good approximation of H as f/NC » 1 for normal lens usage. Eq. 16 and Eq. 17 are exact (for P=1) but their elegance is somewhat compromised by the observation that substitution of v=h into Eq. 17 does not yield the promised DOF up to infinity. The substitution v=H does just that. At least, in theory.

© Paul van Walree 2003–2014