Home  PhotoGuide

                                                                        

Depth of Field Calculation
 

The Depth of Field derivation uses the Gaussian thin - lens equation                                                                                               

familiar from school science, where u is the object distance (camera to subject distance), v is the image distance and f is the focal length of the lens. This simple geometric analysis provides an estimate of the Depth of Field (the range of distances in object space that are in acceptably sharp focus) for a real photographic lens.
In the simple camera representation, points in object space are mapped to points in image space, in front and behind the focal plane. The circle of confusion is the blur circle that is generated by the diverging and converging cones of light that intersect the focal plane. Points are blurred proportionally to their distance from the focal plane. In the diagram, F is the far focus distance, N is the near focus distance,
c is the diameter of the circle of confusion (our criterion for acceptably sharp focus) and a is the diameter of the camera lens.

 

                                   SIMPLE CAMERA REPRESENTATION
                                                      (not to scale) 
 

                                    OBJECT SPACE                                 IMAGE SPACE

                                                                                        
 LENS      FILM/IMAGE SENSOR                                               

Our starting point is to calculate the far and near focus distances (limits).

For the far focus distance substitute in the thin - lens equation 
                   

where the image distance is obtained from simple geometry (similar triangles).

For the near focus distance substitute in the thin - lens equation 
                   

Rearranging terms, the far focus distance becomes                       

and the near focus distance becomes                                 

The depth of field (DOF) is the difference between the far and near focus distances      

combining terms and rearranging                                                      

and the depth of field reduces to       

Now focus at the hyperfocal distance, then u = H and the far focus distance extends to infinity

and the denominator

Solving for the hyperfocal distance
 
                                           

and since
         

on substituting for the diameter of the camera lens, a = f/f/#, where f/# is the
f - number,
the hyperfocal distance is given by
                            
                                               

In terms of the hyperfocal distance, the depth of field becomes                                                
                                        


For most practical photography the focus distance is much greater than the focal length of the lens (u >> f), so the expression for depth of field simplifies                                                             
                                 

                                  
When the hyperfocal distance is much greater than the focus distance (H >> u),
the approximate
depth of field is given by                                                                        

This formalism is particularly instructive, depth of field is directly proportional to the circle of confusion, the square of the focus (camera to subject) distance and the
f - number of the lens and is inversely proportional to the square of the focal length of the lens. The f - number and focal length are lens parameters, the circle of confusion, our criterion for 'acceptably sharp' is dependent on the viewing geometry and resolving power of the human eye.

From the Gaussian thin - lens equation, u - f = f/m, and for (u >> f), u = f/m,
where m is the magnification. Thus, the depth of field is inversely proportional to the square of the magnification. At lower magnification the depth of field increases,
at higher magnification the depth of field decreases. 

                 

  • at near focus (camera to subject) distances there is less available depth of field, at far focus (camera to subject) distances there is more available depth of field.
     
  • opening the lens aperture (low f - numbers) decreases the depth of field, closing the lens aperture (high f - numbers) increases the depth of field.
     
  • as a fraction of the focus distance, the depth of field for long focal length lenses is small and for short focal length lenses is large (see Depth of Field).
     

Now you can compare the depths of field for cameras with different image formats (digital camera image sensors are different in size and type). For the same field of view, (c/f) is independent of the image format. From a set location (u is constant), cameras at aperture settings (f/#) that are directly proportional to their format sizes (or inversely proportional to their focal length multipliers (FLM)) have the same
depth of field.

A camera that has a focal length multiplier (FLM1), at aperture setting f/# and a camera that has a focal length multiplier (FLM2), at aperture setting f/# x (FLM1/FLM2) have the same depth of field. For consistent image quality, the ISOs must be similarly related.
 

In terms of H, the near and far focus distances, N and F, are given by                      
                                      

  • For a lens focused at infinity u = infinity, the near focus distance N = H.
     
  • For a lens focused at the Hyperfocal Distance u = H, the near focus distance
    N = H/2 and the far focus distance F = infinity.


Further, the ratio of the front depth of field (u - N) to the rear depth of field (F - u)
is given by

                                                                

At focus distance (camera to subject distance) u = H/3, the front depth of field is half the rear depth of field. This is the often quoted '1/3 rule', the depth of field extends 1/3 in front and 2/3 behind the point of focus. For optimal sharpness everywhere, focus 1/3 or thereabouts into your scene. Apportionment of the front and rear depths of field is dependent on the focus distance (for a given focal length and f- number): the rule is only precise at 1/3 hyperfocal distance. As the focus distance decreases, the total depth of field decreases and the front and rear depths of field (the front and rear depths of field are expressed as fractions of the hyperfocal distance) are evenly divided.

                                                   

   Focus Distance     Front DOF        Rear DOF
                                            0
                H             H/2               
                H/3             H/12               H/6
                H/10             H/110               H/90


For close - up and macro photography, magnification is the appropriate working variable. Recall that u - f = f/m, where m is the magnification. With this substitution the relations for far and near focus distance may be recast. In terms of the parameter K = (c f/#)/f, the ratio of the front to the rear depth of field is given by   
  

As the camera to subject distance decreases (and the magnification increases),
the ratio of the front to the rear depth of field approaches unity.
 

One final point, given N and F, the focus distance that positions the depth of field
for optimal effect is given by

                            
                                       

The relationship is useful, provided that you can measure the near (N) and far (F) focus distances.   
                 
 

All images and text © imajtrek