LightingGuide

Liquid level inspection lighting for transparent containers

Choose liquid level inspection lighting for clear containers, compare backlight and front light, and verify meniscus tracking and measurement stability.

LumaSpec Vision11 min read Share on LinkedIn

On this page 11 sections
  1. 01Define the liquid boundary before choosing the light
  2. 02Compare backlighting with front illumination
  3. 03Run a controlled lighting trial
  4. 04Size the emitting area and shortlist trial parts
  5. 05Work out sampling and motion limits
  6. 06Extract the boundary without following glare
  7. 07Account for meniscus, foam and container variation
  8. 08Treat height and volume as different measurements
  9. 09Validate repeatability before setting acceptance thresholds
  10. 10Choose the geometry that survives variation
  11. 11Questions

A clear container can show a convincing liquid boundary in one image and lose it after a small rotation. Reflections, curved walls and bubbles can all produce stronger edges than the surface you want to measure. For engineers selecting a fill-level inspection setup, the first task is therefore optical: make a defined boundary repeatable before choosing a threshold. Start by comparing diffuse backlighting with front illumination, then test the selected geometry across container variation, fill conditions and production motion.

Define the liquid boundary before choosing the light

Specify what the measurement means. The top of the foam, the central liquid surface and the meniscus beside the wall are different features. An algorithm can track any of them consistently while reporting the wrong process variable.

For a clear, settled liquid, a useful starting definition is the central liquid boundary, measured away from the curved sidewalls. For a foaming product, decide whether you need the liquid beneath the foam or the overall occupied height. If the required interface is hidden, a stronger light may not recover it.

Write down three acceptance requirements before testing:

  • The lowest and highest acceptable boundary positions, relative to a repeatable datum.
  • The maximum measurement variation allowed for an unchanged sample.
  • The required response when the boundary is obscured or ambiguous.

Keep surface-defect inspection separate from this measurement. The discussion of lighting for glass-container defects addresses a different task: revealing imperfections rather than locating a liquid interface.

Compare backlighting with front illumination

Place a broad backlight behind the container, facing the camera. The camera then observes transmitted and refracted light rather than relying mainly on reflections from the front wall. Differences between the filled and unfilled regions may create a usable boundary, even when the liquid looks nearly transparent.

A diffuse emitting surface is a sensible first trial because it supplies light over a range of directions. It does not eliminate wall reflections, refraction or internal ghost images. Confirm the actual angular distribution of the candidate light rather than assuming every flat backlight is equally diffuse.

Front illumination remains worth testing. A liquid that absorbs or scatters light may produce a stronger interface from the camera side. However, a ring-shaped reflection on a curved wall can overlap the measurement region and move when the container rotates.

Geometry What to test for Main limitation Choose it when
Diffuse backlight A continuous boundary across the central region Wall refraction and overlapping internal edges Transmission produces the most repeatable interface
More directional backlight A sharper, stable transition Strong sensitivity to alignment or container geometry Directionality improves repeatability on actual samples
Diffused front ring light Separation between liquid, headspace and wall Glare can cross the measurement region Front illumination reveals a boundary that transmission loses
Separate backlit and front-lit exposures Complementary boundary evidence More acquisition and synchronization work Neither geometry alone covers the permitted variation

Sharpness alone is not the decision criterion. The comparison of diffuse and collimated backlighting explains the angular trade-off, but a transparent-container interface still needs its own trials.

Run a controlled lighting trial

Use the same camera position, lens setting and container support for both geometries. Otherwise, an apparent lighting improvement may actually come from a changed viewing angle.

  1. Gather representative samples. Include empty containers, acceptable fills, low fills, high fills and deliberately difficult examples. Include permitted wall shapes, seams, printing and liquid appearances.
  2. Establish the side view. Start with the camera looking approximately horizontally through the intended measurement height. Check whether the front and rear portions of the interface form separate visible bands.
  3. Test the backlight. Move it behind the container and vary its distance while keeping the camera fixed. Observe whether the boundary changes shape or disappears near the walls.
  4. Test front illumination separately. Switch off the backlight, position the ring light, and vary its distance. Record where reflections cross the boundary.
  5. Lock exposure controls. Disable automatic exposure and gain during comparison. Use a fixed setting for each candidate configuration, then evaluate the full sample set without retuning individual samples.
  6. Repeat with motion. Run the same samples through the expected position range and acquisition timing. Include rotation where it can occur in production.

Save original grayscale images, not just thresholded previews. A binary image can hide clipping, weak transitions and competing edges that explain later failures.

Compare wavelength only after establishing a useful geometry. The guide to selecting illumination colour for contrast provides the broader selection framework. Neither visible nor infrared illumination is universally better for clear liquids; transmission depends on the liquid, container and wavelength together.

Size the emitting area and shortlist trial parts

Browse backlights for transmission trials and ring lights for the front-lit comparison. The lighting finder helps narrow the physical formats, but size and light type do not establish measurement performance.

The emitting area must cover the measurement region through the container over its full permitted position range. Also check empty containers: the bright background should remain usable around the region where the boundary will be searched.

As an initial sizing exercise, suppose the visible region is 60 mm wide and the container can move 5 mm sideways in either direction. Adding a trial margin of 10 mm on each side gives:

Initial emitting-width target = visible width + position range + margins Initial emitting-width target = 60 mm + 2 × 5 mm + 2 × 10 mm Initial emitting-width target = 90 mm

This is a starting estimate, not a guarantee. Refraction, source distance and viewing geometry can require a larger emitting area. Check the mechanical outline separately from the emitting dimensions.

The LS-BKL-1468 is listed as a red, 150 x 150 mm flat backlight. It is a candidate format for a transmission trial, not a confirmed solution for a particular liquid.

BacklightsFlat Backlight, 150 x 150 mm, Red (LS-BKL-1468)LS-BKL-1468
Size
100-200 mm
Type
Standard
Voltage
24 V
$389.00View partBuild a system with it

The LS-BKL-0750 is listed as a 180 x 100 mm high-luminance backlight. Confirm its emitting geometry, diffusion and output against the proposed inspection arrangement.

Backlights180 x 100 mm High luminance back light (LS-BKL-0750)LS-BKL-0750
Size
100-200 mm
Type
Standard
Voltage
24 V
$369.00View partBuild a system with it

For the front-lit comparison, the LS-RNG-0143 is a ring light with diffuser, listed with a 100 mm diameter and 30° angle. Check the available lens clearance and the reflection pattern on representative containers.

Ring lights100 mm dia. ring light with diffuser, 30° (LS-RNG-0143)LS-RNG-0143
Size
100-200 mm
Type
Diffused
Angle
30°
Voltage
24 V
$169.00View partBuild a system with it

For every candidate, confirm control mode, wiring, connector, mounting and continuous or triggered operation before ordering. Do not infer those details from the product shape.

Work out sampling and motion limits

Image sampling sets the scale of the problem, but it does not establish measurement accuracy. For an approximately uniform vertical scale, divide the vertical field of view by the active image height.

Vertical sampling = vertical field of view / vertical pixel count Height difference = boundary displacement in pixels × vertical sampling

For an 80 mm vertical field imaged across 1600 pixels:

Vertical sampling = 80 mm / 1600 pixels = 0.05 mm/pixel A 0.5 mm height difference spans 0.5 / 0.05 = 10 pixels A 2-pixel boundary displacement corresponds to 2 × 0.05 = 0.10 mm

These numbers describe sampling. Refraction, calibration error, tilt and an inconsistent boundary definition can create larger errors. Subpixel fitting cannot correct an edge that changes its physical meaning between samples.

The camera-resolution guide for dimensional inspection explains the distinction between pixel count and measurement capability. Use the resolution calculator to check candidate sampling requirements.

Camera resolution for the smallest feature
Units
Pixels needed
–
Sensor size
– MP
Smallest sensor that fits
–
Pixel on the part
– mm
Pixels across the feature, that sensor
–

Pixels needed = field / feature × pixels per feature on each axis (field incl. margin). The lens must resolve the pixels too: Nyquist = 1000 / (2 × pixel µm) lp/mm.

Find cameras with enough pixels Open the full calculator

Motion also matters. Suppose container motion across the image corresponds to 150 mm/s in object space. Limiting displacement during exposure to 0.05 mm gives:

Maximum exposure estimate = allowed displacement / image-plane motion speed Maximum exposure estimate = 0.05 mm / 150 mm/s Maximum exposure estimate ≈ 0.00033 s = 0.33 ms

This estimates translational blur only. Sloshing can move the interface independently of the container, so a short exposure may freeze a tilted or rippled surface rather than reveal the settled level.

Extract the boundary without following glare

Locate the container or a fixture reference first. Move the measurement region with that reference instead of searching a fixed image row range when the container position can vary.

For an initial trial, restrict the search to the central portion of the container. A central 60% region is a reasonable experimental starting point, not a universal setting. Excluding the sidewalls often avoids the most strongly curved meniscus and wall features, but it may discard the only visible interface in some containers.

Build vertical intensity profiles from several narrow column groups. Search for candidate transitions within the permitted height range, then compare their positions, strength and consistency across the image. Allow the expected transition polarity to come from the trial images: the liquid region is not always darker than the headspace.

A median of valid boundary positions can reduce the influence of isolated bubbles or glare. First reject invalid candidates, however; a median of several incorrect edges is still incorrect.

Record more than a height value. Useful quality indicators include:

  • The fraction of column groups supporting the selected boundary.
  • The spread of their detected positions.
  • The strength of the selected transition relative to competing transitions.
  • Clipping or glare inside the search region.

Account for meniscus, foam and container variation

A curved meniscus can appear as a band rather than a single line. Decide whether the reported boundary follows its upper edge, lower edge or a calibrated central feature. Keep that definition unchanged through development and acceptance testing.

Container tilt creates another ambiguity. A level that slopes across the image may indicate a tilted container, a moving liquid surface or an optical effect. Measure slope as a separate quality indicator rather than silently averaging every slanted boundary.

Foam can generate several horizontal transitions. If the intended liquid interface remains visible, use its expected location and continuity to distinguish it from the foam top. If it is hidden, consider a later acquisition position, a documented settling interval or a different sensing method. Do not assume image processing can recover information absent from the image.

Container variation deserves its own trials. Rotate molded plastic containers through seam positions and compare glass containers from different production lots. Wall thickness, curvature, embossing and tint can change the apparent boundary without any change in fill.

A change in wavelength may improve contrast, but it can also change which interface dominates. The guide to sequencing illumination wavelengths is useful when separate exposures provide genuinely different information. Confirm acquisition timing and motion effects before combining those measurements.

Treat height and volume as different measurements

Visible fill height is not automatically liquid volume. For a container with constant internal cross-sectional area, a small height change has a simple geometric relationship to volume:

Volume change = internal cross-sectional area × height change

For an internal area of 500 mm² and a height change of 1 mm:

Volume change = 500 mm² × 1 mm = 500 mm³ = 0.5 mL

That calculation assumes the area is known and constant over the interval. Shoulders, taper, internal bottom shape and container tolerances invalidate a single constant-area conversion across the whole container.

If volume is the acceptance variable, establish a reference relationship using independently verified fills and representative containers. Optical calibration of an external target alone does not characterize the apparent liquid interface through curved walls.

The discussion of volume estimates from silhouettes explains related geometric limits. A repeatable external outline does not establish internal capacity or delivered liquid quantity.

Validate repeatability before setting acceptance thresholds

Separate acquisition repeatability from container-to-container variation. First capture an unchanged, settled sample repeatedly without moving it. Then remove and replace it, rotate it, and finally run it through the production acquisition sequence.

As an exploratory study, take 30 containers from each of 3 lots, giving 90 distinct containers. Include the expected fill range and difficult optical conditions. This is a development sample plan, not a universal qualification requirement.

Compare measurements with references and retain the signed error. A small spread with a consistent offset indicates a different problem from a large spread around the reference. Report invalid measurements as well as accepted measurements; excluding difficult images can make performance appear better than it is.

Before ordering or releasing the setup, check:

  • Boundary definition: the selected edge represents the intended liquid interface, not foam or a reflection.
  • Coverage: every permitted container position retains usable illumination and a visible datum.
  • Sampling: the tolerance spans enough pixels for the demonstrated edge stability.
  • Exposure: neither saturation nor motion blur dominates the measurement region.
  • Variation: seams, tint, rotation, bubbles and fill extremes have been exercised.
  • Calibration: the height mapping is checked against independent references through the actual optical arrangement.
  • Decision logic: ambiguous images and measurements near acceptance limits have a defined disposition.

Recheck the setup after changes to container geometry, liquid formulation, acquisition timing or illumination settings. A previously acceptable image-processing threshold is not evidence that the new conditions remain equivalent.

Choose the geometry that survives variation

Select the setup with the most stable boundary definition across the sample set, not the cleanest single image. Diffuse backlighting is a strong starting trial, but front illumination, separate exposures or another sensing method may be the better answer when transmission cannot reveal the required interface.

Use the light configurator to develop the shortlisted arrangement. For a review of the geometry, exposure target and sample conditions, send representative images and measurement requirements through application support.

Questions

What lighting should you try first for transparent-container fill inspection?

A diffuse backlight is a useful first trial because it lets the camera observe transmitted and refracted light instead of mainly front-wall reflections. It is not automatically the final choice. Compare it with front illumination using the actual liquid, container variations and production acquisition timing.

Can a ring light work for liquid-level inspection?

Yes, when front illumination produces a stable distinction between the liquid and headspace. The limitation is reflection from the curved container wall, which can move into the measurement region as the container rotates. A diffuser may help, but the complete arrangement still needs sample testing.

How should foam affect the inspection strategy?

The strongest visible edge may belong to foam, a bubble layer or a wall reflection rather than the liquid surface. Define which interface matters and verify that it remains visible. When foam hides that interface, consider different acquisition timing or another measurement method instead of forcing an optical height.

How many pixels are needed for a reliable level measurement?

No single pixel count guarantees accuracy. Start with the field of view and required height discrimination, then allocate enough pixels to evaluate the boundary reliably. Demonstrated performance also depends on refraction, calibration, motion, container positioning and whether the same physical interface is detected in every image.

Can measured fill height be converted directly into volume?

Only after establishing a suitable relationship between the observed boundary and internal liquid volume. Tapered walls, shoulders, bottom geometry and capacity variation can break a simple conversion. If volume controls acceptance, compare the optical measurement against independently verified quantities across representative containers and the required fill range.