Choosing a lens for machine vision

When inspecting an array of parts, systems integrators must first carefully determine the image quality that is needed for their imaging system.

Th 93403

When inspecting an array of parts, systems integrators must first carefully determine the image quality that is needed for their imaging system.

By Andrew Wilson,Editor

At trade shows, OEM vendors are given the opportunity to market their latest machine-vision and image-processing products. These shows also provide engineers from manufacturing organizations with the opportunity to quiz vendors about their own product designs. These engineers present OEM vendors of lenses, optics, and sensors with their company's products or subassemblies and attempt to learn how their parts must be imaged as part of an automated production inspection system. In this way, they gain important imaging information on preparing their image-processing system design.

Although these products can range from chips to boards, each specific automated inspection task presents a series of imaging-related problems. One of the most important issues that must be initially resolved is the type of imaging optical device, lens, and sensor needed to acquire an image of enough quality so that the inspection task can be satisfactorily accomplished.

Th 93403
Every component within a system has an associated MTF and, as a result, contributes to the overall MTF of the system. If the minimum contrast needs to be 35% and the image resolution required is 30 lp/mm, the double-Gauss lens (bottom) is a logical choice.
Click here to enlarge image

To do this, end users, systems integrators, and design engineers need to understand how image quality is specified. Unfortunately, while many vendors understand the importance of key lens characteristics, such as field of view, working distance, resolution, contrast, depth of field, sensor size, and modulation transfer function, they seem reluctant to share how this information relates to the products they are selling. Nowhere is this more common than in the manufacturer's definition of "resolution."

On many Web sites, resolution is generally defined as 640 X 480, 1280 X1024, or 2048 X 2048 pixels, and so forth, at a number of bits per pixel that ranges from 8 to 14 bits. Indeed, some manufacturers promote the idea that the larger the number of pixels associated with the imager and the larger the number of bits per pixel, the higher the resolution that can be obtained. Of course, all these specifications must be placed in context; otherwise, the information becomes confusing.

Charting the charts
To properly determine the image quality obtained from a lens, CCD sensor, or camera system, the spatial-frequency response of the system must be determined. This measurement, known as the modulation transfer function (MTF), determines how well the contrast of an image is preserved in percentage terms after it passes through a lens, CCD, or complete imaging system. Typically, MTF charts plot the percentage contrast loss against resolution measured in line pairs per millimeter (lp/mm).

Th 93404
FIGURE 1. RCA "Indian Head" video test pattern developed in 1939 was created by a monoscope, which contained a metal plate target on which the pattern was printed. Because the pattern contains no gray tones, it is not well suited to estimating MTF and is now obsolete.
Click here to enlarge image

The MTF plots are a valuable resource when evaluating whether a lens is suitable for a particular application, However, many companies do not readily offer this information. Systems integrators must insist on obtaining this information from lens, imager, or camera manufacturers or choose to measure the parameter using one of several available test patterns often targeted to their particular application.

Several manufacturers, organizations, and Web sites provide a number of popular video test-pattern charts. Perhaps the most famous one is the so-called "Indian Head" monoscope pattern developed by RCA in 1939 for video broadcast applications (see Fig. 1). This image was created by a CRT (monoscope), which contained a metal plate target on which the test pattern was printed. The black lines within the pattern interrupt the current flow as the pattern is scanned to provide the desired video output. Because these tubes were monochrome and not gray scale, shades of gray were simulated either with a halftone dot pattern or with patterns of fine lines.

Because the Indian Head pattern contains no gray tones, it is not well suited to estimating MTF and has therefore become obsolete. Despite this, the test pattern did form the basis for a number of subsequent test patterns that were developed specifically for machine-vision and image-processing applications. These patterns, supplied by such companies as Edmund Industrial Optics (Barrington, NJ), Max Levy Autograph (Philadelphia, PA), and Sine Patterns (Pittsford, NY), form the basis for current MTF measurements.

To meet the needs of different applications, a variety of test charts exist. These include the Photographic and Imaging Manufacturers Association (PIMA) Standards 12233 chart from the International Imaging Industry Association (IIIA; Harrison, NY) and the STD- 208-1995 chart from the IEEE (Piscataway, NJ). While both charts can be used to test the resolution of electronic camera systems, other charts are available, such as the FBI Scanner Test Chart for gray-level and resolution testing of the Integrated Automated Fingerprint Identification System and the NBS 1010A Microcopy Test Chart.

Measuring MTF
Whereas the MTF of a lens, CCD sensor, or imaging system is normally measured using expensive sine-wave test charts and elaborate procedures, test charts such as the PIMA Standards 12233 chart provide bitonal resolution patterns that use slightly slanted black bars to measure the spatial-frequency response (SFR) of the system (see Fig. 2). While SFR provides the amplitude response of the lens or device under test as a function of relative input spatial frequency, the measurement closely approximates that for the MTF.

Th 93405
FIGURE 2. While the modulation transfer function of a lens, CCD sensor, or imaging system is normally measured using expensive sine-wave test charts and elaborate procedures, test charts such as the PIMA Standards 12233 are lower-cost bitonal resolution patterns that use slightly slanted black bars to measure the spatial-frequency response of the system.
Click here to enlarge image

Typical test charts consist of a series of bars or square-wave patterns of increasing frequency. When an image is formed of the chart bars by an imaging system, it is blurred with an illumination described by the point-spread function. As this frequency increases, the optical information passing through the lens, CCD, or camera system looses contrast, with a resultant loss of amplitude and a reduction in contrast.

Although MTF measurements can be made by machine-vision-system designers and developers, MTF data also can be obtained from manufacturers of imaging components such as lenses, CCDs, and cameras. Firstsight Vision (Tongham, Surrey, UK) is the distributor of the Vortex line of lenses, developed specifically for machine-vision applications. With each lens, Firstsight offers standard MTF charts that developers can use to characterize the lens (see Fig. 3). The MTF plots represent three company lenses: the VC03514—a 1/2-in., 3.5-mm, ƒ/1.4 lens (red); the VC8014—a 2/3-in., 8-mm, ƒ/1.4 lens (green); and the VC7527—a 2/3-in., 75-mm, ƒ/2.7 (in blue).

Th 93406
FIGURE 3. At low frequencies, all lenses will exhibit an MTF of nearly 100%. Using the VC03514 (red) results in an approximate 28% loss of contrast at a 100-lp/mm resolution. Although the curves show how MTF affects lens performance, they err in that only lenses with identical or similar focal lengths should be compared.
Click here to enlarge image

At very low frequencies, all lenses exhibit an MTF of nearly 100%. And, the closer the curves are to 100% on the graph, the higher the contrast and resolving power. The VC03514 lens, for example, exhibits an approximate 28% loss of contrast at 100 lp/mm. Similarly, the VC8014 lens results in an approximate 70% loss of contrast at the same resolution. In comparing the VC8014 and VC7527, note that while the former lens offers good resolving power and good contrast, the latter lens provides good resolving power but poorer contrast.

Although these curves demonstrate how MTF affects lens performance, it is unfair in that, when using MTF measurements, only lenses with identical or similar focal lengths are compared. In the lens comparison example, lenses with focal lengths ranging from 3.5 to 65 mm were compared. Focal length, the distance from the lens to the point where the image is in focus, indicates the power of the lens and its field of view. The longer the focal length of the lens, the more resolving power it possesses, the larger the image, and the smaller the field of view. For example, the VC7527 lens with a focal length of 75 mm delivers more than nine times the resolving power and one-ninth the field of view of the VC8014 8-mm lens.

CCDs and focal lengths
Because the focal length is relative to the size of the CCD sensor, lenses are not interchangeable among CCDs of different dimensions. This is why, for example, lens manufacturers specify their lenses for use with 1/4-, 1/3-, 1/2-, 2/3-, and 1-in. cameras. If a smaller-format lens is used with a particular imager, then the image may suffer vignetting, which produces an apparent aperture with a nearly elliptical shape. Alternatively, using a lens designed for a larger format will result in lens flare and low contrast.

For a CCD-based camera, the MTF also suffers from the limitations of pixel size, dynamic range of the pixels, and pixel crosstalk. During operation, a CCD sensor can transmit its maximum line-pair number only if a dark bar falls specifically on a pixel and a bright bar on the neighboring pixel. Therefore, the maximum line-pair number that a sensor with a pixel dimension "d" can transmit, is 1/(2d). For example, the IA-D4 sensor from Dalsa (Waterloo, Ontario, Canada) features 1024 X 1024 imaging elements and a pixel size of 12 X 12 µm. The maximum number of line pairs that the sensor can resolve is therefore approximately 41 lp/mm.

Mark Butler of Dalsa explains, "This means that at the sensor (image) plane the best resolution is about 41 lp/mm. Due to magnification, however, there can be a different resolution on the object plane but 1 lp/mm usually refers to the image plane. Thus, 41 lp/mm represents the maximum contrast transfer function (CTF) of a given sensor.

To obtain 41.67 lp/mm, the black-and-white transition must be perfectly placed upon each pixel. The best the MTF value can be is 0.5*CTF, because MTF measurements require the movement of the object and due to a averaging, the best case is 0.5*CTF

Equipped with this information, systems integrators must next understand the spatial-frequency response that is required to image the object, the distance of the optical system from the part being inspected, and the lens required to accomplish this imaging. This approach is application-specific.

If the smallest feature size to be imaged is 100 µm, for example, and each element in the CCD array is 10 µm wide, the magnification required is approximately 10X. After the lens magnification (M) is determined, the lens focal length can be calculated by dividing the total distance from the image plane by (M + 2 + 1/M). If, for example, the object is 300 mm away, then the focal length of a lens with a 10X magnification is 300/(10 + 2 + 0.1), or approximately 25 mm (see Vision Systems Design, Nov. 2000, p. 43 or

Every component within an imaging system has an associated MTF. The resulting MTF of the system is the product of all the MTF curves of its components.

Company Information
Waterloo, Canada N2V 2E9

Edmund Industrial Optics
Barrington, NJ 08007

Firstsight Vision
Tongham, Surrey GU10 1DW UK

New York, NY 10016

International Imaging Industry Association
Harrison, NY 10528

Max Levy Autograph
Philadelphia, PA 19144

Sine Patterns
Pittsford, NY 14534

Sony Electronics
Park Ridge, NJ 07656

More in Cameras & Accessories