Learn practical tips for applying optics in real-world applications.

No matter what components may be part of a machine vision application, there is one that simply cannot be eliminated or compromised: the lens. The fundamental purpose of the lens in the imaging chain is to capture reflected or directed light rays and reduce-or in some

cases enlarge-those rays so that they fit the size of the target image sensor relative to the desired real-world field of view (FOV). In addition, other optical components may be used in machine vision to modify or enhance the image, but always in concert with a lens as the main optical component.

Here are some tips that may help with your next machine vision project.

Lens Selection Made Easy

A wide variety of lenses are available for use in machine vision, but selection of a lens begins with a simple calculation of either focal length or magnification. The required input data are the desired size of the real-world image or FOV, the size of the camera sensor that will be used for imaging, and for the focal length calculation to be the desired working distance from the lens to the object. Most camera sensor chips are designated by diagonal size, that is: ⅓, ½ and ⅔ inch. In reality these chips vary somewhat in horizontal and vertical dimension. Normally the horizontal dimension is larger than the vertical dimension. For example, a typical ½ inch sensor is 6.4- by 4.8-millimeters (mm) in physical size.

To calculate an approximate required lens focal length for an application, divide the desired working distance by the desired field of view, and multiply that by the sensor size.

Required FOV in the vertical direction: 50 mm
Desired working distance: 400 mm
Sensor size in the vertical direction: 4.8 mm
Probable lens focal length or f-number: approximately 38 mm

To calculate the desired magnification, take the smallest physical dimension and divide that dimension by the desired real-world FOV for that imaging direction.

Required FOV in the vertical direction: 50 mm
Sensor size in the vertical direction: 4.8 mm
Required magnification: approximately 0.1X

These numbers will be close to the actual lens specification, but there are things to remember. A lens with the exact f-number from the calculation likely will not be available. Compromise in FOV or working distance will have to be made. Also, the calculation does not take into account lens limitations per manufacturer design and construction. Even when the formula yields a specific focal length, a commercial lens with that focal length may not be physically able to produce an image at the desired working distance. Use the formulas as a starting point, and carefully review manufacturer specifications for candidate lenses to be sure.

Use Machine Vision Lenses

Camera lenses in general are a commodity item. The product is mass-produced for uses other than machine vision, for example, security imaging. However, because a machine vision task often relies on a high level of image quality, many manufacturers offer a specific product line targeted for machine vision applications.

In particular, lenses manufactured for machine vision applications have higher-quality optics and usually multiple optical components, resulting in more accurate image reproduction. One measure of image quality is the number of line pairs per millimeter that the lens is able to accurately reproduce. For example, the higher the lines per inch (LPI), presumably the more accurate the lens.

While this is a good measure, a more accurate specification is the Modulation Transfer Function (MTF) of the lens. Simply put, this metric is a relationship between the number of LP/mm reproduced and the contrast level at varying numbers of line pairs. The greater the MTF of a lens, the better the spatial frequency response, producing a sharper, higher contrast image. However, be aware that there is no industry standard for lens testing, so the numbers are inconsistent from brand to brand. Regardless, it is important for any machine vision application to achieve the best possible contrast and image accuracy. Always use a quality machine vision lens.

Be creative with lens selection and be prepared to make compromises in physical layout in order to match the best lens with the application. When in doubt, seek assistance from machine vision experts and product manufacturers for assistance with optical design.