Quality Magazine

Machine Vision Lighting Demystified

May 1, 2007
LED backlight illuminates the profile of electronic component leads. Note the use of a mirror to direct the light into the lens. Source: Aptúra

The task of illuminating parts for a successful machine vision application has been called by some a science and by others an art. But nearly everyone agrees that correct lighting has a huge impact on the success of any machine vision project. Most experts say that the quality of the image contributes more than 80% to the outcome of any machine vision system design. It is not surprising, then, that in a well-designed machine vision system, lighting plays a huge role, and the illumination source may be one of the most important components to consider in the application.

The critical goal in the design of lighting for any particular machine vision task is to create contrast between the features that are important to the inspection and the background. A feature may be an object to be located or measured, or a defect to be detected. When this feature to background contrast, or signal to noise ratio, is very high, the resulting image processing and analysis will produce more accurate results. For assembly verification there will be less false rejects and false accepts because there is less feature ambiguity. In metrology, the resulting measurement accuracy will be better. In many cases, processing speed actually will be better because less preprocessing and other manipulation of the image is required when the target features are clearly defined in high contrast relative to the background.

An equally important consideration regarding the lighting of a part is maintaining consistency of the illumination from one image to the next. Two key contributors to inconsistent lighting are part presentation and ambient light. When the illuminated surfaces of an object change position or angle with respect to the camera, the light that bounces off that surface also changes direction. Those changes in reflected light may result in a significantly different image arriving at the camera, and inconsistent results in processing.

This white LED strobed ring light is used to capture high-speed part movement. Source: Applied Vision

Inconsistency in part presentation might be successfully overcome with proper lighting, though in all cases it is a good idea to constrain part position as much as possible for the machine vision application because mispositioned parts may have a detrimental affect on other aspects of the application beyond imaging.

Ambient light is light that is reflected off of the part being inspected that comes from sources other than the lighting components selected specifically for the machine vision application. It may be the overhead lights in the plant, or the sun shining through a window or skylight. Ambient light is inconsistent by nature, and the affects of ambient light on an application are usually dramatic and negative. If possible, the dedicated illumination sources for the machine vision imaging must overcome, or be significantly brighter than, the ambient light sources. Often, the ambient light is too strong or unpredictable, and the inspection area must be shrouded to block the ambient light. It is almost never acceptable to use ambient light alone for a machine vision application; the cost of the dedicated illumination and shroud, where appropriate, will be repeatedly repaid in terms of consistency and reliability of the resulting inspection.

One additional task that often is delegated to lighting in machine vision is that of stopping or freezing the motion of a part. Certain light sources can be flashed on or strobed for very short durations. The moving part is illuminated for only microseconds, making it appear to the camera to be motionless.

With this understanding of why lighting is so important to a machine vision application, and the goals that are targeted when specifying lighting for machine vision, consider a few basic principles of implementation.

The effect of low angle illumination, sometimes called darkfield illumination, is shown. Edges and edge defects are highlighted. Source: Aptúra

The Basics

Any image is produced by light reflected off of an object and transmitted through optics to the camera. With optical components-lenses, filters, prisms-the path of the light and the resulting image that arrives at the camera can be scientifically predicted and accurately modeled. As such, the specification and selection of lenses and other optical parts can be easily accomplished using well-established formulas. However, there is, unfortunately, no comparable set of formulas or rules that can be followed in the selection and implementation of a light source, though certain scientific principles of the behavior of light allow one to estimate the correct lighting techniques.

Reflection is the operative principle when evaluating the correct lighting for machine vision. The rule for reflection is that angle of reflection always is equal to the angle of incidence. In other words, when a light beam strikes a surface point at a specific angle, whatever portion of the beam is reflected will travel at the same angle away from the point but in the opposite direction. A mirror is an almost perfect reflector and a good example of this concept. A point of light directed at an angle of 45 degrees relative to the surface of the mirror will bounce off the mirror at exactly 45 degrees away from the original point source.

Of course, most surfaces are not perfect reflectors. Further, most light sources produce illumination that is made up of scattered light waves. The individual beams of light, therefore, reflect off a surface at different angles depending on the surface properties. In general, the reflections from a surface are categorized as either specular or diffuse, and in fact, many objects will have multiple surfaces, or areas on a single surface with different reflective properties.

Diffuse reflections occur when the properties of a surface cause the beams of light to be broken, or diffused. Only a portion of the intensity of the original beam gets reflected into the camera; the rest go off in different directions. Specular reflection happens where the beams of light projected onto the surface are reflected into the camera at a brightness level close to the intensity of the original beam.

For reference, most of what humans see with their eyes is diffuse reflection. This is due partly to the diffuse reflecting surfaces that are in offices, homes or in nature. It also is partly because most of the light sources in everyday lives are highly diffuse, such as the fluorescent lamps overhead, or the cloudy day. Occasionally, a bright glint from some highly specular reflective surface is seen, and that spot often stands out and catches one’s eye. Note that this specular bright spot is often uncontrolled and undesirable.

Surface color also has a huge impact on the reflection of light. Colors are the result of a specific wavelength of light being reflected from a surface, and all other wavelengths of light being absorbed. If an object appears red, for example, it is only because red light is being reflected back from the surface. If the light shining on the object does not contain any red light waves, then there will be no reflection from the surface and the object will be dark gray or black. By selecting a light source with a specific color, contrast can be manipulated with lighting when the target feature has a consistent color property. The color used in certain machine vision applications may not even be visible to the human eye. It is not uncommon to use ultraviolet (UV) or infrared (IR) illumination to produce images visible to a machine vision camera.

Structured lighting from a laser is used to profile surface defects. Source: Aptúra

Light Sources

Sources of illumination for machine vision vary widely, ranging from fluorescent lamps to specialty lights designed to complement specific inspection applications. Lighting units designed expressly for machine vision are readily available; for everyone except imaging professionals designing lighting in, for example, an OEM application, there is no need to use anything other than off-the-shelf components.

Light sources made from arrays of light emitting diodes (LEDs) seem to be the most widely used lighting for machine vision and for good reason. These little focused lamps come in a variety of colors, several sizes, and can be easily structured into shapes such as ring-lights, linear illuminators and spot lights. The light from an LED array is directional and focused, not diffuse. The individual lights in an LED array can be aimed to deliver illumination at specific angles, and lenses molded into each LED can be selected to deliver the light in different spread angles. To make an LED array a more diffuse source, a semi-opaque diffuser is placed in front of the LEDs.

LEDs last a long time, measured in terms of many years. When the LED degrades, it does so quickly, so there is no long period where the quality of the light for the application is slowly diminishing. However, LEDs are highly susceptible to heat damage-they produce a lot of their own-and high temperatures significantly diminish output and life span. LEDs can be used as strobe lights, and in fact, they can be much brighter and have an even longer life span when used in this way. LED light sources are, however, not as bright as some other available lighting methods; it is difficult to implement them when illuminating very large areas. Even with diffusers, the light is quite directional.

Fluorescent lamps are viable for many machine vision applications. A fluorescent light source produces a truly diffuse light. Although a fluorescent light appears mostly white to the eye, the color of a fluorescent light source varies by the type of tube used. In fact fluorescent light is made from “spikes” of color that combine to make what looks like white light. Fluorescent lights are usually the least expensive source. By design, fluorescent lights flicker on and off at a rate fixed by the electronics driving the light.

When using a fluorescent light, select one that is designed specifically for machine vision. These lights use a high-speed ballast that drives the lamps at 25 to 90 kilohertz. Anything slower than that will cause interference with the camera and make the light intensity inconsistent. Fluorescent lamps have a reasonable life span-in terms of months-but should be replaced well before failure because they degrade slowly. Fluorescent sources are sometimes hard to use on certain parts, cannot be strobed and do not do as well when a directional, non-diffuse light source is needed.

One other type of light source that should be noted is the fiber optic light guide, typically illuminated with a quartz-halogen, metal-halide light constant source or a xenon strobe light source. Fiber light guides can be configured into a variety of shapes and are almost as convenient to use as LED lights. The light from a fiber guide is highly directional and not diffuse, but the brightness and color consistency of the light is generally superior to other sources. However, the life span of the lamps is dismal-sometimes measured in hours. With a strobe lamp though, the short duty cycle of the light can result in much longer life.

LED light arrays and fiber light guides can be focused using lenses or other optics. The light from most sources can be modified with filters and polarizers to obtain different effects.

It may bear repeating here: do not use commercial light sources-incandescent bulbs, lamps-designed to produce ambient light for humans. They simply do not work for machine vision.

LED line lights are used with line-scan cameras for web inspection. The blue light is used in this case to provide contrast for complementary colored defects. Source: Wintriss Engineering

Lighting Techniques

Armed with the knowledge of how light behaves based on the source and the reflectivity and color of a surface, and with the understanding that the purpose of machine vision lighting is to create contrast between the target features and background, it is time to implement a lighting design. This is where science gives way to art.

Any layout of lighting for machine vision is application specific. The way a light source is directed at an object determines which features on the object are brightly illuminated and which features are not.

There are three basic directions from which light can be directed onto a surface. One is where the light comes from a high illumination angle, or low angle of incidence, nearly perpendicular to the surface of the part, sometimes referred to as bright field illumination. With this technique much of the directed light is bounced off of the surface back to the camera. When used with a non-diffuse light source, this technique may produce shadows and glare, but in some cases it is desirable to have shadows to create edge contrast. With some surfaces, and with a high enough angle, the shadows can be reduced and edges further enhanced. A diffuse source or directional source with diffuser from this high illumination angle can create even illumination on many parts with minimal glare, but sometimes with less distinct surface features.

A second basic direction for light to be aimed at a part is with the source at a low illumination angle, high angle of incidence, or nearly parallel to the surface of the part. This technique is sometimes referred to as dark field illumination, but that is not an accurate description of the visible results of this angle of illumination. At this low angle of illumination, flat surfaces will reflect less light back to the camera, and objects with some structure on the flat surface may create some specular reflection or may even produce shadows, both of which can be captured as features by the camera.

LED light is used as a constant diffuse illuminator. This type of light dome provides shadow- and glare-free illumination, even on highly specular parts. Source: Aptúra

The last direction from which light can illuminate an object is from behind, with the object aimed directly at the light and the object in silhouette against the illuminated background. This technique creates distinct sharp edges of the object profile that are suitable for high-accuracy gaging or part location. Of course, with this type of light, no surface features are visible.

Additionally, there are some generally recognized special lighting techniques that may be appropriate for specific applications. These include the use of structured light, on-axis (axial) illumination and constant diffuse illumination.

Successful lighting for machine vision applications clearly is based on scientific principles, but also requires experience and art in the final implementation.

It is difficult to predict exactly how a particular surface will respond to a certain illumination technique with a certain light source, but a good place to start is with an educated guess derived from this basic information. It is best to always test an illumination technique and component, and to that end, the vendors who supply these components can be a good resource.

Wait, there's more. Visit www.visionsensorsmag.com to learn about lighting techniques.

sidebar: tech tips

  • Most experts say that the quality of the image contributes more than 80% to the outcome of any machine vision system design.
  • Reflection is the operative principle when evaluating the correct lighting for machine vision.
  • Sources of illumination for machine vision vary widely, ranging from fluorescent lamps to specialty lights designed to complement specific inspection applications.

Sidebar: High illumination angle (shown with diffuser in front of the light source)

Lighting component: LED, fluorescent, or fiber optic ring light

Applications: Creating reasonably even illumination on non-specular surfaces. Good general illumination where the features have good natural contrast.

Sidebar: High illumination angle

Lighting component: larger focused LED ring light, LED spotlights (for directional illumination), fluorescent lamps (for highly diffuse illumination)

Applications: In the case of non-diffuse illumination creates a brightly illuminated area with highlighted edges and shadows on some features. May be good for surface feature highlights.With diffuse light creates a very uniform even illumination over the entire part.

Sidebar: Low illumination angle

Lighting Component: low angle (“Darkfield”) LED ring light, LED or fiber optic spotlights or line lights

Applications: Enhances surface structures. Creates specular reflection from small surface features and shadows from others. Good for detecting scratches, pits, and other defects on flat surfaces.

Sidebar: Backlighting

Lighting component: Broad area light or spotlight behind the part

Applications: Creates a profile image of the part for sharp edge detection. Can highlight features or defects in fully or partially translucent parts.

Sidebar: Special Technique - Structured Lighting

Lighting Component: Focused line from a linear LED or fiber optic source or a laser line.

Applications: Creates a geometric structure in an image which matches the three-dimensional profile of the surface of the part. May be used for measuring height or for detecting edges on objects with low-contrast but 3D profile.

Sidebar: Special Technique - Constant Diffuse Illumination

Lighting Component: Fabricated light tent or dome, fluorescent or diffuse LED

Applications: Creates a shadow and reflection-free constant light over the entire part. Excellent for evenly illuminating highly specular surfaces.

Sidebar: Special Technique - On Axis (Coaxial) Illumination

Lighting Component: Diffuse LED or fiber light source aimed at a beamsplitter. Some light is reflected from the beamsplitter onto the part. The camera looks at the part through the beamsplitter. The light is in-line with the optics.

Applications: Very even surface illumination with no glare. Lighting is lower intensity.