Global TMW:
Login  |  Register          Free Newsletter Subscription
Subscribe
Email
Print
Reprint
Learn RSS

Make sense of lens specs

Understand lens specifications before you design a vision system.

Jon Titus, Contributing Technical Editor -- Test & Measurement World, 9/1/2005

READ OTHER SEPT. ARTICLES:  Table of contents, Sept. 2005

SEPTEMBER FEATURES:
Vote for the 2005 Test Engineer
of the Year

Measuring space
Tests ride the PCI Express
Boundary scan goes underground

Make sense of lens specs
Guide the light

In a machine-vision system, a camera lens serves one purpose: It gathers light and focuses an image on the camera's sensor. Thus, vision-system designers must treat lenses as key elements in inspection equipment. If cameras cannot gather light and properly "see" what engineers need to inspect, they cannot provide good inspection results. The following sections explain specifications found in lens data sheets and relate them to image-acquisition needs.

Wavelength range. The wavelengths of light that a camera must detect determine which type of lens you must use. Lenses do not pass all wavelengths equally well, so if you plan to inspect in the infrared (IR) portion of the spectrum, for example, you'll need a lens designed for use with IR cameras. Most inspections use visible light, so this article concentrates on lenses for those wavelengths, 400–700 nm.

Focal length (FL). The focal length value specifies the distance between the back end of a lens and the point at which the lens focuses an image on a camera's sensor (Figure 1). A lens operates with a fixed focal length, and a camera's sensor is positioned a fixed distance from the camera's lens mount. Thus, lens manufacturers match their products to camera characteristics and provide lens-and-camera compatibility information.


Sensor size
. Specifications for lenses that work with solid-state cameras list the dimension of sensor they work with. Sensors come in standard sizes (Table 1). The "inch" specification relates to an older technology, but people continue to use it in preference to sensors' metric dimensions. Thus, you will see lenses specified as working with a 2/3-in. sensor, a ½-in. sensor, and so on.

Working distance. The front-working distance, or simply working distance, defines the allowable gap between the lens and an object it can properly focus. Machine-vision lenses have a fixed or a variable working distance that ranges from several inches to several feet. Some lenses may focus out to infinity. Often, a testing environment dictates a working-distance requirement. For inspection on a conveyor belt, you may be able to position a camera just inches from the product, but for inspection during the manufacturing stage, you may find that the manufacturing equipment's robotic manipulators require you to position a camera several feet away.

Figure 1.  Focal length describes the distance from a lens to a camera’s sensor. Working distance indicates the distance at which the lens can focus on an object; a camera can have either a variable or a fixed working distance. 

Field of view (FOV). A lens "sees" only the portion of an object within its field of view, the size of which relates directly to the lens's focal length. The shorter the focal length, the wider the field of view. A camera with, say, a 50-mm focal-length lens can take images of an entire PCB (Figure 2). Switch to a 200-mm focal-length lens, and you will see just one area of the board. This smaller FOV can offer a resolution benefit: Because the sensor images a reduced area, more pixels cover each square centimeter, thus improving the resolution of small features.

If a vision system must examine an entire PCB, the camera's lens must provide a sufficiently large field of view to "see" all components and features on the board. Suppliers often specify linear field-of-view dimensions (horizontal and vertical) over a lens's working distance.

Figure 2.  A short focal-length lens (top) produces a larger field of view (FOV) than a longer focal-length lens (bottom). The larger FOV includes an entire PCB, but the smaller FOV may better resolve what it inspects. (Image is not to scale.) 

You can calculate the angular field of view based on a sensor's dimensions and a lens's focal length:

angular FOV = 2 * arctan [(d/2)(1/FL)]

where:

d = the sensor's dimension, and

FL = the lens's focal length.

Thus, for a 1-in. sensor (16-mm diagonal) and a 75-mm focal-length lens, the angular FOV equals:

2 * arctan [(16 mm/2)(1/75 mm) = 12°

For the same sensor, a 20-mm focal-length lens provides a 44° FOV.

Keep in mind that the field of view varies depending on the sensor dimensions you use to calculate it. Thus, the 20-mm focal-length lens and the 1-in. sensor provide a FOV of 35° parallel to the sensor's horizontal dimension (12.7 mm) and a 27° FOV parallel to its vertical dimension (9.5 mm). Remember, too, that a rectangular sensor provides a rectangular field of view.

Depth of field. The depth of field specifies the distance over which an object remains in focus for a given lens setting (Figure 3). If you plan to inspect solder paste on a bare PCB, you can work with a shallow depth of field—the distance from the PCB surface to the top of the solder paste. If you must inspect both surface-mount (SMT) components and tall components on a PCB, you will require a lens with a deep depth of field.

Figure 3.  Varying the aperture of a lens changes the depth of field so a camera can inspect SMT components in a shallow space or inspect tall components in a deeper space.

Manufacturers may specify a depth of field for various lens settings, but you should determine depth-of-field values by experimenting with several lenses that meet most of your other needs. The size of a lens's aperture also affects depth of field, as described in the next section. (You can calculate depth of field, but the theory and math go beyond the scope of this article.)

F. No one seems to know what word the letter f stands for in lens specifications, but it denotes a focal-length to aperture-size ratio, shown in data sheets and on lenses as the letter "f" and a number, or as a ratio. Thus, if you have a 100-mm focal-length lens with a 50-mm maximum aperture (100/50 = 2), the lens carries the designation f/2, which is spoken as "f two." Or the lens may have the ratio 1:2.0 printed on it.

Manufacturers often sell a lens family with fixed apertures such as f/2 (1:2.0), f/2.8 (1:2.8), and f/4 (1:4.0). The larger the ratio, the larger the aperture, and the more light a lens passes to a sensor. Thus, a 100-mm f/2 lens admits more light than a 100-mm f/4 lens. For a given focal length, larger-aperture lenses cost more to make, though. So, if you have plenty of light, you might choose a less expensive f/2.8 lens instead of an f/2 lens.

Many lenses include an adjustable iris that changes the aperture in preset steps so engineers can vary, or "stop," the amount of light that reaches a camera's sensor. By adjusting the light, they ensure good contrast between light and dark areas in an image, which simplifies image-processing tasks. (And they avoid saturating the sensor.)

Aperture closures occur in preset "f stops" numbered 1, 1.4, 2.8, 4, 5.6, 8, 11, 16, and 22. From left to right, each stop cuts in half the light that passes through a lens. As the number increases, light decreases and depth of field increases. To compensate for the reduced light transmission of a smaller aperture, you can use bright LEDs or a strobe light to illuminate products undergoing inspection.

Lenses also can have "in-between" f stops, but the series of numbers shown above are the most common. That numerical series represents integer powers of the square root of 2—the ratio of the aperture diameters that result in a twofold change from one f stop to the next. Specs for variable-aperture lenses note a range of values from the minimum to the maximum, say f/1.4–16, which means full-open aperture of f/1.4 and full-closed aperture of f/16.

Resolution. Resolution specifies the ability of a lens to separate small nearby objects in an image. (Image resolution also depends on the number of and dimensions of the pixels in a sensor.) To determine resolution, lens manufacturers measure a lens's modulation transfer function (MTF). The MTF expresses how well a lens separates pairs of equal-width black and white lines (100% contrast) in a pattern.

Because no lens is perfect, the lines start to blur in the camera's image as they become narrower and narrower. At some small spacing, the camera cannot resolve individual lines. Eventually, the image becomes all gray (0% contrast).

Resolution requirements vary by application, so lens suppliers graph MTF test results. A graph plots percent contrast vs. the number of line pairs per millimeter so you can evaluate resolutions and lens types. (For more about MTF, see Ref. 1).

Lens mounts. Most machine-vision cameras accept C-mount (cine-mount) or CS-mount (cine-short-mount) lenses, although some cameras offer less popular lens mounts, too. An adapter lets a C-mount lens work with a camera designed for CS-mount lenses. This adapter extends the lens an additional 5 mm from the camera body. A CS-mount lens will not work with a C-mount camera, though. Always check focal-length and lens specs before you mix lens-mount and camera-mount types.

Filter mounts. Lenses may accommodate filters on the front or the back, depending on model and manufacturer. A data sheet should list the specifications for the filters a lens can accept and the filter-mount mechanical requirements, usually a diameter and thread type. Lens manufacturers and third parties sell a variety of filters.

Color filters can enhance the contrast of components or markings and eliminate extraneous information from an image. A red filter, for example, enhances blue markings while it reduces the contrast of red objects.

If you consider using a color filter, ensure a match of camera, filter, and light-source spectral characteristics. Polarizing filters can reduce or eliminate reflections from nonmetallic surfaces, although they attenuate all wavelengths somewhat.

Neutral density filters attenuate all frequencies equally and have the same effect as adjusting a lens to a higher f-stop. A neutral-density filter, however, attenuates light so users don't have to reduce a lens's aperture. This enables a user to reduce light without changing the lens's depth of field. (You also can reduce the quantity of light that reaches a sensor and maintain depth of field by increasing a camera's shutter speed.)

Choosing a lens involves trading off depth of field, working distance, and field of view as well as evaluating resolution and mechanical mounting needs. If you rely solely on data sheets for information, though, you may find that no off-the-shelf lens meets your requirements. Lens vendors employ application engineers and optical scientists who can analyze your requirements and offer suggestions. Their experience may lead to a compromise you hadn't thought of.

Detector format (in.) Diagonal (mm) Horizontal (mm) Vertical (mm)
1/7 2.3 1.9 1.5
1/6 2.7 2.2 1.6
1/5 3.2 2.6 2.2
1/4* 4.5 3.6 2.7
1/3* 6.0 4.8 3.6
1/2* 8.0 6.4 4.8
2/3* 11 8.8 6.6
1* 16 12.7 9.5
* indicates sensors found in most machine-vision cameras


References
  1. Sadoulet, Samuel, "Transfer Functions Influence Lens Choices," Test & Measurement World, August 2000. p. 21.

Email
Print
Reprint
Learn RSS

Talkback

We would love your feedback!

Post a comment

» VIEW ALL TALKBACK THREADS

Related Content

Related Content

 

By This Author

Sponsored Links



 
Advertisement
SPONSORED LINKS

More Content

  • Blogs
  • Podcasts

Blogs

  • Martin Rowe
    Rowe's and Columns

    July 8, 2008
    Introducing...Test ideas
    Beginning in the T&MW August print issue, we’ll replace the “Project Profile” ...
    More
  • Martin Rowe
    Rowe's and Columns

    May 28, 2008
    More on Bill and Dave
    In my January 11 posting, "Tell your Bill and Dave Stories," I asked if the HP Way still e...
    More
  • » VIEW ALL BLOGS RSS

Podcasts

Advertisements





NEWSLETTERS
Click on a title below to learn more.

Test Industry News (3 Times Per Month)
Machine-Vision & Inspection (Monthly)
Communications Test (Monthly)
Design, Test & Yield (Monthly)
Automotive, Aerospace & Defense (Monthly)
Instrumentation (Monthly)
Resource Center E-Alert (Monthly)
©2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy
Please visit these other Reed Business sites