Precision lens manufacturer for machine vision, medical, and industrial imaging applications.

Window or Lens: The Pixel Offset That Settles a Doubled Edge

Home - Application Notes - Window or Lens: The Pixel Offset That Settles a Doubled Edge
Reading Time: 8 min ( Word Count: 1,926 )

A faint second edge on every part, present only when the camera looks through the polycarbonate guard, is a window problem until proven otherwise. A flat panel in front of the lens adds two reflecting surfaces, and a small fraction of the light from every edge bounces between them before it reaches the sensor, so the sensor receives both the direct ray and a displaced copy of the same edge. The result looks like a doubling of the part outline and it behaves nothing like a lens fault, because it is uniform across the field and it moves when the panel moves. The useful question is not who is to blame in principle. It is how far the copy sits from the real edge, measured in pixels and then in microns, and whether that distance is large enough to move the feature your gauge measures.

Symptom, source, and the test that separates them

Attribution goes faster when you stop arguing about appearance and start separating the candidates with tests that give different answers. The table below is the short version. Each row names what you see, what usually causes it, and the test whose result cannot be explained by the other candidate.

What you see Most likely source Test that separates it What the result rules out
A faint duplicate at the same offset on every edge, across the whole field Reflection between the two faces of the guard panel Remove the panel, keep every camera setting, image the same target Lens decentre, which changes across the field rather than uniformly
Offset grows when the camera looks through the panel at an angle Wedge or tilt of the panel Rotate the panel in its own plane, then tilt it a few degrees A sensor-side or lens-internal reflection, which stays fixed to the sensor
Fringes change colour when you rotate a polarizer in front of the lens Stress birefringence in the polycarbonate, often from clamping Crossed polarizers, before and after loosening the frame Simple surface reflection, which does not respond to polarization
Duplicate is strongest close to a bright highlight or a grazing light Ghost from an uncoated or single-side coated face Known-good coated window of similar thickness in the same frame A purely geometric distortion of the panel
Duplicate survives with the panel removed, fixed to sensor coordinates Lens internal reflection, filter or sensor cover Rotate the lens in its mount and re-image The guard, for this particular artefact

Run the separating tests in this order

The order matters because the cheap tests remove most of the field before you spend money on a reference window. Do not run the machine without its guard unless the machine builder has approved a safe procedure for the test; a controlled image capture with the station locked out is enough for the optical question.

Guard out, everything else identical

Remove the panel completely, not just open the door. Keep the target, the working distance, the focus, the aperture, the exposure, the gain, the illumination and the processing identical. If the duplicate disappears, the panel or its mounting is responsible. If it stays in exactly the same place at the same strength, the lens, the filter stack or the sensor cover is the better suspect. If it weakens but does not vanish, both are contributing and you now have two problems with two owners.

Rotate and tilt the panel

Mark the panel before you touch it, then rotate it ninety degrees in its own plane and re-image. A ghost that rotates with the panel belongs to the panel. A ghost fixed in sensor coordinates does not. Tilting the panel by a few degrees is the second half of the test: a reflection ghost changes separation or intensity with angle, while a lens-internal reflection does not. This is also the test that tells you whether a small deliberate tilt could move the secondary reflection out of the sensor’s acceptance, which is sometimes a cheaper fix than a new window specification.

Swap in a known-good window

Removing the guard proves that the guard is involved. It does not prove that a different guard would be clean. A flat, coated reference window of similar thickness, mounted in the same frame at the same distance, separates “polycarbonate as a material” from “this panel as supplied”. This is the test to put in front of a supplier, because it is reproducible and it does not depend on either side’s opinion about what looks faint.

Convert the ghost to microns on the part

The geometry you are estimating

For a plane-parallel plate, the separation between the direct ray and the twice-reflected ray grows with the panel thickness, with the angle at which the camera looks through it, and with the refractive index of the material. A thick thermoformed panel viewed off-axis produces a bigger separation than a thin machined sheet viewed square on. You do not need a precise formula to make the first decision, but you do need the sign of the dependencies, because they tell you which of your stations is at risk and which is not.

What the edge detector actually reads

Here is the part that most attribution conversations miss. A sub-pixel edge tool does not see a “faint” line. It sees a gradient profile, and if the ghost falls inside the filter width of that tool, the second gradient pulls the computed edge position by a fixed amount. The bias is small, stable and easy to mistake for a calibration offset, which is why a gauge can pass its calibration and still measure every black mark half a pixel wide. Measure it in object units: take a certified artefact, image it with and without the panel, and convert the pixel difference with your calibration. If your calibration is 0.05 mm per pixel and the duplicate sits three pixels away, the ghost is 150 microns from the true edge. Compare that with the positional tolerance of the feature and with the repeatability of your edge tool. If the ghost is a third of the tolerance, it is not a cosmetic annoyance, it is part of your measurement uncertainty, and no amount of lens selection removes it.

Field curvature and distortion plots from an optical design, the kind of data that shows how a lens behaves across the field rather than at a single point
Design-side plots describe how the lens behaves across the field. A guard-panel ghost is a separate term in the error budget, and it has to be measured on the machine rather than read off a lens curve.

The window belongs in the BOM and in the optical path acceptance

Once the guard is part of the optical path, it needs the paperwork of an optical part. A purchase description of “clear polycarbonate, 5 mm” is not a specification, and a certificate measured on an unclamped sheet does not describe the panel after it has been bolted into a frame. Ask for the numbers below, measured on the finished part, at your field angle, and confirm that they still hold after mounting.

Field Why it decides the ghost What to demand
Material and process Thermoforming thins and warps the panel locally; machining from sheet keeps thickness uniform State the process, not just the resin grade
Thickness and tolerance Separation scales with thickness Nominal plus minus, measured across the clear aperture
Wedge and parallelism A wedge steers the secondary ray and displaces the copy Arcminutes or microns per millimetre, with method
Flatness and transmitted wavefront Waviness bends the whole field, not just the edges Deviation over the clear aperture, at your wavelength
Coating, both faces An uncoated face reflects several percent per surface Reflectance per surface at your band, both faces
Haze Wear adds scatter that hides the ghost until it is worse Haze value and the method used to measure it
Birefringence and residual stress Clamping stress changes the optical behaviour of the panel Retardation data for the mounted part, not the sheet
System ghost test Every individual number can pass while the combination still ghosts Images with your camera, lens and target, with the ghost measured in pixels and as a percentage of the primary edge

That last row is the one that ends the argument. A supplier who can produce a guard-in and guard-out pair, on your hardware, with the displacement reported as a number, has answered the question. A supplier who offers only a material datasheet has not. The direction of travel is not unusual in optics: published work on protective window design and material selection treats the window as a designed optical element whose thickness, material and coating decide what reaches the sensor, which is exactly the status it should have in your bill of materials. The same logic applies to the sacrificial windows used in weld cells, where the window is consumed by the process and replaced on a schedule, as described in the note on protection windows in weld cells.

What the lens maker can and cannot prove

A lens maker can show a great deal about the lens: MTF with and without a plain window in front of it, centration and tilt measurements from instruments such as a Trioptics centration station, transmitted wavefront from a laser Fizeau interferometer, and a comparison against a known-good unit of the same model. At the Hangzhou factory those instruments sit in the same metrology chain that produces the batch report shipped with every lot, which covers MTF, distortion, BFL and DOF with the test conditions and the inspection coverage.

What a lens maker cannot do is certify somebody else’s polycarbonate. The ghost belongs to a component the lens maker does not supply, mounted in a frame the lens maker does not control, at a distance chosen by the machine builder. Two honest consequences follow. First, if ghosting or veiling glare matters to your measurement, it has to be agreed as a project parameter, because it is not part of the standard batch report. Second, a lens change is rarely the right first move against a panel ghost. The exceptions are real: a longer working distance, a smaller aperture or a different lens with a better stray-light design can reduce the visible effect, but they change the optics of your station, which means a new acceptance run for the whole cell. Compare that cost with the cost of a properly specified window before you start shopping for glass.

For a station that has to see through a cover anyway, the sensor stack is the closer analogue, and the note on cover glass thickness and lens matching walks through what changes when a parallel plate becomes part of the design. If the panel is also exposed to coolant mist or washdown, the cleaning specification matters as much as the initial optical grade, because a scratched panel ghosts harder than a new one.

Fix the path, then the paperwork

The sequence that ends this class of problem is short. Prove the panel is involved with a guard-out comparison. Quantify the copy in pixels and in microns on the part. Put the window into the BOM as an optical component with the fields above. Add a guard-in and guard-out image pair to the station’s commissioning record, so the next panel is accepted on numbers rather than on appearance. Then, and only then, revisit the lens if a residual remains. The guard is usually the cheaper component and the one with no optical specification at all, which is exactly why it wins the blame contest and loses the paperwork contest.

Lenses for stations that look through a window are usually standard FA C-mount units, and the FA machine vision family covers formats from 2/3 inch to 1.1 inch with distortion held below 0.05%. If the panel turns out to be unavoidable and the measurement is tight, that is a conversation to have at the drawing stage rather than after the cell is built.

Written by Baker Zhao, Founder at Lensmind Optics

Baker Zhao

Baker Zhao

Founder, Lensmind Optics

Baker Zhao is the founder of Lensmind Optics, with 26 years of experience in the optical industry — including Vice President of Sales at Sunny Optical (Zhongshan) and earlier roles at Foxconn, LG and Sintai Optical. He leads Lensmind with a mission to help customers find reliable, application-specific optical solutions from development to volume production.

Leave a Comment