This article is part of our Machine Vision 101 series, where we break down the fundamentals behind reliable vision systems.
By Mark Williamson, Editor-at-Large, MVPro Media
Ask any experienced vision engineer what separates a robust inspection system from one that fails in the field, and the answer is almost always the same: lighting.
Not the camera. Not the software. Not even the algorithm.
Lighting.
It is the most consequential decision in any machine vision project, yet it remains one of the most underestimated. Before any algorithm analyses an image, before a camera captures a single pixel, the illumination has already determined whether the critical features of the object are visible at all.
Get the lighting right, and a difficult inspection can become almost trivial. Get it wrong, and even the most capable system will struggle.
Why Lighting Matters More Than You Think
The role of lighting in machine vision can be stated simply: make the features you want to detect appear as different as possible from those you want to ignore.
In practice, that simplicity hides a great deal of complexity.
The same surface, lit in two different ways, can produce images that appear to show entirely different objects. A scratch on polished metal may be invisible under diffuse overhead light, yet stand out clearly under low-angle illumination. An embossed character may disappear under direct lighting, yet become legible under dark-field conditions.
When light interacts with a surface, several physical effects occur at once, including reflection, absorption, transmission, and scattering. The balance between these depends on the material and surface finish. Effective lighting design is about exploiting these interactions deliberately to maximise contrast.
Geometry: Angle Is Everything
One of the most powerful variables available in lighting design is the angle at which light strikes the object.
In practice, a small number of geometries cover the majority of industrial applications.
Bright-field illumination directs light at the object from the same side as the camera. It is the most common configuration and works well for general surface inspection, print quality checks, and code reading on flat, matte surfaces.
Dark-field illumination introduces light at a shallow angle, typically below 15 degrees from the surface. Flat areas reflect light away from the camera and appear dark, while raised or recessed features scatter light towards the lens and appear bright. This makes it particularly effective for detecting scratches, surface texture, embossed markings, and fine contamination.
Backlight illumination places the light source behind the object, producing a high-contrast silhouette. It is widely used for dimensional measurement, detecting holes, checking fill levels, and inspecting component edges. For precision applications, telecentric backlighting ensures highly parallel illumination and improves measurement accuracy.
Dome and coaxial illumination surround the object with diffuse light, reducing shadows and specular reflections. These approaches are typically used for highly reflective, curved, or irregular surfaces, such as printed circuit boards, wafers, and polished components.
Colour and Wavelength: Seeing Beyond White Light
Machine vision is not limited to white light. Selecting the appropriate wavelength can make the difference between a reliable inspection and an impossible one.
A useful rule of thumb is that light of a given colour will tend to enhance features of a similar colour and suppress those of a complementary colour. Red illumination can improve contrast on red features, while blue or ultraviolet light can reveal fine surface defects and contamination that are not visible under white illumination.
Infrared light can pass through certain materials, including some plastics, enabling inspection beneath the surface or through packaging. When wavelength selection is combined with appropriate filtering, the effect on image quality can be significant.
Lens Filters: Locking Out the Environment
One of the most underutilised tools in machine vision is the optical filter fitted to the camera lens.
Production environments are rarely stable. Overhead lighting, changing daylight, and reflections from surrounding equipment all introduce variation into the image. A system that performs well under controlled conditions can quickly become unreliable once these variables are introduced.
The objective is to ensure that only the intended illumination reaches the sensor.
For example, pairing a red LED light source with a red bandpass filter blocks most ambient light, making the system effectively sensitive only to the designed illumination. This can significantly improve stability.
Additional options include polarising filters to reduce reflections from shiny surfaces, and infrared filters to either block or exploit the sensor’s response beyond the visible spectrum.
Light Source Technology
LED lighting is now the dominant technology in industrial machine vision systems.
It offers a combination of energy efficiency, long operating life, compact form factors, and the ability to be pulsed to freeze motion. LEDs are available across a wide range of wavelengths, from ultraviolet through visible to near-infrared, and in many different geometries.
Other technologies still have specific roles. Halogen sources are used in hyperspectral imaging due to their continuous spectrum, while laser illumination is widely used in 3D profiling systems where a precise line of light is required.
One factor that is often overlooked is long-term stability. Even small variations in light output over time can shift image intensity and affect inspection performance. Well-designed systems account for this through calibration, reference targets, or closed-loop control.
Designing for the Real World
As with all machine vision systems, the most common cause of failure is not the technology itself, but the environment in which it operates.
Ambient light variation, temperature changes, vibration, inconsistent part presentation, and surface variation are all normal conditions in production. If these are not accounted for during design, system performance will degrade over time.
Experienced engineers address this early in the process. Enclosing the inspection area reduces ambient light variation. Using narrow-band illumination and matched filters provides further control. Synchronising lighting with the camera exposure ensures that only the intended light contributes to the image.
These measures are not expensive, but they significantly improve reliability.
Independent Resources
For those looking to develop a deeper understanding, one resource that stands out is Vision Doctor, created by Lars Fermum.
It provides a practical and independent reference for machine vision, covering lighting techniques, light interaction, and system design considerations. Its strength lies in combining theoretical explanation with tools that can be applied directly to real-world problems.
Final Thoughts
Lighting in machine vision is both a science and an engineering discipline.
It is not a detail to be addressed after the system is defined. It is one of the first decisions, and often the most important.
A well-designed lighting setup can make a genuinely difficult inspection reliable and repeatable. A poorly chosen one can make even simple tasks impossible.
After more than 30 years in the industry, one thing remains consistent.
No system has ever failed because the lighting was too well thought through.
Quick Checklist: Machine Vision Lighting
When designing your lighting setup:
- Are the features of interest clearly distinguishable from the background under current illumination?
- Has the lighting geometry been chosen deliberately (bright-field, dark-field, backlight, diffuse)?
- Is the wavelength appropriate for the material and surface being inspected?
- Have ambient light sources been controlled or eliminated?
- Are optical filters being used to stabilise the image?
- Has long-term stability of the light source been considered?
















