The Vision System That Couldn’t Read the Label
We set up a camera to read a barcode on a shiny metal part. The camera worked on a flat sample. On the actual parts (which had a machined, reflective surface), the barcode image was washed out — glare from the overhead light. The camera saw a bright spot where the barcode should be. We tried changing the exposure. No help. The problem was the lighting: a white dome light created reflections on the shiny surface. We switched to a dark-field light (a low-angle ring light that doesn’t reflect into the camera). The barcode image was dark on a bright background. The camera read it. The mistake was picking the wrong light type for a reflective surface.
Machine vision lighting selection isn’t a bright light. The light type (and angle) determines the contrast between the feature and the background. This article covers the choices.
Lighting Types
Ring Light (Coaxial or Radial)
A circular LED light around the camera lens. Lights the part evenly. Standard for general inspection (part presence, barcodes). But on shiny (reflective) surfaces, it creates glare (the light reflects straight back into the lens).
Best for: Matte (non-reflective) surfaces, general inspection.
Dome Light
A hemispherical diffuser over the part. Lights from all angles (no single direction). Eliminates shadows. But on shiny parts, it still creates glare (the dome reflects the part). Good for curved, matte parts.
Dark-Field Light (Low-Angle Ring)
An LED ring that lights at a low angle (grazing the surface). The light hits the surface at a shallow angle. Smooth surfaces reflect the light away from the camera (dark). Scratches, edges, and textured features reflect back (bright). This creates high contrast for defects or edges.
Best for: Shiny/reflective surfaces, edge detection, scratch inspection.
Back Light
A light behind the part (the camera looks through the part). The part appears as a silhouette. For measuring dimensions (the part’s outline is sharp). Not for reading surface features.
Best for: Dimensional measurement, part outline, presence (silhouette).
| Light Type | Best For | Avoid For |
|---|---|---|
| Ring light | Matte surfaces, barcodes, general | Shiny/reflective (glare) |
| Dome light | Curved, matte parts | Highly reflective (glare) |
| Dark-field (low-angle) | Shiny surfaces, edges, scratches | Matte surfaces (low contrast) |
| Back light | Dimensional measurement, outline | Surface features (color, print) |
| Coaxial light | Flat, reflective surfaces (through beamsplitter) | Curved parts |
Step 1: Contrast Is Everything
The vision system needs contrast between the feature (barcode, edge, defect) and the background. The light creates this contrast.
- Barcode on matte plastic: Ring light (even illumination). The barcode is dark on light.
- Barcode on shiny metal: Dark-field light (no glare). The barcode reflects differently than the surface.
- Edge detection (part outline): Back light (silhouette). The edge is sharp.
- Color inspection (red vs green parts): Use a light color that maximizes contrast (green light on red parts, or red light on green parts).
Step 2: Light Color
The LED color affects contrast.
- White: General. For color inspection (color cameras).
- Red (625 nm): Standard. Good depth of field, less sensitive to ambient light. For grayscale cameras.
- Blue (470 nm): Higher resolution (shorter wavelength). For fine features (small barcodes, tiny defects). Also good for red objects (absorbs blue, creates contrast).
- Green (525 nm): For inspecting red objects (red reflects green poorly, creates contrast).
For grayscale cameras, red LEDs are standard (bright, cheap, good depth). For fine features, use blue.
The lighting rule: Pick the light type based on the surface. Shiny/reflective = dark-field (low-angle). Matte = ring. Dimensional = back light. The system that couldn’t read the barcode had a ring light on a shiny metal part — glare. Switch to dark-field.
Step 3: Ambient Light
The factory has overhead lights (60 Hz fluorescent, sunlight through windows). The vision system’s light must overpower the ambient light.
- Strobe light: The light flashes (strobe) when the camera takes the picture. The flash is brighter than the ambient light. The ambient light averages out (the exposure is short).
- Constant light (high brightness): A bright constant light that overpowers ambient. Simpler (no strobe controller) but more heat.
- Shielding: A light shield (a hood or enclosure) blocks ambient light around the part.
For most applications, a strobe light (triggered by the camera) is best. It’s bright and only on during exposure.
Step 4: Working Distance and Field of View
The camera and light must be positioned so the part fills the field of view.
- Working distance: How far the camera is from the part. The lens focal length determines this.
- Field of view (FOV): The area the camera sees. The part should fill 50–80% of the FOV (not too small, not cut off).
- Light coverage: The light must illuminate the entire FOV. A ring light covers a circular area. A bar light covers a rectangular strip.
Polarizing Filter (For Glare)
For shiny parts, a polarizing filter on the camera (and a polarizer on the light) reduces glare. The polarizers are crossed at 90°, which cancels the direct reflection (glare). It lets through diffuse reflection (which shows the surface detail).
This is a common trick for reading barcodes on shiny plastic or metal. Add polarizers if the dark-field light isn’t enough.
A Vision Lighting Checklist
- What is the surface? (Matte, shiny, textured?)
- What is the feature? (Barcode, edge, defect, color?)
- What contrast is needed? (Feature vs background?)
- Light type? (Ring, dark-field, dome, back light?)
- Light color? (Red, blue, white?)
- Strobe or constant? (Ambient light?)
- Polarizer needed? (For glare?)
- Working distance and FOV? (Camera lens?)
- Does the light cover the FOV?
- Is the part shielded from ambient light?
- Is the light mounted rigidly? (No drift?)
- Test with the actual part (not a sample)?
The Bottom Line
Machine vision lighting selection is creating contrast. The system that couldn’t read the barcode had the wrong light (ring on shiny metal — glare). For shiny surfaces, use a dark-field (low-angle) light. For matte surfaces, a ring light works. For dimensional measurement, use a back light. Add a strobe to overpower ambient light, and polarizers if glare persists. The vision system that reads every part wasn’t the brightest light — it was the right type for the surface.