ROBOTIC.INDUSTRIES

Perception and Sensors

The Lighting Mistakes That Kill Machine Vision Projects

Most vision failures are lighting failures. Six mistakes account for the majority, and every one of them costs less to fix at design time than after installation.

Safety laser scanner mounted low on a machine frame on a factory floor
Safety laser scanner mounted low on a machine frame on a factory floor

Lighting decides whether a vision project works, and it is chosen last in most projects. Six mistakes account for the majority of failures: using ambient light, ignoring sunlight, wrong geometry, no wavelength control, no shielding, and testing on clean parts. Each costs hours to fix during design and weeks after installation.

6mistakes behind most vision failures
100,000 luxdirect sunlight, against 300 to 500 indoors
4lighting geometries that cover most tasks
10 to 40xcontrast gain from correct geometry

The six mistakes

  1. Relying on ambient light. Factory illumination changes with the time of day, the season, which lamps are working and whether the door is open. A vision system calibrated in the afternoon fails in the morning.
  2. Ignoring sunlight. Direct sunlight is around 100,000 lux against 300 to 500 lux of typical indoor lighting, so a station near a loading door faces a two hundredfold change during a shift. Structured light and time-of-flight sensors are particularly vulnerable.
  3. Wrong geometry. Front lighting a shiny part produces glare; backlighting the same part produces a perfect silhouette. Geometry changes contrast by a factor of ten to forty, far more than any algorithm.
  4. No wavelength control. Monochromatic illumination with a matched bandpass filter rejects ambient light of other wavelengths, which is the single most effective defence against changing surroundings.
  5. No shielding. An enclosure or a shroud costs a few hundred and removes the entire problem class. It is routinely cut from the budget and routinely added later at greater cost.
  6. Testing on clean parts. Oil, coolant, chips, fingerprints and release agent all change how a surface returns light. A system validated on cleaned samples meets different parts in production.
Fix contrast optically, not computationally. An image where the feature is clearly separated needs a simple, fast, robust algorithm. An image where the feature is barely visible needs a complex, slow, fragile one. Every hour spent on lighting saves several on software and reduces the failure rate at the same time.

The four geometries

Lighting geometry and what each reveals
GeometryRevealsHidesUse
BacklightOutline, holes, gapsAll surface detailDimensional measurement, presence
Diffuse domePrint, colour, markings on shiny partsSurface texture and dentsReading codes on curved metal
Directional or bar lightTexture, scratches, embossingEven features on flat surfacesSurface defect inspection
Dark field, low angleEdges, scratches, engraved marksFlat uniform areasEtched code reading, crack detection
CoaxialFlat specular surfacesAnything at an angleMirror-finish inspection

The choice is dictated by the feature, not by the part. Reading an etched code and detecting a scratch on the same component need different lights, and a station required to do both usually needs two, switched in software.

Wavelength and filtering

Illumination wavelength choices
BandWavelengthGood forNote
Blue450 to 470 nmFine detail, red or dark partsShortest wavelength, best resolution
Green520 to 530 nmGeneral purpose, red featuresPeak sensor sensitivity on many sensors
Red620 to 660 nmGeneral purpose, efficientCheapest, high output
Near infrared850 to 940 nmRejecting ambient light, seeing through some plasticsInvisible to operators, needs a warning label
Ultraviolet365 to 405 nmFluorescent marking, adhesive detectionSafety precautions required

Pairing a narrowband source with a matched bandpass filter on the lens is the standard defence against ambient variation. It typically rejects the great majority of light outside the passband, which turns a station affected by daylight into one that is not.

Specifying a lighting solution

What a lighting specification should state
ItemExampleWhy
Feature to be detected0.3 mm scratch on brushed steelDictates geometry and wavelength
Required contrastat least 40 grey levelsMakes the result measurable
Working distance220 mmDetermines light size and intensity
Ambient conditionsup to 20,000 lux at the stationSets shielding and filter requirements
Part surface statesOiled, chipped, freshly machinedThe real test set, not clean samples
Exposure and strobe200 us at 25 HzFreezes motion, reduces ambient share
Maintenance accessCleanable without toolsA dusty light is a slow failure

Strobing deserves a note of its own. A short exposure with a bright pulse both freezes part motion and reduces the ambient contribution, because ambient light integrates over the exposure while the pulse does not. Dropping exposure from 5 ms to 200 microseconds cuts the ambient share by a factor of 25 for free.

Frequently asked questions

Why do machine vision projects fail on lighting?

Because lighting decides contrast and contrast decides whether the algorithm is simple or fragile. Ambient light varies with time of day, season and open doors, so any system depending on it fails intermittently.

How much does sunlight matter?

A great deal. Direct sunlight is roughly 100,000 lux against 300 to 500 lux of typical indoor lighting, a two hundredfold change. Stations near loading doors need shielding, narrowband illumination and matched filters.

Which lighting geometry should I use?

Backlight for outlines and dimensions, diffuse dome for markings on shiny curved parts, directional for texture and scratches, dark field for etched marks and cracks. The feature dictates the geometry, not the part.

Does the wavelength matter?

Yes. A narrowband source with a matched bandpass filter rejects ambient light of other wavelengths, which is the most effective single defence against changing surroundings. Blue gives the finest detail, near infrared the best ambient rejection.

Can software compensate for bad lighting?

Only partly, and at a cost. Recovering a feature from a poor image needs a complex, slow and fragile algorithm, whereas correct lighting produces an image a simple robust method handles. Fix contrast optically first.

Sources

  1. Robotics at NISTNational Institute of Standards and Technology, robot performance measurement and test methods
  2. IEC 60529, degrees of protection provided by enclosuresInternational Electrotechnical Commission, relevant to lighting enclosures in wet or dusty cells
  3. ISO 10218-1:2025, Robotics, Safety requirements, Part 1International Organization for Standardization, requirements for vision used in safety functions