Filter in Front of Lens vs. Sensor: Why Placement Changes Your Working Distance
Filter in Front of Lens vs. Sensor: Why Placement Changes Your Working Distance
The 30-Second Version: A filter isn't just a spectral gate—it's a glass plate that shifts your focus. Where you put it determines how much trouble you're in.
The Problem Nobody Warns You About
You've carefully selected your filter. Bandwidth is right. Wavelength is right. The spectral curve looks perfect. You mount it, power up the system, and... wait, why is the image blurry?
Here's what happened: a filter is a plane-parallel glass plate. Glass bends light. When light passes through that glass, the optical path length increases, which means the system has to refocus to form a sharp image.
In real builds, this shows up as: "We added a filter and suddenly our working distance is wrong."
The Classic Gotchas
This catches teams at the worst possible times.
You're converting a system from visible to IR illumination, so you remove the IR-cut filter that was blocking your new wavelength. Suddenly your focus is off.
You're adding a daylight-cut filter to suppress ambient light that's been washing out your images. The filter works great spectrally—but now your working distance is wrong.
You're swapping to a thicker filter, maybe for better spectral performance. Your carefully specified mechanical design no longer delivers sharp images.
None of these are mysterious. It's just glass doing what glass does.
The Rule of Thumb That Actually Works
For typical optical glass with a refractive index around n = 1.5, there's a simple relationship that lets you estimate the working distance shift before you discover it the hard way.
If your filter is in front of the lens: the working distance increases by approximately the glass thickness divided by 3.
A 2 mm filter in front of your lens shifts the working distance by roughly 0.67 mm. That's annoying—you might need to shim your mount or adjust your mechanical design—but it's manageable. A few tenths of a millimeter is something you can deal with.
If your filter is in front of the sensor: the working distance increases by approximately the glass thickness divided by (3 × β²), where β is the magnification of your optical system.
This is where teams get blindsided.
Why Magnification Matters So Much
That β² term is the villain in this equation. Magnification (β) is the ratio of image size to object size. In many "normal" machine vision setups—where you're imaging a reasonably large field of view onto a sensor—magnification is much less than 1.
Let's run the numbers with a 2 mm filter.
If your magnification is 1.0 (a 1:1 macro setup where the image is the same size as the object), the sensor-side shift is the same as the lens-side shift: about 0.67 mm. No surprise.
If your magnification is 0.5, that β² becomes 0.25, and the shift becomes 2 ÷ (3 × 0.25) = 2.67 mm. Now you're at four times the lens-side shift.
If your magnification is 0.1—which is common in many machine vision applications—that β² becomes 0.01, and the shift becomes 2 ÷ (3 × 0.01) = 66.7 mm.
Read that again: a 2 mm filter in front of the sensor, at a typical magnification, can shift your working distance by nearly 67 mm.
That's not millimeters you can shim. That's centimeters. Your rigid machine frame is now "wrong" by a distance that might require re-machining brackets, redesigning mounts, or completely rethinking your mechanical layout.
Why This Catches People
Most engineers correctly intuit that adding glass will change the focus "a little bit." A few millimeters, maybe. Something you can adjust for.
But they're thinking about the filter-in-front-of-lens case, or they're thinking about magnification near 1.0. In the typical machine vision scenario—sensor-side filter, small magnification—that 1/β² factor explodes.
At β = 0.05 (a larger field of view relative to sensor size), the multiplier is 400×. That 2 mm filter now causes over 260 mm of working distance shift.
This is not something you "adjust for." This is something that can break your mechanical design.
Design Takeaways
Decide filter placement early. This is an optical-mechanical decision that affects your system architecture. Don't leave it for later.
Treat built-in camera filters as part of the design. Many cameras have IR-cut filters or protective cover glass built in. These aren't "free"—they're contributing to your optical path length, and if you remove or swap them, your system will change.
Don't casually swap filter stacks late in development. That "easy upgrade" to a better filter might come with centimeters of working distance change that your mechanical design can't accommodate.
Calculate before you build. Run the numbers for your actual magnification and filter thickness. If the shift is more than your adjustment range, you need to know that before parts are made.
Consider filter placement in your tolerance analysis. If you're specifying a working distance with tight tolerance, the filter thickness tolerance feeds directly into that. Thicker filter = different working distance.
The Bottom Line
A filter is never just a spectral accessory. It's an optical element that changes your system's behavior. Respect the physics—plan for the working distance shift, and you'll avoid the unpleasant surprise of sharp spectral performance paired with blurry images.
This post is part of KUPO's technical education series on optical filters for machine vision. Questions about filter selection for your application? Contact our optical engineering team.