Optical Filters in Machine Vision

Optical filters modify the spectral characteristics of the light reaching the camera sensor. In machine vision systems, they are used to suppress unwanted wavelengths, reduce reflections, improve image contrast, or isolate specific spectral bands that are relevant to the inspection task.

By conditioning the light before it reaches the sensor, optical filters can improve image quality and simplify subsequent image processing. In many applications, filtering unwanted light optically is more effective than attempting to compensate for its effects after image acquisition.

Types of Optical Filters Used in Machine Vision

Filter Type

What It Does

Primary Machine Vision Use

Bandpass

Transmits a narrow wavelength range, blocks all others

Matches the wavelength of the illumination source to suppress ambient light and improve image contrast.

Polarization

Transmits light oscillating in one plane only

Reduces reflections from shiny or transparent surfaces.

IR cut (shortpass)

Blocks infrared wavelengths, passes visible light

Reduces infrared light reaching the sensor to improve color reproduction and minimize focus shifts caused by chromatic aberration.

Longpass

Transmits wavelengths above a cut-on point, blocks shorter wavelengths

Near-infrared imaging; suppressing shorter wavelengths in applications requiring longer-wavelength light.

Neutral density (ND)

Reduces total light transmission uniformly across all wavelengths

Reduces the amount of light reaching the sensor to help prevent saturation in bright imaging conditions.

Bandpass Filters

A bandpass filter transmits light within a defined wavelength range while blocking wavelengths outside that range. In machine vision, bandpass filters are commonly used with monochromatic illumination to improve image contrast and reduce the influence of ambient light.

For example, if an inspection system uses a red LED with a peak wavelength of approximately 625 nm, a bandpass filter centered at the same wavelength allows the camera to capture primarily the reflected illumination while attenuating much of the ambient light. This improves image contrast and helps make the imaging system less sensitive to variations in the surrounding lighting conditions.

This approach is particularly effective in production environments where ambient lighting cannot be tightly controlled, such as factory floors near windows or under fluorescent ceiling lights that flicker with the mains frequency. A matched illumination and filter combination removes the ambient variation from the captured image.

When selecting a bandpass filter, the center wavelength should match the peak emission wavelength of the LED source. Bandpass filters are specified by center wavelength and full width at half maximum (FWHM), which defines how narrow the transmission window is. A narrower FWHM provides stronger ambient rejection but requires more precise wavelength matching between the filter and the illumination source.

A range of bandpass filters is available for The Imaging Source industrial cameras.

Polarization Filters

A polarization filter transmits light oscillating in one direction and blocks light oscillating in the perpendicular direction. In machine vision, this property is used to suppress specular reflections from surfaces that would otherwise cause glare or obscure detail.

When light strikes a shiny, non-metallic surface (polished plastic, glass, or a liquid), it reflects in a partially polarized state. A linear polarization filter oriented perpendicular to the polarization angle of the reflected light attenuates the reflection, allowing the camera to record surface detail that would be obscured by glare under standard illumination.

This is distinct from the polarization cameras covered in the Polarization Cameras in Machine Vision article, which use a sensor-level polarization array to capture directional polarization data in a single shot. A lens-mounted polarization filter is a simpler and less expensive solution for applications where glare suppression is needed but full polarimetric analysis is not required.

For applications requiring full polarimetric imaging, The Imaging Source also manufactures industrial cameras based on the Sony Polarsens sensor with an integrated on-chip polarization array.

IR Cut Filters

Image sensors, including CMOS sensors used in industrial cameras, are sensitive to near-infrared (NIR) light as well as visible light. For color cameras, this creates two problems: NIR light has no color information but contributes to all color channels, shifting the apparent color balance. For both color and monochrome cameras, it creates a focus accuracy issue: visible and infrared light have different focal lengths due to chromatic aberration in standard lenses, so if both wavelengths reach the sensor, the system can only be sharply focused for one of them.

An IR cut filter (also called a shortpass or hot mirror filter) blocks wavelengths above approximately 650-700 nm while passing visible light. It is often integrated directly into the camera housing on color cameras rather than supplied as a separate lens accessory. Some cameras, including the Z Series from The Imaging Source, include a mechanical IR cut filter switch that can be enabled or disabled in software, allowing the camera to operate in visible or near-infrared mode.

Matching Filter to Illumination

In machine vision system design, filter selection is typically driven by the illumination source and the imaging requirements.

Illumination Type

Recommended Filter

Effect

Red LED (620-630 nm)

Bandpass at 625 nm

Suppresses much of the ambient light while transmitting the illumination wavelength, helping improve image contrast

Near-infrared LED (850 nm)

Longpass (780 nm+) or bandpass at 850 nm

Supports near-infrared imaging while reducing the influence of visible light

White LED with polarized output

Polarization filter

Reduces specular reflections from shiny or transparent surfaces

Broadband visible illumination

IR cut filter

Reduces infrared light reaching the sensor to improve color reproduction

High-intensity strobe (any wavelength)

ND filter

Reduces the amount of light reaching the sensor to help prevent saturation

Because optical filters are selected to complement the illumination, the illumination source is typically chosen first. Once the illumination wavelength is established, an appropriate filter center wavelength, bandwidth (FWHM), and blocking characteristics can be selected.

Frequently asked questions

All filters reduce the total light reaching the sensor to some degree. A bandpass filter blocking most of the spectrum will require the illumination intensity, exposure time, or gain to be increased to maintain adequate image brightness. In practice, because a matched bandpass filter also blocks most ambient interference, the signal-to-noise ratio of the image often improves despite the reduction in total light, provided the illumination source is sufficiently bright at the filter's passband wavelength.

Yes, but the effect differs. On a monochrome camera, a bandpass filter improves contrast by restricting the sensor's response to the illumination wavelength. On a color camera, a bandpass filter will cause the image to appear predominantly in the color channel closest to the filter's passband. A 625 nm bandpass will produce a predominantly red image. For most industrial inspection tasks, monochrome cameras are preferred when using bandpass filters because the full pixel resolution is available for the target wavelength rather than being split across color channels.

In most machine vision setups, the optical filter is mounted between the lens and the object, either as a threaded filter screwed onto the front of the lens or held in a filter holder in front of the lens. For board-level cameras with M12 lenses, filters are typically integrated into the lens assembly or mounted in a separate housing ahead of the lens. The filter should not be mounted between the lens and the camera sensor, as this can shift the back focal distance and affect focus.

For most machine vision applications with standard lenses, filter thickness has a negligible effect on image quality. For telecentric lenses or other precision optical systems, filter glass introduces a slight shift in focal position and can introduce wavefront error if the glass is not optically flat. In these applications, precision optical filters with tightly controlled thickness and flatness tolerances are appropriate.

Glossary