Why Your Machine Vision Lighting is Probably Wrong (And How to Fix It)

Why Your Machine Vision Lighting is Probably Wrong (And How to Fix It)

According to the Association for Advancing Automation (A3), imaging contributes to 85% of the success of a machine vision system. And lighting is the single biggest factor in image quality.

Engineers routinely spend weeks choosing a camera and minutes choosing the lighting. They compare sensor specifications, debate interface bandwidth, and agonise over frame rates. Then they grab a ring light from the shelf, point it at the part, and wonder why the software struggles to detect the feature they need.

Lighting is not a commodity. It is the most important design decision in your vision system, and it is the one most likely to be wrong. Here are the five most common lighting mistakes we see, and how to fix each one.

1. Wrong geometry: the angle changes everything

The angle at which light hits the object determines what the camera sees. This is not a subtle effect. The same part under the same camera with different lighting angles can look completely different. A defect that is invisible under one geometry can be glaringly obvious under another.

Bright field lighting (high angle, typically 30 to 60 degrees from vertical) illuminates the surface so that smooth, flat areas reflect light towards the camera and appear bright. It works well for general-purpose illumination of relatively high-contrast objects. The problem is that on smooth surfaces, bright field creates specular reflections that can overwhelm the feature you are trying to inspect.

Dark field lighting (low angle, typically less than 20 degrees from the surface) illuminates the surface so that smooth areas do not reflect light towards the camera and appear dark. Surface features like scratches, raised edges, embossing, and texture scatter the low-angle light towards the camera and appear bright against the dark background. This is the correct technique for detecting geometric surface features, and it is dramatically more effective than bright field for this purpose.

The difference between bright field and dark field on the same part is often the difference between a system that works and one that does not. If you are struggling to detect surface features with a high-angle light, try a low-angle light before you try more complex software. The image quality improvement is often immediate and dramatic.

Bent connector pin clearly visible in the left image under low-angle dark field lighting
Same part but bent pin is clearly visible in left image.

2. Not accounting for ambient light

Factory environments are not controlled lighting studios. Overhead fluorescent or LED lighting, windows with changing daylight, and reflections from nearby equipment all contribute ambient light that interferes with your structured illumination. The result is inconsistent images, so the system works on the night shift when the factory lights are dim and the windows are dark, then starts producing false rejects on the day shift when sunlight streams through the skylights.

There are three ways to deal with ambient light, and they should be used in combination, not as alternatives.

Enclose the inspection area. A hood, shroud, or enclosure around the camera and lighting blocks external light from reaching the part during inspection. This is the simplest and most effective solution, and it is surprising how often it is overlooked. It does not need to be elaborate. Even a basic light shield made from sheet metal or 3D-printed plastic can transform the consistency of your images.

Overpower the ambient light. Use lighting that is significantly brighter than the ambient conditions, typically by strobing the LED at high intensity for a short duration synchronised with the camera exposure. During the brief exposure window, the structured light dominates and the ambient contribution becomes negligible. Strobing also extends the life of the LEDs because they are only on for a fraction of the time.

Use optical filters. A bandpass filter on the camera lens, matched to the wavelength of your LED illumination, blocks light at other wavelengths. This is particularly effective when the ambient light is broadband (white overhead lighting or daylight) but your inspection light is narrow-band (for example, a red LED at 630nm with a corresponding red bandpass filter).

The UK mains frequency is 50Hz. If your camera is running at a high enough frame rate, it is possible to capture frames during the brief moments when overhead lighting is at its minimum intensity. This is not a reliable solution for production, but it illustrates how ambient light interference is a real, measurable problem, not a theoretical one.

3. Wrong technique for the surface

Different surfaces need fundamentally different lighting approaches. Using the same lighting technique for a matt plastic housing and a glossy metallic label will produce a good image of one and a terrible image of the other.

Surface Type Problem Recommended Technique
Glossy / reflective (foil, metallised film, shiny plastic) Specular reflections create hot spots that obscure features and saturate the sensor Diffuse dome lighting ("cloudy day" illumination). Provides even, non-directional light from all angles, eliminating specular reflections.
Transparent (glass, clear plastic, liquid) Light passes through the object rather than reflecting from it Backlighting to create a silhouette. Or structured dark field for edge detection on transparent parts.
Textured / rough (cast metal, fabric, wood) Surface texture creates noise that can be mistaken for defects Bright field from a controlled angle. Or axial lighting for very rough surfaces. Avoid dark field unless you specifically want to highlight the texture.
Curved / cylindrical (bottles, cans, tubes) Curvature creates uneven illumination with bright and dark zones Diffuse dome lighting, or wrap-around bar lights positioned to follow the contour. Line scan with consistent line illumination for full-surface inspection.
Embossed / engraved (stamped text, moulded features) Low-relief features are invisible under flat, even illumination Dark field (low-angle) lighting. The features scatter low-angle light and appear bright against the dark background. This is the classic dark field application.

If you are unsure which technique is right for your surface and feature combination, the only reliable way to find out is to test it with real samples. Lighting is an art as much as a science, and sometimes the right answer is not the one you expect. We have seen cases where a custom lighting geometry, designed specifically for a particular inspection task, has made the entire software side trivial.

Same scene imaged under ring, coaxial, dome and flat diffuse illumination
Same scene but showing the effects of using a ring vs coaxial vs dome vs flat diffuse illumination.

4. Inconsistent illumination across the field of view

A single point light source, or a light that is too close to the object, creates uneven illumination across the field of view. The centre of the image is bright, the edges are dark, and the software has to compensate for a brightness gradient that should not exist.

This matters because most machine vision algorithms assume consistent illumination. A threshold that works in the bright centre of the image fails at the darker edges. Edge detection that is reliable at one point in the field of view becomes noisy at another. The result is either false rejects (the system sees problems where there are none) or missed defects (the system cannot detect genuine problems in the poorly-lit areas).

The fix is straightforward. Use lighting that produces uniform illumination across the entire field of view. Bar lights positioned symmetrically, dome lights, or backlights all produce more even illumination than a single point source. For line scan applications, a uniform line light is essential, and the illumination profile should be measured across the full sensor width to confirm uniformity before the system goes into production.

If you are seeing inconsistent inspection results that vary by position within the image, check the lighting uniformity before changing the software. It is almost always a lighting problem, not an algorithm problem.

5. Using continuous lighting when you should be strobing

Continuous lighting (the LED is always on) is simple and cheap. It is also the wrong choice for any application where the object is moving at speed. A continuously-lit moving object produces motion blur, and no amount of software processing can recover the detail that motion blur destroys.

Strobed lighting (the LED fires a brief, intense pulse synchronised with the camera exposure) freezes motion by illuminating the object for only a few microseconds. During that brief flash, the object moves a negligible distance, and the image is sharp. This is the same principle as a flash on a conventional camera, adapted for industrial speeds.

Strobing has an additional benefit because the LED is only on for a fraction of the time, it can be driven at a much higher current during the pulse than it could sustain continuously. This means brighter illumination during the exposure window, which allows shorter exposure times, which further reduces any residual motion blur. It also extends the operational life of the LED, because the average power dissipation is lower.

For any application involving moving objects on a conveyor, web, or rotary table, strobed lighting synchronised to the camera trigger should be the default, not the exception.

The real cost of getting lighting wrong

Poor lighting does not just produce bad images. It produces a cascade of costs that compound throughout the life of the system.

The software becomes more complex because the algorithms have to work harder to extract features from a noisy, inconsistent image. Development time increases because the engineer is solving a lighting problem in software rather than in hardware. False reject rates go up because the system cannot reliably distinguish genuine defects from lighting artefacts. The system becomes fragile because any small change in ambient conditions or part orientation causes the carefully-tuned software to fail. And the engineering team spends time troubleshooting an algorithm problem that is actually a lighting problem.

The fix is almost always cheaper than the workaround. A better light, a different angle, a simple enclosure, or a switch from continuous to strobed illumination can transform a struggling system into a reliable one. The cost of the lighting change is measured in hundreds of pounds. The cost of the software workaround is measured in weeks of engineering time.

See it for yourself

The best way to understand the impact of lighting on your specific application is to see it. Clearview's Insights Lab’s are fully equipped with lighting from Advanced Illumination and ProPhotonix across every geometry and wavelength, including ring lights, bar lights, dome lights, backlights, axial diffuse lights, and custom configurations. We can demonstrate bright field vs dark field, continuous vs strobed, and different wavelengths on your actual production samples.

If you are specifying lighting for a new project, or troubleshooting a system that is not performing as expected, a lighting demo is the most valuable hour you can invest.

Book an Insights Lab lighting demo: info@clearview-imaging.com | +44 (0)1844 217270

Retour au blog >