A camera that images a part through glass inherits every speck on that glass. In the classic case — a 0.5 mm part inspected from below through the window built into the conveyor underside — dirt on the workpiece-side face and settled dust on the camera-side face both land in the image as blobs, streaks and fibres, and no threshold can tell them from real defects. You get the diagnosis first, so you can prove which face is dirty, then the countermeasure set for each face: purge air, ionization, advancing protective film, wiper-washer units, ultrasonic wash, rotating windows, and the geometry changes that take the window out of the optical path. A monitoring method and a checklist at the end keep the fix holding for the life of the cell.
First prove the dirt is on the window
Blotches that stay fixed in the frame while the part moves are contamination in the optical path. Run three tests, in this order, before spending on hardware.
Part-out frame. Stop feeding parts, keep light and exposure identical, and capture the empty field. Every dark feature left in that frame sits on the window, the lens or the sensor side of the path — the part contributes nothing. Keep the frame and its dark-pixel count as your baseline; the monitoring method below builds on it.
Jog test. Nudge the conveyor a few millimetres and capture again. Window dirt stays pixel-fixed; a genuine part feature travels with the part. One pair of frames settles the question.
Refocus test. Focus on the window face, then on the part plane. At the magnifications used for sub-millimetre parts, depth of field is a few micrometres — put your own lens into the depth-of-field calculator — while the window and part planes sit millimetres apart. The face that goes sharp is the face that is dirty.
A known target in the part plane turns the tests into a permanent reference. The LS-LXR-0029 calibration target carries 0.5 mm dots on a 76 x 76 mm grid — dots at part scale, so the same frame shows your true resolution and any blotch that is not part of the target is window dirt.
- Type
- Calibration targets
For what dust does after it reaches the algorithm — false rejects on a glass stage and the image-side triage — see Reducing dust false rejects in glass-stage inspection.
Which face is dirty: workpiece side or camera side
The two faces foul for different reasons and need different hardware, so split the diagnosis before buying anything.
The workpiece-side face receives whatever the process throws: chips and swarf, oil mist and coolant film, washdown residue, and abrasion where parts slide across the glass. Its signature is streaking aligned with the direction of travel and growth that tracks parts processed. It is the harder face, because nothing in its environment is gentle.
The camera-side face collects what settles: fibres from packaging and textiles, fine dust — and dust clings, because glass in a working cell carries static charge that holds particles against gravity and vibration. Its signature is slow, even speckling that keeps growing with the conveyor stopped.
No lighting choice hides contamination that sits in the path. In transmitted light it silhouettes dark against a bright field; in dark-field it scatters and glows. Changing the lighting geometry alters how a speck looks, never whether it is there, which is why every fix below is physical.
Worked example: what one 50 µm fibre costs on a 0.5 mm part
Run the numbers before choosing hardware, because they decide how clean the imaging face must be.
Inputs:
- Part: 0.5 mm across — the case in front of you.
- Field of view: 1 mm, chosen as roughly twice the part width to tolerate presentation jitter.
- Camera: 2448 x 2048 pixels, a common 5 MP sensor — an example camera; any model substitutes in the same formulas.
- Contaminant: one 50 µm fibre, the size class that settles from packaging and textiles.
- Rule of thumb: a feature needs about 3 px across to be measured reliably.
Here s is pixel scale, N the pixels across the sensor, d the speck diameter, and C the Weber contrast of the speck against its background.
The arithmetic:
- Pixel scale: s = 1 mm / 2448 px = 0.4085 µm/px ≈ 0.41 µm/px. The 0.5 mm part spans 0.5 mm / 0.4085 µm/px ≈ 1224 px.
- Fibre coverage: 50 µm / 0.4085 µm/px ≈ 122 px across, an area of π/4 × 122² ≈ 11,800 px. The part image holds 1224² ≈ 1.5 million px, so one fibre hides about 0.8% of the part and about 12,000 false-defect pixels.
- Defect threshold: 3 px × 0.41 µm/px ≈ 1.2 µm. Anything larger than about 1 µm can present as a measurable defect.
- When does a fibre stop mattering? It falls under 3 px only when s exceeds 50 µm / 3 ≈ 17 µm/px — a field wider than 2448 × 17 µm ≈ 41 mm on this camera. Even at a 20 mm field, s ≈ 8.2 µm/px and the fibre is still a 6 px blob.
- Contrast: in transmitted light the fibre blocks essentially all illumination, so C ≈ (0 - I_bg) / I_bg ≈ -1 — maximum contrast. Software cannot delete it without deleting every real dark feature of the same size.
Decision: at any pixel scale below about 17 µm/px — that is, every serious defect inspection through glass — contamination is a defect source by construction, so the imaging face must be held near part-clean. Purge air alone cannot promise that against fibres: pair it with ionization on the camera side, and put a renewable surface (advancing film, wiper, wash) or a geometry change on the workpiece side. If your smallest true defect is 25 µm or larger, coarsen to s ≈ 8 µm/px — a 20 mm field on this camera — and the cleanliness target relaxes by a factor of twenty; the physical countermeasure stays.
To run the sizing the other way, from smallest defect to required pixels, use the camera resolution calculator:
Camera-side face: purge air, ionization and a renewable surface
The camera side is the forgiving face: the dirt is dry, loose and reachable. Build three layers, cheapest first.
Air purge. Feed clean, dry, oil-free air across the window as a wide, low-velocity sheet. A laminar-style sheet keeps transmission up and lifts dust away without stirring the cell; a narrow jet does the opposite, blasting contamination onto neighbouring surfaces. Oil or moisture in the supply is worse than dust because it paints a film on the glass, so filter and dry the line at the point of use.
Ionization. Static charge holds fibres on glass against gravity and against the purge. An ionizer bar covering the window neutralizes the surface charge, and the purge sheet then carries the freed dust off. Fit the two together: an ionizer without airflow only redistributes dust.
Renewable surface. Two options. A motor-indexed roll of transparent film across the window presents clean material on demand; index it between exposures, because film moving during an exposure smears the image, and tension it flat, because wrinkles shadow the field. Or fit a sacrificial screw-in window at the lens — the lens accessories category carries the adapters and filters for the stack — so the grime lands on a part that swaps at the bench in minutes. The optical side effects are worth reading first: Protective filter window for a vision lens: what it changes. Choosing that glass, clear or IR-cut, is its own decision; IR cut-off filter glass selection for CMOS machine vision walks through it.
Dust that gets past everything lands on the sensor side and needs a different technique: How to clean a machine-vision camera sensor without adding dust. For the window glass itself, use the wet method in How to clean a machine vision camera window safely.
Workpiece-side face: film, wiper-washer, ultrasonic wash or rotating glass
Nothing on this face is gentle, so match the hardware to the fouling.
Advancing film flush with the surface. Where parts slide across the glass, a film carriage recessed flush with the conveyor surface lets you index a fresh area every few cycles. Wear is fast at this position, so treat film as a consumable and set the index interval from a trial: advance after N parts, with N read off when blotches return.
Wiper-washer. The automotive arrangement — a wiper blade plus washer jet over the glass — is a commodity with decades of field service behind it. Wipe between cycles or on a parts counter, and collect the fluid so it never reaches the product area; in food and electronics cells, clear the fluid type against the product first.
Ultrasonic wash and hot-air dry. For oil films a blade smears rather than lifts, schedule an off-cycle ultrasonic shower followed by hot-air drying. It is the most thorough option and the most invasive: the cell needs drainage, sealing around the glass and drying time before imaging restarts.
Rotating window. A spinning flat disc — standard practice on ships and machine tools — slings droplets and spatter off continuously and cleans between frames without stopping the line. It suits oil-mist and spatter cells and costs a motor, a seal and optically flat glass.
Decision: dry dust responds to purge and ionization even here, where the airflow can sweep the face; sticky oil needs film, wash or a blade, because a dry blade alone smears; droplets and spatter call for rotating glass or the wiper. On a conveyor underside with chips and coolant in play, expect to combine — a renewable surface on this face, purge and ionizer on the camera face.
Redesign the geometry so the window leaves the image path
The only countermeasure with no consumables is to stop imaging through the dirty face. Three routes, in rising order of change.
Inspect off the conveyor. Present the part in a clean station above or beside the line — on a glass tray or in free air — and image there. The under-conveyor window drops out of the optical path altogether.
View a side face. If the features live on the part's flank, image horizontally as the part passes. On a telecentric rig that has to fold, the LS-LXR-0144 double-fold prism turns the output 90° through a 30 mm optical path, so the camera sits alongside the conveyor and the bottom glass carries no image at all.
- Type
- Prisms
Trial before you cut the cell. Mock up the new arrangement off-line on a stand from the camera stands range: the LS-MNT-0040 slide-table stand gives 700 mm of height over a 400 x 450 mm base, room enough for camera, light and part presentation plus the part-out and refocus tests from the bench.
- Type
- Camera stands
The cost is presentation and cycle time — the part may need presenting twice or the line re-routing. Against that stands a fix with no consumables that removes the contamination source permanently, and for sub-millimetre parts that trade usually lands on the side of moving the camera. A new geometry also resets the lighting, so re-derive the illumination from the part rather than reusing the old heads; Machine vision light geometry selection by surface and feature is the starting method.
Monitor the drift, not the calendar
Cleaning on a fixed schedule wastes either consumables or image quality. The drift rate sets the interval, and measuring it costs one frame per shift.
After every clean, capture the part-out frame and count dark pixels against the baseline recorded on the freshly cleaned window. Trend it once per shift and clean at about three times baseline — a starting policy you tighten from the first weeks of data. Log every clean with before and after counts: the slope between cleans is the true interval, and a sudden slope change announces a failed seal or a blocked purge line before image rejects do.
Split window fouling from light aging on the same cadence. A machine vision reference target imaged per shift shows fouling as new blotches and lamp aging as a uniform histogram shift; Machine vision lighting stability: test before deployment covers setting that baseline. Keep the software honest as well: no threshold widens to tolerate dirt, because the tolerance consumes real defects too — the ordering in Stable 2D vision inspection systems: lighting, lens, exposure first is what holds that line.
The decision, per face
- Camera-side face: purge sheet plus ionizer, sacrificial window at the lens, advancing film if fibres persist.
- Workpiece-side face, dry dust: purge sweep across the face where airflow reaches it, advancing film where parts slide.
- Workpiece-side face, oil film: ultrasonic wash on a scheduled cycle or a wiper-washer between cycles; a dry blade only smears.
- Workpiece-side face, droplets and spatter: rotating window or wiper-washer.
- Smallest defect 25 µm or larger: coarsen the pixel scale to about 8 µm/px — a 20 mm field on a 2448-px camera — and buy twenty times the cleanliness margin.
- Sub-millimetre parts in heavy fouling: move the imaging off the conveyor; the folded-prism route keeps the footprint small.
Window cleanliness checklist
Print this into the cell file.
Specify
- Provision a purge port, an ionizer position and a film or wiper envelope in the drawing, even if you commission none of them — retrofit costs downtime.
- Fit a sacrificial window at the lens and put a spare on the shelf.
- Seal the window edge so fluid cannot wick behind the glass.
Install
- Aim the purge as a sheet across the glass, never into the machine.
- Interlock the film or wiper so it cannot move during exposure.
- Bond or ionize the window surroundings so charge cannot accumulate.
Commission
- Record the clean-baseline part-out frame and its dark-pixel count.
- Capture the refocus pair — window plane, part plane — so future staff rerun the diagnosis in minutes.
- Note the purge filtration and supply fitted at the cell.
Run
- Trend the dark-pixel count per shift and clean at about three times baseline.
- Log every clean with before and after counts and re-derive the interval from the slope.
- Stock film rolls, wiper blades and a spare window as consumables, reordered on use rather than on failure.
When the camera, lens, window and stand parts of the stack need sizing, the accessories finder filters them in one place, and the systems guides cover the surrounding discipline; for help matching hardware to your cell, use the contact page.
Questions
How often should the viewing glass be cleaned?
Set the interval from the trend, not the calendar: a part-out frame each shift, dark-pixel count against a clean baseline, clean at about three times baseline. Wipers and advancing film stretch the interval but do not remove the monitoring — a loaded wiper blade or an exhausted film roll smears instead of cleans, and the count catches that within a shift. On sliding-part cells, expect film to be the dominant consumable.
Can image filtering remove window dirt instead of cleaning?
Only when the pixel scale is coarse. A median or morphological filter deletes isolated specks, but it deletes real defects of the same size and shape with them. At 0.41 µm per pixel, a single 50 µm fibre covers about 12,000 pixels, and no filter can tell it from a genuine 50 µm defect without abandoning that defect class. Clean the glass; keep filtering as a last-mile cleanup at low magnification.
What kind of air supply does a window purge need?
Clean, dry, oil-free air. Oil or moisture in the supply deposits a film on the glass that is harder to remove than dust, so fit a coalescing filter and a dryer at the point of use. Direct the air as a wide, low-velocity sheet across the window rather than a jet into the machine, which stirs contamination onto other surfaces. Never aim compressed air at a person.
Why does window contamination look exactly like a part defect?
Because it sits in the optical path and interacts with the light the same way a surface feature does. In transmitted light a fibre blocks illumination and silhouettes near-black on a bright field — Weber contrast close to -1, the strongest contrast there is. In dark-field the same fibre scatters light and shows bright. No lighting angle makes it disappear; it only changes dark versus bright.
What is an advancing protective film window and where is it used?
A motor-indexed roll of transparent film held across the window, so the camera always shoots through clean material: when the exposed area pollutes, the motor feeds a fresh section. The scheme runs on cameras in racing and other harsh mobile service. Index it only between exposures, tension it flat so wrinkles do not shadow the field, keep it flush where parts slide past, and stock rolls as a consumable.


