Many representations of the depthoffield 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.
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.
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.
There is a fundamental expression that relates the halfangle θ of the light cone in image space to the Fnumber N of a wellcorrected 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 Fnumber 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 Fnumber.) 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 Fnumber. 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
v_{1} comes into focus behind the film and a farther point
v_{2} in front of the film (middle and bottom sketch,
respectively).
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  = 
PDb'–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
v_{1}  = 
(P–1)(v–f)Cf + PDfv
divided by
PC(v–f) + PDf

(5) 
v_{2}  = 
(P–1)(v–f)Cf – PDfv
divided by
PC(v–f) – 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.
v_{1} and v_{2} 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 v_{1} and behind v_{2} 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–v_{1}, the front DOF
S_{1}  = 
C(v–f)×[f + P(v–f)]
divided by
PC(v–f) + PDf

(7) 
and the depth of field behind the object is v_{2}–v, the rear DOF
S_{2}  = 
C(f–v)×[f + P(v–f)]
divided by
PC(v–f) – PDf

(8) 
The total DOF S, simply known as the depth of field, is given by S_{1} + S_{2}:
S  = 
2fDC(v–f)×[(P–1)f – Pv]
divided by
PC^{2}(v–f)^{2} – PD^{2}f^{2}

(9) 
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  = 
f^{2}
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 S_{1}=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.)
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
M^{2} – C^{2}N^{2}/f^{2}

(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
M^{2}

(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 Fnumber, 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.
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.
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=b_{1}–b_{2}. The difference between the two definitions is negligible in cases of practical interest.
Depthoffield 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 Fnumber 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.
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
v_{1}  = 
hv
divided by
h + (v – f)

(16) 
and
v_{2}  = 
hv
divided by
h – (v – f)

(17) 
with
h  = 
f^{2}
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–2015
spherical aberration  astigmatism and field curvature  distortion  chromatic aberrations  vignetting  lens hoods  flare  filter flare  depth of field  dof equations  vwdof  bokeh  spurious resolution  center of perspective  MTF measurements  corrections  misconceptions
home  about  photos  optics  faq  sitemap