A date code printed in red ink sinks into a grey housing the moment a monochrome camera looks at it under white light. Both surfaces reflect the LED across the whole visible band, the gray levels nearly touch, and the threshold hunt begins. The fix is a wavelength decision, not more gain: put a color filter over the lens that passes one band and blocks the rest, and the same two surfaces separate by more than a hundred gray levels. This page gives the selection rule for color, short-pass, long-pass and grey filters on monochrome cameras, the stops each one costs, a worked example with the arithmetic shown, and the checks to run before you order glass.
The rule: same color bright, opposite color dark
A colored surface keeps the light it matches and absorbs the rest: red ink reflects the red band and eats blue and green. A grey or white surface reflects every band about equally. A monochrome sensor adds up whatever reaches it, so under white light the two surfaces land close together in gray levels and a threshold has little to cut on.
A color filter is a bandpass in a mounting ring: it passes one band and blocks the others. Pick the band of the surface you want bright. Everything that reflects that band climbs toward white; everything else falls toward black.
| Situation | Filter band | Image result |
|---|---|---|
| Colored feature on a grey or dark background | feature's color | feature bright, background dim |
| Colored feature on a white label | opposite color | feature near black, label bright |
| Colored background around a dark feature | background's color | background bright, feature dark |
Applied to the light instead of the lens, the same rule is why LED color decides contrast before any filter enters. The monochrome light-color contrast behavior and the case for mono with filters over a color camera are treated in depth there. For the wider family tree, machine vision optical filters sorts bandpass, polarizer and ND apart.
Worked example: red print on a grey coating
Assume a white LED whose energy splits evenly across three bands — blue near 450 nm, green near 550 nm, red near 630 nm — an 8-bit camera, and these reflectances: grey coating 0.40 in every band, red ink 0.70 in red, 0.10 in green, 0.05 in blue. Exposure is set so the coating reads gray 150. The filter passes 85% of its band and blocks the rest.
Without a filter the ink sits at 106 when the coating is at 150: a gap of 44 gray levels, thin against part-to-part variation and ambient drift.
Blue filter next. Only the blue band survives, scaled by 0.85: coating 0.40 × 0.85 = 0.34, ink 0.05 × 0.85 = 0.0425, ratio 0.125. Raise exposure by 1.20 / 0.34 = 3.53x to bring the coating back to 150 and the ink reads 150 × 0.125 ≈ 19. The gap widens to 131 levels: black print on mid-grey, exactly what a threshold wants.
The red filter inverts the image: ink 0.70 × 0.85 = 0.595 against the coating's 0.34, a ratio of 1.75. At 3.43x exposure the ink sits at 255 and the coating at 146 — a bright mark on a dim field, convenient for presence and area checks, wasteful for OCR.
What the filter costs in stops
A bandpass fed by white light throws away the bands it blocks, and the lost photons come back as exposure, gain or light current.
A 1.0 ms exposure becomes 3.53 ms. That is where filtered stations quietly fail: a part moving 150 mm/s smears 150 mm/s × 3.53 ms = 0.53 mm, which is 5.3 pixels at 0.10 mm per pixel. To hold blur under one pixel, exposure must stay at or below 0.10 mm ÷ 150 mm/s = 0.67 ms, so the station needs 3.53 / 0.67 ≈ 5x more light on the part. Buy it with strobe pulse energy, LED current or iris; opening one stop, F4 to F2.8, doubles the light and covers about half the loss. Strobe budgeting per channel has its own arithmetic — see LED strobe duty cycle: matching lights and controllers.
Swap the white light for a colored one and the loss disappears: a blue LED puts all its photons in the band you keep, so the same contrast costs no extra exposure. A filter earns its place when it must also block ambient or another light channel; otherwise one well-chosen wavelength at the light is the simpler, loss-free route.
When the iris must give some of those stops back, the LS-FFL-0567 carries F2.8-22 and <0.3% distortion for a 1.1", 20 MP sensor.
- Type
- Machine vision fixed
- Sensor format
- 1.1"
- Mount
- C-mount
- Resolution
- 16-25 MP
Longer exposure on a vibrating line invites image shift as well as blur; the LS-FFL-0475 is an anti-vibration 2/3" lens at 36.61 mm built for those stations.
- Type
- Anti-vibration
- Sensor format
- 2/3"
- Mount
- C-mount
- Image circle
- 8-11 mm
Short-pass, long-pass and grey filters
Color filters are one of three families you will fit to a monochrome camera.
Short-pass. Transmits wavelengths below its cutoff, blocks those above. Silicon monochrome sensors respond past visible red out to about 1100 nm, so daylight, incandescent shop lights and hot surfaces leak infrared into the image and lift the black level. A short-pass cut near 700 nm keeps the visible band and stops the infrared tail; the UV-to-IR wavelength map shows where each band sits.
Long-pass. The mirror image: transmits above its cutoff. In fluorescence work a long-pass barrier filter in front of the lens blocks the 365-470 nm excitation and passes the visible emission; the station design is laid out in fluorescence inspection lighting: excitation and filters. Pair a long-pass with a short-pass and you have assembled a bandpass with whatever gap you choose.
Grey. A grey or neutral density filter attenuates every wavelength equally, so contrast ratios and color balance survive untouched; only the level drops. Transmission follows T = 10^(-OD): OD 0.3 passes 50%, OD 1 passes 10%, OD 2 passes 1%. Fit one to tame an overdriven strobe or a camera whose shortest exposure is still too long — sizing the density carries its own worked math.
Where the filter goes: lens or light
Filter on the light is simple to fit and colors one channel precisely. It cannot touch light arriving from anywhere else: room lights, HMI screens, windows. Filter on the lens cleans every ray regardless of source, which is why it is the choice when ambient is uncontrolled; when ambient swings hour to hour, controlling ambient light variation plans for it.
Position matters as much as side. On a standard C-mount lens, screw the filter onto the front thread and refocus; glass behind the lens shifts the back focus and the calibration with it. On a telecentric lens the filter must sit in front, parallel, in the collimated space — the telecentric filter placement rules explain why. The LS-TCL-0574 runs at 0.4x with 227 mm of working distance on a 1.2" sensor, leaving real room for a holder ahead of the barrel.
- Sensor format
- 1.2"
- Mount
- C-mount
- Image circle
- 16-22 mm
Stacking filters multiplies transmissions and the stops add: a bandpass at 1.8 stops plus a polarizer, tallied in polarizer light loss, comes out of the same exposure budget.
When the filter rule fails
White background: a white label reflects every band, so a red filter brightens the print and the label together and nothing is gained. Take the opposite color instead and let the label hold its brightness while the print drops to black.
Two grey surfaces: no wavelength separates a 0.40 reflectance from a 0.45 one, so change the geometry, not the glass. Low-angle dark field turns scratches and raised print bright against a dark surround; the law-of-reflection choice between bright and dark field picks the geometry, and matching light geometry to surface and feature completes it.
Color that varies: ink lots drift in hue, and a narrow bandpass can slide off the mark's peak between shipments. Test production parts, not swatches, before you commit.
Ambient inside the band: a red bandpass passes the red content of white room light exactly as it passes your red light. Out-of-band sources are killed completely; in-band ambient only shrinks with everything else, so measure the station with the lights as they will run.
Checks before you order
- Look through every candidate filter at production parts under the production light. A gray gap of 50 levels or more on 8 bit is a comfortable working margin; less invites threshold drift.
- Run the stops arithmetic against the exposure and blur budget before ordering, not after (formulas above).
- Match the band to the light: a white LED peaks in blue near 450 nm and its red content sits near 630 nm, so order the band where your light and the surface overlap.
- Check the filter's mounting thread against the lens barrel, with step rings to bridge a mismatch; refocus and re-calibrate after any rear-mounted glass.
- Decide the polarity the vision tool will see — bright mark or dark mark — and teach the tool on filtered images, not unfiltered ones.
- Confirm the light controller channel can deliver the extra strobe energy; the controller-to-light cable and current notes cover what the wiring side must carry, and the accessories finder lists extension and drag-chain cables.
The decision, per case
Colored feature on grey or dark: filter in the feature's color, feature bright, pay 1.8 stops. Colored feature on white: opposite-color filter, feature black, label bright, same 1.8 stops. Ambient or a second light channel to kill: put the filter on the lens; otherwise a colored light does the job with no loss. Grey on grey: geometry, not glass. Fluorescence: long-pass barrier at the lens. Too much light with the right colors: grey filter chosen by its OD.
Build the station from the machine vision lenses — the lens finder filters by sensor format and resolution, and the configurator starting at the lens walks camera, lens and light in order; cabling sits with the lighting accessories. More filters-and-lenses reading is gathered on the lenses topic page, and the contact page reaches us when a station drawing needs a second pair of eyes.
Questions
Can I use a color filter on a color camera?
You can, but the color filter array on the sensor already splits colors per pixel, so a red bandpass mainly starves the green and blue photosites: gain rises and demosaicing spreads artifacts across the image. Filter-based contrast work belongs on monochrome sensors; on a color camera, correct the white balance or use a light-balancing filter instead.
How much light does a bandpass filter really cost?
With a white light whose energy splits evenly across blue, green and red, a bandpass passing one band at 85% transmits about 0.28 of the light: log2(1/0.28) is roughly 1.8 stops, so exposure or illumination must rise about 3.5x. Narrower filters cost more; measure the actual station with a power meter when the exposure budget is tight.
Does fitting a filter change focus or calibration?
A flat filter on the front thread of a standard lens barely moves focus; glass mounted behind the lens shifts the back focus, so refocus and re-run calibration after fitting. On a telecentric lens, keep the filter in front and parallel, or telecentricity and magnification drift. Re-check distortion on a calibration plate once the glass is in place.
Which filter suits a red laser line on a shiny part?
A red bandpass matched to the laser's stated wavelength passes the line and blocks most room light and other illumination, which cleans the profile on glossy surfaces. Keep the exposure short, enclose the station, and treat the projector as a laser with a class label: never view it directly or bypass its interlocks.
Why does the filtered image look noisy indoors?
The bandpass cuts roughly two thirds of a white light's output, and the missing photons come back as gain, which brings sensor noise with them. Raise the light's current or pulse it longer, open the iris one stop, or switch to a colored light that needs no filter. Check the controller channel rating before overdriving any LED.


