AT logo - The Machine Vision Specialists  
  Cameras  
  Frame Grabbers  
  Lenses  
  Lighting  
  Software  
  Vision Systems  
  Accessories  
  News  
  Careers  
  Contact AT  
  Site Map  
Request product information

Contact
info@adeptturnkey.com.au

Perth:
(08) 9242 5411

Sydney:
(02) 9905 5551

Melbourne:
(03) 9384 1775


Defence Recognised Supplier Scheme Logo

 

Depth of Field

A discussion paper - Adept Electronic Solutions

INTRODUCTION

This is the first in a series of discussion papers by Adept Electronic Solutions Pty Ltd that talk about aspects of machine vision that are often misunderstood. We welcome comments, questions and any criticisms. If you want further explanation of anything in this paper please contact us.

The paper commences with a discussion of the basis for which Depth of Field is defined. It then talks about “rules of thumb”, defines Depth of Field and Circle of Confusion and finally explains how to calculate Depth of Field.

With Optics as with all aspects of technology, there is an historical perspective that often needs to be understood in order to fully appreciate a subject topic. This history often explains the commonly accepted norms that are often based upon empirically derived measures. A good example is the decibel unit as related to sound. Decibel is an accepted unit of sound but what is it? Sound intensity is expressed in decibels. One decibel is defined as the “just noticeable difference” in sound intensity for the normal ear.

While this example is not related to the topic of this paper it serves as a good example of how a unit of measure is created, becomes the foundation of a technology and yet is based upon historically and empirically derived measures that are often subjective. Having said this it does create a measuring stick that can be used relatively. Let’s return to optics. The discussion that follows in the next few paragraphs applies specifically to 35mm photography and is very empirical in its approach. It clearly defines the basis upon which Depth of Field is defined and measured. It also applies directly to machine vision albeit with some differences that will be explained later in his paper.

Depth of Field is an often misunderstood term. It is defined as the range of distance from the camera, from near to far, which appears to be in focus. A commonly understood principle is that if a lens is “stepped down” (i.e. the iris (aperture) is made
smaller) the Depth of Field is increased. A common misconception is that wide-angle lenses have a greater Depth of Field than telephoto lenses. Following is a discussion on Depth of Field and hopefully a clarification for those that do not understand this topic clearly. At the end of this paper there are formulas that will allow you to calculate Depth of Field.

UNDERSTANDING Depth of Field

Depth of Field cannot be understood unless Circle of Confusion (or Diffraction Spot Size) is understood.

Circle of Confusion - Definition: "A group of vision engineers sitting around trying to understand Depth of Field". Not really, just kidding!

Circle of Confusion defines what is in focus versus what is out of focus.

The human eye has a finite ability to see fine detail. The smallest arc that an eye can see is 1’ (minute) or 1/60th of a degree. If you extend that arc out to a normal reading distance (200mm) we can calculate using simple geometry that the smallest object that a person with “perfect eyesight under ideal conditions” can see is 1/16th mm in size. This means that if you were to place two small dots less than 1/16th mm apart from each other they will appear to be just one dot. This size (1/16th mm) is in fact much smaller than what is generally accepted and the photographic industry long ago settled on 1/6th of a millimetre as the smallest point that can be clearly discerned by the average person under normal conditions.

The discussion is clearly very subjective and empirical in its nature. This is mainly due to the fact that we’re discussing photography and the end result, which is the perceived quality of an image by a person is in itself very subjective and dependent on the quality of that person’s eyesight. However 1/6th mm does provide a generally accepted baseline for the Circle of Confusion as applied to photography. When applied to machine vision and camera sensors with fixed pixel sizes the discussion becomes less empirical and less subjective as will be discussed a little later in this paper.

Expressed as a decimal, 1/6th of a millimetre equals 0.1667mm. For the purpose of this discussion a standard photograph is accepted to be approximately 5”x7”. This photograph has been blown up from a 35mm negative film and is about 5 times larger than the 35mm film. In order for this standard size photograph to have a Circle of Confusion of 0.1667mm the photographic film must have a Circle of Confusion that is proportionally smaller. i.e 0.1667/5 = 0.0333mm (33micron). This is the Circle of Confusion that many 35mm lens manufacturers use when establishing their Depth of Field tables and lens markings yet do not specifically define it. It is an historically accepted standard in photography. What about machine vision where the human eye has nothing to do with it!

The ability of a CCD sensor to discern detail is related directly to the sensor pixel size. The pixel size of industrial machine vision cameras generally varies from around 6 micron to 20 microns, although some modern CCD sensors have pixels smaller than 6 micron. An important point to make with regard to pixel size is that the smaller the pixel, the smaller theCircle of Confusion of the lens needs to be in order to optimise the resolution of the system. For example if you have a camera with a pixel size of 4 micron and a lens with a Circle of Confusion of 8 micron then features in the image that are smaller than 4 micron ( should fit within 1 pixel) are smeared across two pixels or more. The resolution of the lens is not perfectly matched to the sensor. Manufacturers of quality machine vision optics should specify the Circle of Confusion number when specifying Depth of Field. They may also call it Diffraction Spot Size. If they don’t then you need to question if this lens is suitable for your machine vision application. You can’t manage what you can’t measure. Now that we understand what Circle of Confusion means we can see what this definition of Depth of Field means.

Depth of Field (DOF) Definition: "The range in front of and behind a focused subject in which the photographed image appears sharp".

The range in front of and behind the subject focused on, which will appear sharp. Sharp means within the limits of the applied Circle of Confusion. In other words, you
can't have a meaningful Depth of Field number without a specified Circle of Confusion number.

Please note that the discussion in the following paragraph uses the formulas at the end of this paper.

As a concrete example of all of this, a 50mm lens, focused on a subject approximately 3048mm away, at an aperture of f/5.6, and using a Circle of Confusion of 30
lines/mm (0.0333mm), will have a near focus point of 2490mm and a far focus point of 3926mm. In other words, it will have a Depth of Field of 1436mm (3926-2490=1436). Stop down (reduce the lens iris size) to f/16 and the Depth of Field becomes almost 6705mm. Reducing the iris aperture size can increase the Depth of Field! This however, also reduces the amount of light being transmitted though the lens and so may require brighter illumination.

The 1/3 to 2/3 Rule

One of the laws of optics is that the Depth of Field extends from one third in front of the point focused on, to two thirds behind it. In other words, you have twice as much
Depth of Field behind your point of focus than in front of it. Look at a Depth of Field table, the Depth of Field scale on a lens, or use a computer program to make the
calculation and you will see that this rule applies.

HyperFocal Distance: Definition: "The closest point of focus at a given aperture, at which infinity falls within the Depth of Field."

For landscape photographers this is a critical number. This is the point at which you would focus the camera so that everything from that point out to Infinity is in focus. The converse is that the closest point that is in focus is at half the hyperfocal distance. The Hyperfocal distance is a measure that is calculated in order to calculate Depth Of Field. Using the example we had above of a 50mm lens, set to f/16, the hyperfocal distance is 687cm. Half that is 343.5cm. So, by focusing this lens at a point 687cm away everything will be in focus from roughly 343.5cm to Infinity.

Depth of Field/Focal Length and Image Size
"Many people believe that wide angle lenses have more Depth of Field than telephoto lenses."

Why is this such a common misconception? It seems logical. Wide-angle lenses appear to have more Depth of Field than long focal lenses. They appear to but only when you don't take subject size into account. Here is an explanation by example. Use different focal length lenses to take a series of images of the same object. When taking the images you move closer or further away from the object (depending on the lens used) so that the object remains the same size in the image regardless of the lens used. For example you take an image with an 8mm lens of a person. The person happens to be exactly half the height of the image. Then you use a 16mm lens. If this image is taken at the same distance from the person then the person will appear much larger in this image than the first, so the camera needs to be moved further away in order for the person to be half the height of the image. You will find that the Depth Of Field is the same for both images. Why? Because it is the law of physics. A practical and easy way to think of this is to say that Depth of Field is inversely related to the magnification of the image. Magnification is not only dependent on the focal length of the lens, but also on the distance of the camera from the object being imaged - Working Distance.

Magnification is:
Sensor Size / Field Of View

Digital Advantage

The formula above clearly shows that Magnification is not only dependent on focal length of the lens and working distance but also on sensor size. CCD cameras typically demonstrate a greater Depth of Field than 35mm film cameras? The reason for this is that the imaging chips on most CCD cameras are small compared to 35mm film. All things being equal the image size (Field Of View) from a smaller sensor will be smaller. Conversely to get the same image size from a smaller sensor the lens must have a wider angle ( shorter focal length). This means that a normal lens for a CCD format is as short as 8 to 16mm whereas the normal for 35mm film is 35 to 50mm. Therefore a CCD camera with a smaller sensor and shorter focal length lens has a smaller overall magnification ratio and hence a bigger Depth of Field. To balance this off however, be aware that a smaller sensor with the same resolution requires a smaller pixel size and so requires a better Circle of Confusion from the lens. This topic will be discussed in more detail in a later discussion paper.

HOW TO CALCULATE Depth of Field
Hyperfocal Distance - H
H= (L x L) / (f x d)

Where

H = Hyperfocal Distance (mm)
L = lens focal length (mm)
f = lens aperture f-stop
d = diameter of Circle of Confusion (mm)
Near Focus Limit - NF
NF = (H x D) / (H + (D – L))

where

NF = Near Focus Limit (mm)
H = Hyperfocal Distance (mm)
D = working distance i.e. distance from end of lens to object (mm)
L = lens focal length (mm)
Far Focus Limit - FF
FF = (H x D) / (H – (D – L))

where

FF = Far Focus Limit (mm)
H = Hyperfocal Distance (mm)
D = working distance i.e. distance from end of lens to object (mm)
L = lens focal length (mm)
Depth of Field - DOF
DOF = FF – NF

where

DOF = Depth of Field
FF = Far Focus Limit
NF = Near Focus Limit

 

 

If you like this page, please recommend and share it.

Facebook Twitter More