Stray Light in Machine Vision: Veiling Flare, Ghosting, Glare, and BBAR Coating Fixes
Veiling flare, ghosting, and target-side glare are different problems with different fixes. BBAR coatings, lens design, and filters address each one.
Stray light is non-image-forming light that reaches the sensor after reflecting or scattering inside the lens, not a bright object in the scene. It raises the dark-region floor, compressing contrast until low-luminance detail is unresolvable. Veiling flare spreads it as haze. Ghosting forms a localized secondary image. Target glare is a separate, scene-side problem. Fixing stray light means addressing the optics: lens design, coatings, window count, and shielding.
What stray light means in machine vision
Stray light is any light reaching the sensor that did not follow the lens's intended image-forming path. Normal image light travels through the designed stack of surfaces to the sensor. Stray light is everything else: light reflecting off the inner barrel wall, scattering off a polished element edge, bouncing between two surfaces, or scattering from dust near the aperture stop. All of it can still land on the sensor.
The result is a background signal on top of the real image, which lifts the shadow floor and compresses usable dynamic range. It shows up as:
- A spatially uniform haze across the frame (veiling flare)
- A structured secondary image displaced from a bright source (ghosting)
- Reduced MTF and apparent sharpness even when focus is correct
- Contrast loss that worsens as scene luminance increases
ISO 9358 quantifies this floor as the veiling glare index (VGI): the fraction of scene luminance reaching the sensor as non-image-forming light. A 1% VGI caps usable contrast near 40 dB.
Why multi-element lenses accumulate stray light
Every air-glass interface reflects a fraction of incident light. An uncoated surface reflects about 4-5%. A well-coated surface reduces that to 0.1-0.5%, but not to zero. A lens with 10 surfaces has 10 chances to reflect, each adding to the stray-light budget. The design task is keeping those reflections off the sensor area, absorbing them in baffles (internal blackened rings that trap stray rays), or scrambling them into the noise floor rather than a coherent artifact.
Stray light versus glare, flare, and ghosting
These terms get used interchangeably, but the fix depends on which problem is present. Commonlands maps each failure mode below to its usual cause and the fix that addresses it.
| Problem type | Visual symptom | Usual cause | Likely fix |
|---|---|---|---|
| Stray light (general) | Reduced contrast, lifted shadow floor, haze or artifacts anywhere in frame | Non-image-forming light inside the optical path reaching the sensor | Lens design (baffles, AR/BBAR coatings), fewer windows, shielding |
| Veiling flare | Uniform haze across the frame, dark areas read grey rather than black | Diffuse scatter from multiple internal surfaces accumulating as a broad background signal | AR/BBAR-coated, low-scatter lens; fewer protective windows; lens hood |
| Ghosting flare | Structured secondary image (ring, disk, streak) displaced from a bright source | Reflection between two surfaces forming a secondary, usually defocused, image at or near the sensor plane | Low-ghost optical design; keep bright sources away from ghost-prone field angles |
| Target glare | Saturated specular highlight on the scene object, detail loss at the reflection point | Specular reflection from the scene target directly into the lens | Cross-polarization, lighting geometry, illumination angle change |
A camera losing contrast outdoors could have any of these, and each needs a different fix: a polarizer will not reduce ghosting from internal reflections, and a lens hood will not remove a specular highlight from a shiny part. Identify which one you have before choosing a fix.
How do I reduce glare in machine vision?
Diagnose the failure mode first. For specular highlights on non-metallic surfaces, try cross-polarization: a linear polarizer on the illuminator and a crossed analyzer on the lens. For ambient contamination, use a bandpass filter matched to the illumination wavelength. For sensor clipping, reduce exposure or add an ND filter.
Cross-polarization for non-metallic surfaces
Cross-polarization uses two linear polarizers 90 degrees apart: one over the source, one (the analyzer) over the lens. Specular reflection off a smooth non-metallic surface keeps its polarization and is blocked. Diffuse light depolarizes and partly passes, so surface detail survives. It works on glossy plastics, glass, ceramics, and solder mask but poorly on bare metals.
Each polarizer transmits about 50% of unpolarized light, so cross-polarization usually needs more illumination, a longer exposure, or a wider aperture. A Commonlands C-mount lens with an adjustable iris ring lets you open up to recover light after adding polarizers, then stop back down if depth of field requires it, since illumination in most setups is programmatically controlled.
Bandpass and ND filters
A bandpass filter passes a narrow band matched to the illumination source and blocks out-of-band ambient light, stabilizing contrast between day and night. It does not suppress specular reflection at the target wavelength. Neutral-density filters cut all transmission uniformly, but they do not recover detail lost to specular geometry. See the bandpass filter guide for selection by wavelength.
Why HDR and outdoor scenes expose the problem
Indoors, with controlled lighting and a matte target, stray-light contributions from any single path are small, and a 0.1% floor is invisible. Outdoors, direct sunlight is about 100,000 lux and a deep shadow 10 lux, a ratio of 10,000:1 or higher. Bright sources like sun, sky, and headlamps can appear anywhere, including just outside the field of view.
Normalize peak luminance to 1.0, so shadow detail at 10,000:1 sits at 0.0001. A 1% veiling-glare floor adds 0.0100 everywhere, so that shadow signal now rides on a floor 100 times larger than itself, leaving about 1% local modulation, below what the pipeline and shot noise preserve.
Off-axis sources outside the field of view
A lens keeps admitting light past its specified field of view. Sources 20 to 60 degrees outside it still enter the barrel and reach the sensor by reflection. A stray-light-optimized lens absorbs these in baffles. One that is not produces haze or ghosts that seem to come from nowhere. This matters most for fixed automotive and outdoor cameras that cannot avoid bright sources.
HDR sensors need low-stray-light lenses to deliver their range
HDR sensors reach 120 dB or more of dynamic range, but a lens that limits contrast to 60 dB through stray light wastes that. Commonlands treats a stray-light-optimized lens as close to a prerequisite for an HDR sensor outdoors.
What is a BBAR coating and how does it reduce stray light?
BBAR stands for broadband anti-reflective coating: a multilayer thin-film coating that reduces Fresnel reflection across a wavelength band rather than at a single design wavelength. A BBAR-coated surface typically reflects under 0.5% across the band, against roughly 4-5% for uncoated glass. Lower surface reflection means more light reaches the sensor and less bounces between elements to form flare or ghosts.
A single quarter-wave AR layer gives a broad but shallow minimum (roughly 1.2-1.4% for MgF2 on crown glass). A V-coat drives reflection near zero at one wavelength, good for a single NIR line but poor elsewhere. BBAR instead holds low reflectance across a band, commonly 400-700nm for visible or 400-900nm for combined visible and NIR use.
BBAR is applied to individual elements during manufacturing, so a datasheet note like "BBAR on Lens 1 Surface 1" means exactly one surface in the stack carries it. The other surfaces may use standard AR, MgF2, or nothing. Total stray-light and ghosting performance depends on every surface combined, not just the one labeled BBAR.
BBAR is also distinct from a hydrophobic coating. BBAR reduces Fresnel reflection. A hydrophobic coating is a fluoropolymer layer on the front element that repels water and oil and has no meaningful effect on reflection. A lens can specify both as separate features. The table below separates the coating types Commonlands engineers see conflated most often.
| Coating type | What it reduces | What it does not solve |
|---|---|---|
| BBAR | Fresnel reflection across a wavelength band at the coated surface | Stray light from uncoated surfaces, barrel walls, or baffling gaps; distortion; aberrations |
| Narrow-band AR | Reflection at one target wavelength (e.g., 850nm) | Reflection at other wavelengths; combined visible/NIR use |
| Hydrophobic coating | Water, oil, and fingerprint adhesion on the front surface | Optical reflection, ghosting, flare, throughput loss |
Verify coating claims against the current datasheet: the design band, which surfaces carry the coating, and average reflectance (Ravg) across the band all vary by product, and the BBAR spec should be listed separately from any hydrophobic spec. With BBAR on only one or two surfaces, ghosting and flare still depend on element count, baffling, and barrel design.
One failure to watch: if a coating covers only 400-700nm but the system runs active NIR, the uncoated NIR reflections create ghosts that are invisible at the bench but clear in sensor output. Match the coating band to every illumination source.
How engineers reduce stray light in practice
There is no single universal fix. The approach depends on which part of the optical system generates the stray light.
The first tool is anti-reflection coating on every surface, since each uncoated interface reflects several percent and the losses compound across a 10-surface lens. A stray-light-optimized design adds black-coated barrel baffles, matte aperture stops, and attention to which surfaces can form second-order reflections toward the sensor.
Every extra surface, including a flat protective window, adds to the budget. For environmental protection, an IP-rated lens that seals internally beats a separate window. A sealed M12 lens such as the Commonlands CIL034 (IP67+) provides outdoor protection with no additional air-glass interfaces, removing two reflection surfaces a flat uncoated window would add.
A lens hood or housing extension blocks off-axis sources before they reach the front element, one of the lowest-cost fixes for fixed-mount cameras. Where packaging limits hood size, as in automotive, the lens design has to do more. With programmable lighting, arranging sources out of the direct lens view lowers stray-light loading in factory inspection.
Image processing is a fallback, not a substitute. Flat-field correction can partly compensate for uniform veiling flare if the pattern is stable, at the cost of bit depth, but it cannot remove scene-dependent stray light or ghosts that move with the source.
Stray-light-optimized M12 lenses and glare-control accessories
Commonlands stocks optical filters for ambient rejection below. Sealed IP-rated M12 lenses remove the need for a separate protective window in outdoor builds.
Stray-light and glare troubleshooting checklist
Work through these when an outdoor, HDR, or reflective-scene camera shows unexpected contrast loss, haze, or ghost artifacts. Commonlands engineers run the same sequence on a customer's stray-light complaint.
- Identify the artifact. Uniform haze (veiling flare), a structured spot displaced from a bright source (ghosting), or a saturated highlight on one surface (target glare). Each maps to a different fix.
- Capture a frame with the illuminator off. Usable signal from ambient alone points to a bandpass filter matched to the illumination wavelength.
- Move the light or camera 10-20 degrees. A highlight that tracks the source is specular geometry, not internal stray light.
- Count optical surfaces in the path. An uncoated window adds two 4-5% reflection surfaces. Consider an IP-rated lens that seals internally instead.
- Test cross-polarization on non-metallic parts, and expect to add illumination or open the aperture to compensate. Reduced exposure that recovers gradient means the highlight was clipping, not geometry.
- Confirm the lens is validated as low-ghost or stray-light-optimized for HDR or outdoor use, then verify with a hood on and off and real line-side lighting before locking the build.
Frequently asked questions
Commonlands lenses use anti-reflection coatings to cut internal reflections. These answers explain what coatings can and cannot fix.
What is stray light in a machine vision system?
Stray light is any light that reaches the sensor without having followed the intended imaging path through the lens. It originates from light scattering off internal barrel surfaces, reflecting off element edges, or bouncing between surfaces rather than passing cleanly through. It is not simply a bright object in the scene. It is unwanted light already inside the optical path, and its effect is a background signal that lowers contrast and can make features unresolvable at low luminance.
What is the difference between glare, flare, ghosting, and stray light?
Stray light is the general category: non-image-forming light inside the optical system reaching the sensor. Veiling flare distributes that light broadly as uniform haze, reducing contrast without obvious structure. Ghosting is a localized artifact, a structured secondary image from a specific surface-to-surface reflection. Glare is different: a saturating specular reflection from the scene target itself, a scene-side problem. Fixing target glare with polarizers or geometry does not fix internal stray light, and vice versa.
How do I reduce glare in machine vision?
Diagnose the failure mode first. For specular highlights on non-metallic surfaces, use cross-polarization: a linear polarizer on the illuminator and a crossed analyzer on the lens. For ambient contamination, use a bandpass filter matched to the illumination wavelength. For sensor clipping, reduce exposure or add an ND filter. Changing lighting geometry to move the specular angle off-axis is often the fastest first test.
What is a BBAR coating on a lens?
BBAR stands for broadband anti-reflective coating, a multilayer thin-film coating that reduces Fresnel reflection across a wavelength band rather than at a single design wavelength. Uncoated glass reflects roughly 4-5% of incident light per surface; a BBAR-coated surface typically reflects under 0.5% across the design band, improving throughput and reducing the internal reflections that cause flare and ghosting.
When does a protective window make stray light worse?
A protective window adds at least two new air-glass interfaces. Uncoated, each reflects roughly 4-5% of incident light; even AR-coated, a few tenths of a percent remain. In a multi-element system these reflections accumulate, and adding a standard flat window in front of an otherwise well-designed lens can increase veiling flare, particularly in high-dynamic-range scenes. An IP-rated lens that seals at the front element removes the need for a separate window and eliminates those interfaces from the stray-light budget entirely.
Need help selecting a low-stray-light lens for your application?
Commonlands engineering can help identify whether stray light, ghosting, or target glare is the root cause in your build. It helps select the right lens, coating, or filter for your sensor format, environment, and HDR requirements.



