Optical filters for machine vision: polarizers, bandpass and IR-cut
How optical filters raise contrast and robustness in machine vision: polarizers to kill glare and reveal stress, bandpass filters matched to monochromatic lighting to reject ambient light, IR-cut and IR-pass, and neutral density. Selection, pairing with lighting, and mounting.
What an optical filter actually does for a vision system
An optical filter sits in the imaging path, usually screwed onto the front of the lens, and selectively blocks or transmits light by wavelength or by polarization state. In a machine-vision system its job is never decoration: it exists to raise the contrast of the feature you must inspect and to make that contrast repeatable as surrounding conditions change. Every image your camera forms is a sum of the light you control and the light you do not, and a filter is the cheapest, most reliable way to subtract the part you do not want before it ever reaches the sensor.
Think of it as signal-to-noise engineering done in glass. Your signal is the contrast that distinguishes a good part from a bad one: a scratch, a printed character, a fill level, an edge for gauging. Your noise is everything that obscures it: specular glare bouncing off a glossy surface, sunlight through a skylight that drifts over the shift, a part colour that changes batch to batch, or a sensor responding to invisible near-infrared you never intended to image. A filter lets you reject defined slices of that noise without touching the algorithm.
Because a filter acts in the optical domain, it is robust in a way software cannot match. Light that is blocked never produces photons on the sensor, never adds shot noise, and never has to be subtracted later by an exposure-sensitive algorithm. That is why experienced integrators reach for a filter before reaching for an image-processing fix: the right passband or polarizer can turn a marginal, environment-dependent application into a stable one, often for a fraction of the cost of a brighter light or a faster camera.
- Filters subtract unwanted light optically, before it ever hits the sensor, so they add no noise and need no per-image compensation.
- They raise contrast (the real goal) and, just as importantly, hold that contrast steady as ambient light, part colour and batch drift.
- Common machine-vision filter types: bandpass, IR-cut (and IR-pass / longpass), polarizers (linear and circular), and neutral density.
- The right filter is usually cheaper and more reliable than fixing the same problem with more light, a faster camera or extra software.
Polarizers: killing glare and revealing stress
Light reflecting off a smooth dielectric surface (glossy plastic, wet film, glass, laminate) becomes partially polarized. A polarizing filter exploits this: by orienting a polarizer in front of the lens, you preferentially block that specular, polarized reflection while still passing the diffuse light that carries the image of the part. The result is the classic glare-suppression effect, where a blown-out hotspot on a shiny label collapses and the text or defect underneath becomes readable. This is one of the highest-value tricks in vision precisely because specular glare is a leading cause of false reads on reflective parts.
The most powerful arrangement is cross-polarization: a linear polarizer on the light source and a second linear polarizer (the analyser) on the lens, rotated roughly 90 degrees to it. Light scattered diffusely by a rough surface is largely depolarized and still passes the analyser, whereas a mirror-like specular reflection from a dielectric retains the source's polarization and is strongly extinguished. This dramatically suppresses glare on glass and glossy plastics, and it is the standard technique for reading marks under clear coatings or inspecting through shiny films. The price is light: a single absorptive sheet polarizer transmits only on the order of 35-42% of unpolarized light, and a crossed pair on both light and lens cuts the budget twice, so plan for brighter illumination or longer exposure. Bare specular metal is a harder case, because reflection from a conductor does not polarize as cleanly as from a dielectric; cross-polarization still helps but rarely extinguishes metal glare completely.
Polarizers also reveal what is otherwise invisible. Viewed between crossed polarizers, mechanical or thermal stress in transparent plastics and glass produces colourful birefringence fringes (photoelasticity), which is how you inspect for moulding stress, weld lines or annealing defects. The trade-off to watch is linear versus circular. A linear polarizer is the element you cross-polarize with, but some sensors, beam-splitter optics and phase-detection autofocus systems behave incorrectly with linearly polarized light. A circular polarizer adds a quarter-wave retarder behind the linear element so the light leaving it is circularly polarized; it gives the same glare control while keeping downstream optics happy. In fixed industrial setups with manual-focus lenses, a linear polarizer is usually fine and cheaper; reach for circular only when a sensor, autofocus or beam-splitter specifically demands it.
- Glare on glossy dielectric parts is partially polarized, so a polarizer on the lens can suppress it and reveal the feature beneath.
- Cross-polarization (polarizer on the light plus a crossed analyser on the lens) is the strongest glare killer for glass and films; bare metal polarizes less cleanly, so expect only partial suppression.
- Crossed polarizers also reveal stress (photoelastic birefringence) in transparent plastics and glass.
- Budget for light loss: a sheet polarizer passes only about 35-42% of unpolarized light, and a crossed pair costs you twice, so plan brighter illumination or longer exposure.
- Use linear polarizers for cross-polarization; switch to circular only when a sensor, autofocus or beam-splitter dislikes linearly polarized light.
Bandpass filters: locking onto your wavelength, rejecting ambient light
A bandpass filter transmits a narrow band of wavelengths and blocks everything outside it. Paired with a monochromatic light source, it is the most effective single measure for making a vision system immune to ambient light. The logic is simple and powerful: you light the scene with, say, a 625 nm red LED, fit a red bandpass filter centred near that wavelength on the lens, and the camera now sees almost only your light. Factory fluorescents, daylight through a roller door, a passing forklift's headlights and an operator's worklamp mostly fall outside the passband and are rejected. The image stops changing when the room changes, which is exactly the repeatability a production inspection demands.
Matching is everything, and it must be done across three coordinated elements: the light's emission band, the filter's passband, and the camera's spectral response. Choose an LED wavelength that gives good contrast on your feature, select a bandpass filter whose centre wavelength and bandwidth straddle that LED's emission (a band tens of nanometres wide is typical for LED matching), and use a monochrome camera so no Bayer colour filter array throws away the light you carefully selected. A narrower passband rejects more ambient light but demands tighter wavelength control and gives up a little of your own signal; a wider one is more forgiving of LED tolerance and temperature drift but lets more stray light through. Size the band to cover your source's emission with sensible margin, not to be as narrow as physically possible.
Wavelength choice is also a contrast tool in its own right, because colour interacts with the filter selection. Illuminating and filtering at a wavelength a feature absorbs makes it appear dark, while a wavelength it reflects makes it appear bright; that is how you make red printing vanish or a blue defect stand out on a monochrome image. Two practical cautions. First, bandpass filters are thin-film interference coatings, so their passband shifts toward shorter wavelengths (a blue-shift) as the angle of incidence increases, which matters with short-focal-length, wide-angle lenses where rays strike the filter steeply. Second, the passband must comfortably cover the LED's real emission including its thermal drift, because an LED's peak wavelength shifts slightly with junction temperature and you will slowly lose signal as the light warms up. Get these right and a bandpass-plus-mono-plus-matched-LED chain is close to bulletproof against the single most common cause of unstable inspections: changing ambient light.
- Bandpass plus monochromatic light plus a monochrome camera gives near-immunity to ambient light, the top fix for environment-dependent inspections.
- Coordinate three things: LED emission band, filter centre and bandwidth, and the camera's spectral response.
- Narrow band means more ambient rejection but less tolerance to LED drift; wider band is more forgiving but lets in more stray light.
- Interference bandpass filters blue-shift with angle of incidence, so beware steep ray angles on short-focal-length lenses.
- Choosing a wavelength a coloured feature absorbs versus reflects lets you make it appear dark or bright on the mono image.
IR-cut and IR-pass: managing the invisible band
Silicon image sensors respond well beyond what the eye sees, typically remaining sensitive out to roughly 1000-1100 nm in the near-infrared before silicon becomes transparent. This invisible response is a frequent, silent source of trouble. Many white LEDs, halogen and incandescent lamps, and especially sunlight carry significant near-IR; because IR focuses to a slightly different plane than visible light (chromatic focus shift) and reflects differently off many materials, an uncontrolled IR component can soften focus, distort colour relationships and make the image drift with the time of day. An IR-cut filter blocks the near-IR while passing the visible band (a common cut-on lies around 650-700 nm, with the longer band rejected), so the camera sees only the visible light you designed around. For colour cameras IR-cut is effectively mandatory for faithful colour, which is why most colour sensors ship with one bonded over the array; for monochrome systems that rely on visible-light contrast and broadband white illumination it is the standard way to keep response accurate and repeatable.
The mirror image is the IR-pass (or longpass) filter, which blocks visible light and transmits only the near-IR. Combined with IR illumination, this lets you inspect in what looks to a human like darkness, which is invaluable when you must defeat ambient visible light entirely, image self-luminous or hot processes, or exploit the fact that many materials behave very differently in the IR. Common near-IR working points such as 850 nm and 940 nm are popular because efficient LEDs exist there and 940 nm in particular sits in a dip of the solar spectrum at ground level, which suppresses sunlight interference outdoors. Materials that look opaque in visible light can become partly transparent in the near-IR, and printed inks, adhesives, fill levels and silicon features often reveal contrast that is hidden to the eye.
Two cautions apply to both directions. The camera must actually be sensitive at your working wavelength, so confirm its quantum-efficiency curve before committing to deep near-IR. And ordinary visible-corrected lenses are not focused for the IR, so an IR-pass setup may need refocusing or a lens rated for near-IR to stay sharp; the same chromatic focus shift that an IR-cut filter exists to remove is the reason an IR-pass image can drift out of focus if you simply swap filters.
- Silicon sensors stay sensitive to roughly 1000-1100 nm, so stray near-IR can soften focus, distort colour and make images drift with the time of day.
- IR-cut blocks the near-IR (common cut-on around 650-700 nm); it is effectively mandatory for colour cameras and standard for accurate broadband monochrome.
- IR-pass plus IR illumination images in visible darkness; 850 nm and 940 nm are popular, with 940 nm helping reject sunlight outdoors.
- Confirm the sensor's quantum efficiency at your wavelength, and expect to refocus or use an IR-rated lens, because visible-corrected optics shift focus in the IR.
Neutral density and the rest of the toolkit
A neutral-density (ND) filter is the deliberately boring member of the family: it attenuates light roughly evenly across the visible band without changing colour. Its job is not contrast but exposure control. When a scene is too bright for the shortest practical exposure, or when you want to open a lens aperture wider to soften depth of field or reach a sweet spot in MTF while keeping the sensor out of saturation, an ND filter buys you that headroom. ND values are quoted either as optical density (an ND with optical density 1.0 transmits about 10%, 2.0 about 1%) or as a transmission percentage, so read the spec carefully before ordering.
Longpass and shortpass filters round out the set. A longpass filter transmits everything above a cut-on wavelength and blocks below it; an IR-pass filter is simply a longpass with its edge in the near-IR. A shortpass does the opposite, and an IR-cut filter is essentially a shortpass with its edge near the visible-IR boundary. Dichroic versions of these edges, built as interference coatings, are common and share the bandpass filters' angle sensitivity. Choosing between an absorptive coloured-glass filter and an interference-coated one is a real engineering decision: absorptive glass is angle-insensitive and cheap but has soft, broad edges; interference coatings give sharp, well-defined edges but blue-shift with angle and can show ghosting if reflections are not managed.
Whatever the type, optical quality is not a place to economise. A filter that adds wavefront error, surface irregularity or scatter degrades the very image you built a high-resolution system to capture, and a poorly coated filter can introduce ghost reflections or flare. In a precision gauging or high-magnification application, a cheap filter can quietly cap the resolution you paid for in the lens and sensor.
- Neutral density attenuates evenly across the visible band for exposure control, not contrast: use it to avoid saturation or to open the aperture.
- Read ND specs carefully: optical density 1.0 passes about 10% and 2.0 about 1%, but some vendors quote transmission percentage instead.
- Longpass/shortpass edges underlie IR-pass and IR-cut; absorptive glass is angle-insensitive with soft edges, interference coatings are sharp but angle-sensitive.
- Do not economise on optical quality: a poor filter adds scatter, ghosting and wavefront error that cap the resolution of an otherwise good lens and sensor.
Selecting and pairing filters with lighting and camera
The order of decisions matters. A filter is a partner to the lighting, not a substitute for it, so choose the wavelength first by deciding how to light the feature for maximum contrast, then pick the filter that locks onto that wavelength, then the camera that can see it, and only then the mechanics. Working in this sequence avoids the classic mistake of buying a narrow bandpass filter for a wavelength your LED does not actually emit, or fitting an IR-cut filter and then wondering why an IR-illuminated scene went dark.
For the common environment-immunity case the recipe is concrete: a monochromatic LED, a bandpass filter sized to cover that LED's emission with margin, and a monochrome camera with good quantum efficiency at the wavelength. For glare on glossy dielectric parts, start with a polarizer on the lens and escalate to full cross-polarization (polarizer on the light, crossed analyser on the lens) if a single polarizer is not enough, remembering to add light to cover the loss. For colour-faithful or broadband-white work, fit an IR-cut filter. For inspection that must ignore visible light entirely, use IR illumination with an IR-pass filter and a lens that stays sharp in the near-IR.
Validate the chain rather than trusting datasheets alone. Confirm the LED's actual emission spectrum, the filter's measured passband, and the camera's quantum-efficiency curve overlap where you expect, then test under the worst realistic ambient light your line will ever see, including direct sun through a door or a maintenance lamp held close. The whole point of a filter is stability, so the acceptance test is not a single good image but a consistent one as conditions are deliberately disturbed.
- Decide in order: wavelength via lighting, then filter, then camera, then mechanics; the filter partners the light rather than replacing it.
- Environment immunity: monochromatic LED plus matched bandpass plus monochrome camera with good QE at that wavelength.
- Glare: a lens polarizer first, then full cross-polarization with added light to cover the loss.
- Validate overlap of LED emission, filter passband and sensor QE, then stress-test under the worst ambient light the line will ever see.
Mounting filters and the mistakes that undo them
Mechanics decide whether a correct filter choice survives contact with the real cell. The simplest mount is a threaded filter screwed into the front of the lens, so confirm the lens filter thread (a metric size such as M25.5, M30.5 or M37.5, or a photographic size like 37 mm or 49 mm) before ordering, and use a step ring rather than forcing a mismatch. Where threads do not fit or you need to swap quickly, a square-filter holder in front of the lens accepts standard glass squares and is easy to change between products. For monochrome interference filters mounted close to the sensor, keep the filter clean and square: dust and fingerprints scatter light and a tilted filter shifts the passband.
Tilt is the most common silent error. Because interference bandpass and dichroic edge filters blue-shift with angle of incidence, a filter that is not square to the optical axis moves its passband, and a wide-angle lens that throws rays onto the filter at steep angles spreads the effective passband across the field. Keep filters perpendicular to the axis and be cautious pairing a tight passband with a short-focal-length lens; if you must, choose a slightly wider passband to absorb the angular spread. Reflections are the second trap: an uncoated or poorly coated filter can bounce light between its surfaces and the lens, producing ghost images and flare that no software cleans up well.
The quietest failure of all is an unmanaged ambient path. A filter on the lens only controls light entering the lens; if the camera can also see a bright window, a status lamp or an inter-reflection inside an open enclosure at a wavelength inside your passband, repeatability suffers even with the right filter fitted. Treat the enclosure, the lighting geometry and the filter as one system: shroud stray light, match the filter to the light, mount it clean and square, and the filter delivers the stability it promises instead of becoming one more variable to debug.
- Confirm the lens filter thread (for example M25.5, M30.5, M37.5 or a 37/49 mm photographic size) and use step rings instead of forcing a mismatch.
- A square-filter holder in front of the lens makes per-product filter swaps fast and avoids thread incompatibilities.
- Keep interference filters clean and perpendicular: tilt blue-shifts the passband and a wide-angle lens spreads it across the field.
- Manage reflections and the ambient path: poor coatings cause ghosting, and any stray in-band light bypassing the filter destroys the repeatability you installed it for.
Frequently asked questions
Related categories
- Optical filters
- Lenses and filters
- Machine vision lighting
Related guides
How to choose machine vision lighting
A practical guide to choosing machine vision lighting: geometry, wavelength, strobe vs continuous, ambient control and how to maximise feature contrast for reliable inspection.
How to choose a lens for machine vision
A practical engineer's guide to selecting machine-vision lenses: focal length from FOV and working distance, sensor format, resolving power, aperture, depth of field and telecentricity.
Monochrome vs color cameras
When to choose monochrome vs color machine-vision cameras: Bayer light loss and effective resolution, color-dependent tasks, wavelength-specific lighting, NIR sensitivity and processing cost.