LightingGuide

Machine vision lighting selection by inspection task

Use machine vision lighting selection to match geometry to inspection tasks, then verify contrast, glare, part variation and exposure limits.

LumaSpec Vision11 min read Share on LinkedIn

On this page 10 sections
  1. 01Start with the inspection decision
  2. 02Understand angle before adding brightness
  3. 03Set numerical acceptance criteria
  4. 04Work through a moving-part example
  5. 05Match candidate hardware to the geometry
    1. Bar lights for adjustable surface illumination
    2. Backlights for outlines and openings
    3. Coaxial lights for flat reflective faces
  6. 06Challenge the arrangement with representative variation
  7. 07Choose wavelength and timing after geometry
  8. 08Recognize when the usual answer is wrong
  9. 09Checks before ordering
  10. 10Questions

Choosing a light by shape alone often produces a bright image without a dependable inspection. The better starting point is the decision your camera must make: measure an outline, distinguish printed regions, or detect a change in surface texture. This guide helps you select the first lighting geometry, calculate the imaging constraints, and define acceptance checks before ordering hardware. For the broader experimental process, pair it with the lens and lighting selection test plan.

Start with the inspection decision

Write the inspection requirement as a measurable statement before selecting a light. “Find damage” is too broad. “Detect a groove crossing the sealing surface, including grooves parallel to conveyor travel” gives you a feature, location and orientation to test.

Separate silhouette tasks from surface tasks. Backlighting usually makes external edges easier to isolate, but it cannot reveal ordinary printing on an opaque face. Surface illumination can reveal that printing while making the external edge less distinct.

Inspection decision First geometry to test What creates contrast Main challenge to check
Measure an opaque outline or gap Backlighting The part blocks the illuminated background Edge shifts with part height or threshold
Read print on a matte face Angled, broad front lighting Ink and substrate reflect different amounts Shadows and uneven coverage
Detect scratches or raised features Low-angle directional lighting Features scatter light toward the camera Defects disappear at certain orientations
Inspect a flat, reflective face Coaxial illumination Smooth regions return light along the viewing direction Small surface tilts change brightness
Read print on a curved, reflective face Broad diffuse illumination A larger source reduces localized reflections Diffusion can hide surface texture

Treat these as starting hypotheses, not guaranteed solutions. A polished scratch can behave differently from a rough scratch, even when both have the same width.

Choose separate images when two decisions demand conflicting illumination. An outline measurement and a surface inspection may need different lighting channels rather than one compromised image.

Understand angle before adding brightness

A smooth surface reflects light mainly in a preferred direction. A rough surface spreads more of that light across different directions. Your camera records only the portion entering its lens, so changing the source position can change contrast without changing electrical power.

With directional bright-field lighting, the smooth surface reflects toward the camera and appears bright. A defect may interrupt that reflection and appear dark. With dark-field lighting, the smooth surface reflects away from the camera while scratches, edges or particles scatter light into it.

Bright-field and dark-field lighting geometry High-angle light reflects off the flat surface straight into the lens, so the surface looks bright. Low-angle light reflects away from the lens, so the surface looks dark and only edges or scratches scatter light upward.flat part with a scratchCamerabright field(high angle)dark field (low angle)flat areas reflect away;only the scratch sends light up
Bright-field and dark-field lighting geometry. High-angle light reflects off the flat surface straight into the lens, so the surface looks bright. Low-angle light reflects away from the lens, so the surface looks dark and only edges or scratches scatter light upward.

A shallow lighting angle is useful for creating dark-field contrast on a flat surface, but angle alone does not define dark field. The deciding condition is whether the undisturbed surface reflection misses the lens.

For an initial bench screen, try illumination elevations of 15°, 45° and 75° above the part plane. These are test positions, not optical specifications. Repeat the promising positions from another direction around the part, because directional defects can disappear when their orientation changes.

Diffusion enlarges the apparent source and blends shadows and reflections. That often helps print inspection but can weaken the very texture signal needed for damage detection. Judge the feature, not how evenly illuminated the whole image looks.

Set numerical acceptance criteria

A lighting comparison needs more than a preferred screenshot. Record feature contrast, background variation, clipping, spatial sampling and exposure time using fixed camera settings.

For a simple two-region comparison, calculate normalized contrast from the mean feature and background intensities:

C = |I_feature - I_background| / (I_feature + I_background)

This measure assumes nonnegative, black-level-corrected intensities and a nonzero denominator. Use comparable regions and a fixed image-processing pipeline. Near-black regions need an additional noise check because a large ratio can still represent a weak signal.

For example, mean values of 150 and 50 give contrast of 100 / 200 = 0.50. Values of 150 and 120 give 30 / 270 = 0.11. Neither number alone proves reliable detection: texture, noise and placement variation can still overlap the feature.

Set application-specific gates before comparing candidates. An illustrative screening specification might require:

  • Contrast of at least 0.30 on every selected defect sample.
  • No clipped pixels in the measurement regions.
  • Background maximum-to-minimum intensity ratio below 1.20 across specified clear regions.
  • Exposure short enough to keep calculated motion blur below 0.5 pixel.
  • Successful detection at every allowed part position and orientation in the screening set.

These are example gates, not universal industry requirements. The final limits must reflect the inspection's false-accept and false-reject risks.

Also check sampling before blaming the light. The camera resolution selection guide explains why sufficient pixels are necessary but do not, by themselves, establish measurement accuracy.

Camera resolution for the smallest feature
Units
Pixels needed
–
Sensor size
– MP
Smallest sensor that fits
–
Pixel on the part
– mm
Pixels across the feature, that sensor
–

Pixels needed = field / feature × pixels per feature on each axis (field incl. margin). The lens must resolve the pixels too: Nyquist = 1000 / (2 × pixel µm) lp/mm.

Find cameras with enough pixels Open the full calculator

Work through a moving-part example

Consider a hypothetical surface inspection covering 120 mm horizontally. The smallest required scratch is 0.20 mm wide, and the initial design target is 5 pixels across that width.

Required horizontal pixels = field width × target pixels / feature width Required horizontal pixels = 120 mm × 5 / 0.20 mm = 3000 pixels Object sampling = 120 mm / 3000 pixels = 0.040 mm/pixel

Five pixels is a starting sampling target, not a guarantee that every scratch will be detected. Optical blur, scratch shape and noise still affect visibility.

At a conveyor speed of 600 mm/s, limiting blur to 0.5 pixel allows only 0.020 mm of travel during the effective exposure:

Maximum exposure = permitted travel / object speed Maximum exposure = (0.5 pixel × 0.040 mm/pixel) / 600 mm/s Maximum exposure ≈ 0.000033 s = 33 microseconds

The lighting comparison must therefore work at approximately 33 microseconds or less, rather than at a convenient bench exposure. The moving-part exposure guide covers the distinction between camera exposure and motion-free imaging.

Suppose directional lighting gives a background mean of 120 and a scratch mean of 60. Contrast is 60 / 180 = 0.33. A diffuse arrangement gives 180 and 160, producing 20 / 340 = 0.059. The diffuse image looks brighter, but the scratch is less distinguishable.

Now rotate the scratched sample. If the directional arrangement loses the scratch, its original contrast advantage is insufficient. Test another source direction or separate exposures, then repeat the same acceptance measurements. Select the arrangement with adequate worst-case performance, not the strongest single image.

Match candidate hardware to the geometry

Bar lights for adjustable surface illumination

Bar lights are useful when source position and direction are the main experimental variables. A single bar can create directional contrast; opposing bars can reduce shadows, although simultaneous illumination may also reduce defect contrast.

The LS-BAR-1047 is a standard bar-light candidate. The LS-BAR-1276 is a diffused bar-light candidate. They provide starting points for comparing source characteristics, not a controlled comparison of diffusion alone.

Bar lights290 x 30 mm LED bar light (LS-BAR-1047)LS-BAR-1047
Size
200-400 mm
Type
Standard
$449.00View part
Bar lightsBar light, 372 x 28 mm, White (LS-BAR-1276)LS-BAR-1276
Size
200-400 mm
Type
Diffused
$439.00View part

Different candidate lights can have different dimensions, output and angular distributions. Keep camera settings fixed, record source position, and distinguish a geometry comparison from a test intended to isolate diffusion.

Backlights for outlines and openings

Backlights place an illuminated background behind the part. They are often the first choice for opaque outlines, through-holes and gaps where the fixture leaves a clear optical path.

The LS-BKL-1468 is a red flat backlight candidate for a silhouette trial.

BacklightsFlat Backlight, 150 x 150 mm, Red (LS-BKL-1468)LS-BKL-1468
Size
100-200 mm
Type
Standard
Voltage
24 V
$389.00View partBuild a system with it

Confirm the illuminated area rather than assuming that an overall mechanical dimension describes usable coverage. Leave room for the full part-position envelope and check the edge at the highest and lowest allowed part positions.

If the apparent edge changes with height or threshold, compare the arrangements discussed in collimated versus diffuse backlighting for edge gauging. Illumination direction and lens perspective both matter; improving one does not remove errors from the other.

Coaxial lights for flat reflective faces

Coaxial lights direct illumination along the viewing axis using a beam splitter. A suitably aligned, flat reflective surface can return a bright field, while features that redirect light appear darker.

The LS-CXL-0067 is a coaxial light candidate for this geometry.

Coaxial lights102 x 100 mm coaxial light source (LS-CXL-0067)LS-CXL-0067
Size
100-200 mm
Voltage
24 V
$499.00View partBuild a system with it

Test actual surface flatness and fixture tilt early. Coaxial illumination can be sensitive to a reflective surface tilting away from the viewing axis. Check the optical aperture and mechanical arrangement across the entire field, rather than selecting from a nominal size alone.

Use the lighting finder to narrow candidates after the geometry is demonstrated. A shared supply voltage does not establish compatible dimming, triggering or strobe operation.

Challenge the arrangement with representative variation

Build a screening set that includes acceptable parts as well as defects. Good parts with strong texture, harmless marks or finish variation are particularly useful because they expose false-reject mechanisms.

Include samples near the acceptance boundary. A deep scratch is easy to reveal but may tell you little about the shallowest rejectable damage.

Use a deliberate challenge matrix:

  1. Capture each sample at the nominal position with exposure and gain fixed.
  2. Move it through the measured placement limits, including field corners.
  3. Rotate directional defects through their permitted orientations.
  4. Change part height and tilt through the fixture's actual tolerance range.
  5. Repeat under the expected ambient-light extremes.
  6. Test the selected arrangement with production motion and triggering.

For example, a fixture permitting ±4 mm lateral movement and ±3° tilt needs checks at those limits, not only at its centered position. Substitute measured machine tolerances rather than adopting these example values.

Record the weakest feature contrast, strongest nuisance response and any clipped inspection region. Keep representative failure images alongside successful ones. They explain why a candidate was rejected and prevent a later adjustment from recreating the same problem.

A screening set can eliminate unsuitable arrangements; it cannot establish a production escape rate by itself. Validate the chosen system with a separate, representative sample set and a documented decision rule.

Choose wavelength and timing after geometry

Once a geometry produces useful separation, compare wavelengths without moving the camera or fixture. Different inks and substrates can change their relative brightness substantially, and visual color alone does not predict every material response.

Use the LED color contrast guide to plan that comparison. If the task genuinely requires color discrimination, preserve the needed color information rather than selecting narrowband illumination solely for stronger grayscale contrast.

Lock automatic exposure, gain and white balance during controlled comparisons. Otherwise, camera adjustments can conceal changes caused by the light.

For moving parts, verify the effective illumination window. A short light pulse limits motion only when it dominates the recorded illumination and overlaps the intended camera integration. Ambient light recorded during a longer exposure can still create a blurred secondary image.

Check these integration details before committing to a light and controller combination:

  • Whether the light supports continuous operation, triggered operation or both.
  • The documented electrical interface and compatible control method.
  • Trigger latency, pulse duration and permitted repetition rate.
  • Allowed current, duty cycle and thermal operating limits.
  • Camera shutter behavior and the required illumination overlap.

Do not assume a listed supply voltage permits external pulsing or overdrive. Use only documented operating modes, then verify timing from captured images and suitable electrical measurements.

Recognize when the usual answer is wrong

A backlight is not automatically the right answer for every dimensional task. Transparent edges can refract light, rounded edges can produce gradual transitions, and a fixture can block the background. Check edge stability against a dimensional reference rather than judging the silhouette by appearance.

Diffuse lighting is not automatically better for shiny parts. It may improve printed-mark visibility while suppressing shallow dents or scratches. For curved reflective surfaces, the dome lighting guide explains the broader diffuse approach and its limitations.

Low-angle lighting is not automatically suitable for every scratch. Directional features can disappear, while normal texture becomes exaggerated. If no single source direction passes the challenge matrix, compare separate directional images instead of simply increasing brightness.

Finally, a stronger light cannot correct inadequate sampling, defocus or unstable positioning. Revisit those constraints when changing illumination improves average brightness but not the separation between acceptable and rejectable parts.

Checks before ordering

Finish with a compact specification that another person can reproduce:

  • Inspection decision: define the feature, rejection boundary and allowed nuisance marks.
  • Sample evidence: retain acceptable, rejectable and borderline examples with image settings.
  • Geometry: record camera, part and light positions, including illumination direction and adjustment limits.
  • Coverage: confirm the usable illuminated region across the complete placement envelope.
  • Image margin: record worst-case contrast, clipping, background variation and sampling.
  • Motion budget: state line speed, maximum effective exposure and required trigger behavior.
  • Electrical compatibility: confirm documented supply, control interface, operating mode and cable requirements.
  • Validation plan: define an independent sample set and how false accepts and false rejects will be assessed.

For a proven geometry, use the light configuration step to organize the hardware selection. If the challenge matrix still exposes missing defects or unstable edges, send the task definition, representative images and timing constraints through application support before choosing the final arrangement.

Questions

What is the first step in machine vision lighting selection?

Start with the decision the image must support. Backlighting is a strong first candidate for opaque outlines and openings. Surface features need front illumination selected for their reflection behavior. Compare directional and diffuse arrangements on representative parts before choosing a physical light format.

How much contrast does a machine vision inspection need?

There is no single contrast value that guarantees reliable inspection. A useful requirement must also account for noise, normal texture, defect size, clipping and placement variation. Establish a screening limit from representative samples, then validate the inspection separately against its false-accept and false-reject requirements.

Can one light handle both measurement and surface inspection?

Sometimes, but only when both decisions retain adequate image margin. Outline measurement and surface inspection often benefit from different illumination paths. If one arrangement hides a required feature, separate lighting channels and exposures can be more dependable than trying to satisfy both tasks simultaneously.

Why does a defect disappear when the part moves or rotates?

Directional lighting can interact strongly with scratch orientation, while glossy surfaces change reflection direction with small tilts. A successful centered image therefore does not establish tolerance to production variation. Repeat the inspection across the actual position, height, tilt and orientation limits before approving the geometry.

What should be checked before using strobed illumination?

Confirm that the light explicitly supports the intended operating mode and that its controller interface is compatible. Check permitted pulse duration, repetition rate, current and duty cycle. Then verify that illumination overlaps camera integration and that ambient light does not produce motion blur during the remaining exposure.