Skip to Main Content
texto

Machine Vision Lighting Techniques That Actually Improve Camera Performance

Lighting is the single variable with the most leverage over machine vision performance and the one most often treated as an afterthought. Every camera in a machine vision system creates images by analyzing reflected light from an object, not the object itself. Change the light, and you change everything the camera sees.
Cognex Smart Lighting

Key Takeaways

  • Lighting geometry, wavelength, and intensity directly determine what a machine vision camera can and cannot detect; no software upgrade compensates for poor illumination.
  • Five core lighting techniques exist, each engineered for specific surface types, defect profiles, and throughput requirements; choosing the wrong one degrades AI model accuracy and increases false rejects.
  • If just 10% of the images in a deep learning training set are captured under poor lighting, correcting the model afterward requires three times more data — making lighting decisions a direct cost driver, not just a setup variable.  

You upgraded to a high-resolution industrial camera. You invested in AI-powered inspection software. Yet false rejects are climbing, subtle surface defects keep slipping through, and your quality engineers are losing confidence in the system. Before you look at the camera or the algorithm, look at the light.

Lighting is the single variable with the most leverage over machine vision performance and the one most often treated as an afterthought. Every camera in a machine vision system creates images by analyzing reflected light from an object, not the object itself. Change the light, and you change everything the camera sees.

One fundamental principle experienced engineers know, but teams routinely skip: every vision system should have a dedicated light source, specified and controlled for that inspection alone. Adam Krizsanyik, a Senior Applications Engineer with deep field experience in industrial inspection systems, is direct about what he sees in practice: "Many times they are just using lights from what they put there for the operator and they say if the operator can see, the camera can see, and that's not good."

The problem with repurposing operators or overhead lighting runs deeper than it might appear. When a facility replaces an old fluorescent fixture with a new LED, the color temperature and wavelength of the light changes and that change is enough to shift how the camera sees the part. Operator lights can also be switched on and off independently, introducing unpredictable variation between shifts. And general factory lighting is rarely powerful enough to compensate for ambient light variation across the production floor. Any of these factors alone can corrupt image consistency. In combination, they make reliable inspection nearly impossible to sustain over time.

As Krizsanyik puts it: "I basically think that a vision system should always come with a separate light dedicated to the vision system." A dedicated, high-intensity light controlled exclusively by the vision system and running at a short exposure time removes all of those variables.

He saw this firsthand at a customer site where the inspection system was relying entirely on operator lighting with auto-exposure. Every time a worker in a white coat walked nearby, the image shifted. To demonstrate the difference, he set up a dedicated, high-intensity light in the lab and showed the manager a live image. He moved his hand under the camera, and the image held steady. Then he turned the room lights off. Nothing changed. He turned them back on. Still, nothing changed. The manager's reaction: "Wow."  

The lesson learned? When the light is powerful enough and the exposure time short enough, the camera stops caring about what the rest of the room is doing.

The 6 core machine vision lighting techniques

There is no single setup that works for every application. Lighting geometry interacts with surfaces, edges, textures, and materials in different ways. Five techniques cover the full range of industrial inspection scenarios. 

Bright field lighting.webp

1. Direct (Front) Lighting

Direct lighting places the source at a high angle (greater than 45 degrees) relative to the surface. The camera receives reflected light directly, and directional shadows help reveal dimensional features and surface structure. Bar lights, spotlights, and ring lights are all examples. This is the widest application technique and works well for flat, matte, or lightly textured surfaces. It is the wrong choice for polished or specular surfaces, where it produces glare.

Diffuse lighting.webp

2. Diffuse On-Axis (Dome) Lighting

Dome lighting envelops the part with light from all angles simultaneously, eliminating the directional shadows and specular highlights that cause problems on reflective surfaces. Think of it as the photographic equivalent of an overcast sky, even, directionless illumination. For example, consider a battery with printed characters. A dome light provides the contrast a vision system needs to read reliably. A spotlight in the same application creates a glare that makes the image unusable.

One detail non-experts commonly miss is dome sizing. A part that fits neatly into the dome opening can seem like a perfect match, but the physics of diffuse lighting require light to arrive from all sides, including laterally. As Krizsanyik explains: "If the part is in the hole, from the sides the light doesn't really count." A dome that is too small stops behaving like a diffuse light source and starts behaving like a directional one, defeating the purpose entirely. The correct specification is a dome large enough that light wraps around the part from every angle, mounted as close to the part as possible to maximize that effect.

A second common issue arises with parts that have a mirror-flat reflective top surface. The camera aperture at the top of the dome creates what Krizsanyik calls a "dead spot" a dark reflection of the camera itself visible in the image. "You will see a dark spot, we call it the dead spot," he explains. "This could be minimized by adding a coaxial light on top, but then it will be a dome light and a coaxial light, with lots of lighting all together." Flat dome lights, a specialized thin geometry variant from certain suppliers, solve this by design without requiring a second light source.

Working distance is also a critical constraint: as distance increases, the dome behaves more like a directional front light. Dome lights must be positioned close to the part to function correctly.

Want to go deeper on lighting selection?

Cognex's lighting resource covers technique selection, wavelength matching, and environment considerations — everything you need in one place as you work through your system specification. → Read More

Back lighting.webp

3. Backlighting

Backlighting places the light source directly behind the object, opposite the camera, producing a sharp silhouette with maximum edge contrast. It is the cleanest technique for dimensional measurement, shape verification, and presence/absence detection.

The important caveat: surface detail is lost entirely. A backlit image reveals shape but conceals texture and surface defects. This makes backlighting the wrong choice for certain applications, like scratch detection on a metal surface.

Dark field lighting.webp

4. Off-Axis (Dark Field) Lighting

Dark field lighting positions LEDs at a low grazing angle, typically less than 45 degrees to the surface, so light skims across the part rather than illuminating it directly. Raised or recessed features scatter light toward the camera and appear bright against a dark background. Smooth, flat areas reflect nothing toward the lens and stay dark. This is the technique that reveals scratches, dents, and embossed features that front-light setups miss entirely. 

5. Coaxial (On-Axis) Diffuse Illumination

Coaxial illumination directs LED light onto a beam splitter, so the resulting light hits the surface parallel to the camera's axis, making it the most effective technique for flat, mirror-like surfaces where even slight angles cause glare. Unlike other lighting techniques where reflection is a problem to be managed, coaxial illumination is specifically designed to use that reflection: the bright return from a flat, polished surface is exactly what makes the technique work, delivering the contrast needed to inspect highly reflective geometry cleanly.

One practical note on camera positioning: the hotspot behavior, sometimes associated with perpendicular mounting, and the recommendation to tilt the camera applies more to other on-axis setups, such as ring lights or built-in camera lighting than to true coaxial illumination. For coaxial setups, the geometry works as intended. 

6. Structured Light — The 3D Technique 

Structured light projects a known pattern (typically a grid or stripes) onto the surface. The camera captures how the pattern deforms, allowing the system to reconstruct 3D geometry, measure height profiles, and detect warping or irregularities that 2D imaging cannot reveal. This technique is best suited for inspection challenges that require three-dimensional analysis, such as detecting flatness, verifying component seating, or measuring height variations across complex geometries. 

Continuous vs. Strobe mode

Strobe mode is not a separate lighting technique. It is a choice about how the five techniques above are driven, and it matters enormously.

On any line where parts move at speed, continuous illumination blurs images. Strobe lighting fires a short, intense burst synchronized with the camera's exposure, freezing motion without stopping the conveyor. Industrial strobe systems can be overdriven to up to four times their normal brightness for small bursts, dramatically reducing motion blur on fast-moving components. 

Continuously on lighting can lead to blurred images

At high speeds, continuous illumination blurs images.


A short, intense strobe light technique freezes motion, even at high speeds.

A short, intense burst of light freezes motion without blur.


Strobe mode also helps in environments with uncontrolled ambient light. As Krizsanyik explains: "You can use a very powerful light in pulse mode/strobe mode, which generates even higher, brighter light. In this case, machine vision lights can get a brighter image, and then you can have an even lower exposure rate, and the ambient light is minimized even more." For environments where an operator must also work near the system, he points to a practical solution: "You could use infrared, and the operator doesn't see the infrared. Our camera sees it."

On strobe synchronization, Krizsanyik is equally clear about where timing failures originate: "Sometimes maybe somebody wants to control the strobe controller from the programmable logic controller (PLC) and that can be done, but then it might be off.” If you manually turn on the light to take an image, you may turn it on too early or too late, and that will cause a problem. His recommendation: “Wire it to the camera. The camera should start the strobing, and then it will be good." Controlling the strobe from the PLC introduces timing offsets that are difficult to diagnose and produce intermittent image quality failures.

Wavelength selection: A physics decision, not an aesthetic one

Different materials absorb and reflect light at different wavelengths. Choosing the right color can make an invisible defect visible. 

WavelengthTypical Use CaseInspection Advantage
Red (620–750 nm)OCR on dark substrates, contrast on red/orange materialsCreates high contrast against complementary-color surfaces
Green (495–570 nm)General purpose, food inspection, circuit boardsProvides balanced contrast across a wide range of surfaces
Blue (400–495 nm)Metal, solder joints, yellow or orange materialsEnhances contrast on metallic and yellow surfaces
Near-Infrared (750–1100 nm)Subsurface defects, plastics inspectionReveals subsurface features beneath the top layer
UV (< 400 nm)Fluorescence inspection, adhesive verification, special inksReveals fluorescent features that are not visible under standard lighting
IS3900 Torch Light Animation.webp
Different colors of lights make different defects visible.

Harsh operating environments: what actually needs to change

Real production environments introduce challenges that controlled lab setups never reveal. Krizsanyik is quick to point out that two of the most common culprits — vibration and ambient light — are not exclusive to harsh environments. Both are present on almost any production floor and need to be addressed in any vision system design, not just those in demanding conditions.

Here is what he suggests to address each challenge:

Vibration

  • Maximize light intensity and minimize exposure time; a shorter exposure window reduces the chance that vibration affects the image during capture
  • Where possible, isolate the camera and lighting entirely from the vibration source; a stable, non-moving system produces the most consistent results
  • Where full isolation isn't feasible, mount the camera and lighting rigidly to the same structure as the vibrating element to keep the relative position between camera and part constant 

Ambient Light

  • Shield the inspection area so ambient light cannot reach the part or camera; this is the simplest and most effective solution when the line layout allows it
  • Where shielding isn't possible, overdrive the light in strobe mode; the high-intensity burst overwhelms the ambient source and dramatically reduces its effect on the captured image
  • Add a wavelength-matched bandpass filter as a third layer of protection; it ensures the camera receives only the wavelengths relevant to the inspection and is particularly effective in open-floor environments where overhead lighting creates unpredictable variation 

Coolant and Washdown Environments

  • Specify IP65 or IP68 rated lighting hardware; a standard light near a CNC machine will wick coolant inside over time, causing corrosion and failure

Temperature Extremes

  • Verify that both camera and lighting hardware are rated for the full operating temperature range
  • If they are not, plan for additional cooling or heating before deployment 

Why lighting quality directly determines AI accuracy

Poor lighting is not just a camera problem. It is a data problem, and data problems compound inside AI systems. AI models learn from image datasets. If those images are captured under inconsistent or incorrect lighting, the model learns the wrong patterns. A widely cited industry benchmark: if just 10% of training images are inaccurate, correcting the model afterward requires three times more data. Lighting decisions made at setup are directly reflected in retraining costs months later.

No AI model can reliably detect what the lighting geometry has already erased from the image. Krizsanyik frames the relationship simply: "What the camera sees is how the light reflected back from the part. If it's reflected in the camera direction, it will be bright. If it's not reflected in the camera direction, then that part will be dark. Using the proper lighting techniques, you can emphasize regions of the part that have to be checked and in doing so, make something disappear that you don't want to see."

The three variables most teams only partially optimize

Most lighting discussions stop at geometry, where the light is positioned. The engineers who build the most reliable systems optimize three variables simultaneously:

  • Geometry — angle and direction of illumination relative to the part and camera
  • Wavelength — the spectrum of light and how the target material responds to it
  • Intensity and timing — brightness, pulse duration, and synchronization with camera exposure

Lighting and optics are co-dependent on specifications, not independent decisions. A lens optimized for NIR wavelengths performs differently under white LED illumination. Get the lighting right first, and everything downstream – camera selection, algorithm configuration, AI model training – becomes faster, cheaper, and more reliable. Get it wrong, and no amount of resolution or processing power recovers what the light failed to capture.

Want to learn more Download our lighting catalog - https://www.cognex.com/en/tools-and-resources/resource-center/lighting-catalog  

Practitioner insights draw on interviews with Adam Krizsanyik, a Senior Applications Engineer with Cognex

最終変更日2026/07/22

Related Resources