A fill level that looks obvious to the eye often refuses to segment: under a front light the meniscus sits at nearly the same gray value as the walls, the label and the shadows around it, so no threshold returns one complete liquid region. This guide fixes the problem at the light rather than in the software. You will size the backlight, choose its colour, set exposure and threshold from worked numbers, and handle line speed, capillary climb and foam.
Why does the liquid level vanish into its surroundings under front light?
Under front lighting the level line competes with wall reflections, printed marks and shadows at almost the same gray values, so the step between the level and its neighbours often stays below 20 of 255 levels and no threshold closes one clean region.
The level is a thin, transparent feature. The camera receives transmitted, reflected and refracted light mixed together, and the meniscus adds only a faint brightness change on top of the wall's own texture. Segmentation cannot invent contrast the lighting never created: a lower threshold trades one broken region for a field of noise regions. The durable fix is silhouette imaging, one of the standard backlighting techniques. The wider lighting choice for transparent containers — including the cases that genuinely need front light — is walked through in liquid level inspection lighting for transparent containers; this guide puts numbers on the backlight case.
How does a backlight turn the meniscus into a one-threshold edge?
A backlight behind the container makes the empty headspace transmit most of the light while the liquid body below absorbs and refracts it, so the surface shows up as a dark-to-bright step of roughly 100-150 gray levels that a single fixed threshold splits.
The meniscus is a small curved lens. It bends the panel's rays away from the camera, which prints a dark line exactly where the liquid ends. On a diffuse panel the step is a clean ramp 3-6 px wide; on a collimated panel the bent rays leave the lens acceptance cone entirely, so the line goes nearly black — the sharper tool for thick or curved walls. Shoot one histogram, confirm the step clears your noise floor, and lock the threshold. The backlights category sorts panels by size, colour and type, and the collimated-versus-diffuse trade-off is worked through in collimated backlight or diffuse backlight for edge gauging.
How large should the backlight be, and how close?
Size the lit area at least 10 mm larger than the container silhouette on every side — an 80 x 60 mm field of view needs a 100 x 80 mm panel or larger — and keep the bottle-to-panel gap between 10 and 30 mm.
The margin absorbs bottle sway and keeps the panel edge from vignetting into the silhouette. The gap matters in both directions: too far and the wall refracts bright field back into the silhouette, softening the meniscus step; touching the diffuser prints every scratch and dust speck through as false edges. A diffuse flat panel is the simplest build for a straight wall. When the wall curves or bulges near the level, order collimated instead:
- Size
- 100-200 mm
- Type
- Collimated
- Voltage
- 24 V
The 120 x 120 mm lit area covers the example field with margin on every side.
Which backlight colour gives the deepest meniscus step?
Start with red on a monochrome camera for clear liquids in clear containers, move to 850 nm infrared when tinted plastic or a printed sleeve covers the level, keep white for colour cameras and reserve UV for fluorescing level markers.
Meniscus contrast comes from refraction and absorption rather than colour itself, but the panel still has to push light through the wall and the liquid. Most dyed PET that looks opaque to the eye still passes 850 nm, which is why infrared rescues shrink-sleeved bottles. Which LED colour gives the best contrast in machine vision extends the same logic to other surfaces.
| Situation | Panel colour | Why it wins |
|---|---|---|
| Clear liquid, clear PET or glass, mono camera | Red | High output on mono sensors, blind to ambient colour shifts |
| Tinted container or shrink sleeve over the level | Infrared, 850 nm or 940 nm | Passes dyes and inks that absorb visible light |
| Colour camera shares the station | White | Keeps the colour balance of the shared images meaningful |
| Fluorescing fill-level marker in the liquid | UV | Only the marker glows, so the level draws itself |
Two panels cover most of these cases:
- Size
- 100-200 mm
- Type
- Standard
- Size
- 100-200 mm
- Type
- Standard
How do you set exposure, pixel scale and the threshold itself?
Set exposure until the headspace plateau reads 180-220 of 255 while the liquid plateau stays under 80, then place the threshold halfway between the two; at plateaus of 220 and 70 that threshold is 145, leaving about 75 levels of margin on each side.
Those plateaus are the contract with your threshold: hold them steady and the edge stays put. Auto exposure and auto gain rescale the image every frame and quietly walk the threshold off its midpoint, so switch every automatic mode off and drive the panel from a fixed setting. Check the geometry against the tolerance before you order the camera:
A tighter tolerance scales the requirement directly: ±0.5 mm needs 0.05 mm steps, so a smaller field of view or a sensor with more rows. The same arithmetic drives camera resolution for dimensional inspection.
How accurate is the reading, and what does the meniscus itself cost you?
Plan for ±1 px of edge noise, about ±0.06 mm at the scale above, then correct two larger effects: roughly 1.0 mm of capillary climb in a 30 mm wetting glass bore, and 1.05 mm of apparent shift if that same bore tilts 2 degrees.
The liquid climbs the wall, so the silhouette edge at the wall sits high by h while the surface across the bore centre stays flat. Read the level from the transmission step at the centre, or subtract h. The wetting angle shrinks the correction: at θ = 60°, typical of water on PET, cos 60° = 0.5 and the climb halves to about 0.5 mm. Tilt moves the whole reading more than noise does: a 30 mm bore leaning 2° shifts the apparent level by 30 mm × sin 2° = 1.05 mm, so fixture the bottle upright to ±0.5° and the shift falls to 0.26 mm.
What changes when the filler line moves the bottles?
Motion turns exposure into blur — speed times exposure time — so at 100 mm/s a 2 ms exposure smears the edge by 0.2 mm, which is 3.6 px at the scale above, while a 0.5 ms strobe pulse holds blur to 0.05 mm, under one pixel.
The strobe brings a second win: a short pulse freezes mains flicker and ambient light along with the motion, which is why strobed lines tolerate factory lighting that ruins constant-on stations. Drive the pulse from a controller with a strobe feature:
- Output
- Constant voltage 24 V
- Channels
- 4 channels
- Control
- Digital
- Feature
- Strobe
The LS-CTL-0070 provides four strobe channels with 200 W of output over RS232. Wire the trigger so the pulse lands entirely inside the exposure window; camera strobe output timing: exposure pulse and image timestamp shows how pulse, exposure and timestamp relate. Slower lines relax the numbers: at 50 mm/s the same 2 ms exposure blurs 0.1 mm, about 1.8 px, so constant-on stays legitimate with a fixed exposure. The light controllers category filters by channels, strobe and output type.
When does the backlight silhouette fail?
Opaque containers end the discussion outright, foam spreads the step over 10-20 px with no single edge to fit, and condensation above the fill scatters panel light into the headspace and drags the bright plateau toward the threshold.
Each failure has a check and a fix. An opaque container defeats every wavelength: gauge by weight or a dedicated level sensor instead. Foam gives a gradual ramp, so either write top-of-foam into the specification or inspect after the foam settles. Condensation responds to a short burst of warm air over the containers or drier air in the filler room; a fresh container should return the bright plateau to its 180-220 target. A liquid dark enough to swallow both visible light and 940 nm is the genuine dead end — backlighting is the wrong tool there, and the honest alternatives sit outside optics. Bulging walls near the level are not a failure case; they are the collimated-panel case from the sizing section.
What should you check before ordering the light and controller?
Order against four numbers: a lit area at least 10 mm larger than the silhouette on every side, a colour that passes the container wall, a pixel scale at least ten times finer than the level tolerance, and a strobe channel whenever line speed times exposure exceeds one pixel.
- Silhouette plus margin. Measure the tallest and widest fill format, add 10 mm per side, and order that lit area; a panel that barely fits vignettes the first time a bottle sways.
- Two plateaus on one histogram. Image a filled and an empty container at the working exposure; the plateaus need at least 50 levels of separation before any threshold is worth writing.
- Pixel scale against tolerance. Divide field of view by sensor rows and keep the result at or under one tenth of the tolerance — 0.2 mm for a ±2.0 mm tolerance.
- Motion budget. Multiply line speed by exposure time and keep the product under one pixel; otherwise add the strobe channel.
- Fixture and gap. Hold tilt within ±0.5° and the gap between 10 and 30 mm, because both move the reading more than pixel noise does.
- Controller headroom. Count channels for the backlight plus any front light on the same station, and confirm the strobe feature before line speed demands it.
The lights finder filters panels by size, colour and type, the configurator picks up at light selection or controller selection, and the lighting topic page collects the companion guides. Send the container silhouette, format list and line speed through the contact page and we will return a panel size, colour and channel plan with the arithmetic shown.
Questions
Can one backlight handle both glass and PET formats on the same line?
Yes, if both are transparent and the silhouette heights are close. Keep the field of view on the straight bore for both formats, re-shoot the two plateaus at each change and adjust exposure rather than threshold logic, and expect the capillary correction to differ — about 1.0 mm in a wetting 30 mm glass bore against roughly half that on non-wetting PET. A red panel serves both formats.
Should the camera be monochrome or colour for level detection?
Monochrome. The meniscus is a brightness step, and a monochrome sensor keeps that edge at full resolution with no Bayer interpolation smoothing it, plus sensitivity into the red and infrared bands where tinted containers transmit. Choose colour only when the same camera must also read fill-line printing or cap colour on the station.
Why does my level edge wander frame to frame even with the backlight on?
Almost always an automatic mode. Auto exposure or auto gain rescales the two plateaus every frame, so a fixed threshold lands off the midpoint and the fitted row drifts. Turn automatic exposure, gain and white balance off, fix the panel drive, then re-shoot the plateaus — they should repeat within a few gray levels before you trust any threshold.
What threshold works when a label shows through the headspace?
Place it between the liquid plateau and the darkest part of the headspace that still belongs to the silhouette, not between liquid and label ink. If label ink dips below the threshold, mask those rows out of the region of interest or shrink the panel's bright zone so the level area stays clean and the label never enters the histogram.
Does the container need to sit against the backlight panel?
No, and contact is worse. A 10-30 mm gap keeps diffuser scratches and dust from printing through as false edges, and it leaves room for the locating fixture. That fixture matters: tilt moves the apparent level more than pixel noise does, so the gap is where the accuracy is protected, not lost.



