A brightness check that passes on the bench and fails in production is almost never a threshold problem. It is a measurement-scale problem. If you judge a backlit button, a lamp or a light guide from raw 0-255 pixel values, the limits you set today move with exposure time, gain, drive current and LED temperature. This guide sets the measurement up so the numbers hold: every automatic setting off, a reference target in every frame, means over large regions of interest instead of single points, and pass limits written from measured repeatability. A worked example takes one backlit faceplate station from raw counts to signed-off limits.
Why raw 0-255 values will not hold as pass limits
A gray count is not a property of the part. It is the product of the light reaching the sensor, the exposure time, the gain, the aperture and the sensor's response. Double the exposure from 2 ms to 4 ms and every count doubles until pixels clip at 255. A limit such as 'button mean 180 or more' written in one session therefore encodes that day's camera settings, that day's lamp temperature and that day's nesting, and it quietly stops matching reality when any of them moves.
The drift sources, in the order they usually bite: auto exposure or auto gain rescaling every image behind your back; a lamp driven by constant voltage instead of constant current, so output follows supply and temperature; a lamp still warming up, because LED output falls a few percent as the junction heats; mains ripple beating against the exposure time, the camera flicker under artificial lighting mechanism; and nest shift changing the geometry. Each one moves raw counts by percent-level amounts, the same order as the tolerance you are trying to guard.
The way out is structural, not a better threshold: fix everything that scales the image, then judge every feature by its ratio to a reference region in the same frame. Ratios survive exposure edits, gain edits and lamp warm-up; raw counts survive nothing. Watch clipping while you do it: with 8-bit counts, hold the brightest ROI mean at or below about 200 of 255, so a 15% brightness excursion still lands on the linear part of the response (200 x 1.15 = 230, below 255). A count is not a lux either; the pixel values to lux article covers what physical units would take.
What you need
Six things, none exotic.
- A mono area scan camera with manual exposure and gain. The part sits still, so a rolling shutter is fine. Mono keeps the luminance measure free of color-filter interpolation.
- A lens at a fixed, recorded f-number with focus locked. An auto-iris lens changes the scale behind your back.
- A light controller driving lamps at constant current, not constant voltage.
- A reference target: a matte white ceramic or PTFE patch when your light illuminates the part; a small reference lamp at fixed current when the part emits its own light. The reference target for comparing illumination article compares the options.
- A dark enclosure with a matte black interior, so ambient cannot add a floor that changes between day and night shifts.
- A fixture that nests the part identically every cycle. Nesting scatter is the largest error source in the worked example below.
- A log line per verdict: exposure, gain, drive current, raw means, dark value and ratios. When a number moves months later, the log tells you which scale moved with it.
Two cameras that fit a station like this: pick USB3 for a bench build, GigE for a longer cable run.
- Sensor format
- 1"
- Lens mount
- C-mount
- Sensor format
- 1/1.7"
- Lens mount
- C-mount
Whatever lights or reference lamps the station runs, put them on a regulated drive. The LS-CTL-0180 provides 4 channels of constant current at 120 W, which covers a reference lamp plus a station light with room to spare.
- Output
- Constant current
- Channels
- 4 channels
- Control
- Digital
- Feature
- Constant current
Step 1: Lock every automatic setting
Every automatic mode is a scale change the camera makes without telling you. Turn them all off, and write down what replaced them.
- Exposure: manual, logged in microseconds. Auto exposure is the fastest way to lose a scale.
- Gain: manual and fixed.
- White balance and any contrast or scene modes: off.
- Aperture: fixed f-number, focus locked.
- Lamp drive: constant current. If you strobe, fix the pulse width, because delivered light is proportional to it: a 10% wider pulse is 10% more photons. The LED strobe optical rise time article shows how to measure what a pulse actually delivers.
- Warm-up: power lamp and camera for ten to fifteen minutes before judging, and log the reference ROI through warm-up once to learn your station's own settling time.
The camera brightness drifts over time article lists the auto modes to hunt down, and the camera exposure and gain units article explains what the logged values mean. If a lamp must be trimmed against aging rather than left fixed, do it in the drive, not the camera: a closed loop lighting controller holds measured brightness steady. On the PLC side the same job is usually a PID loop that scales a light's analog output.
Step 2: Put a reference target in every frame
Normalization needs a second region in the same frame that the ratio can divide by. Two setups cover nearly every brightness check.
- Your light illuminates the part, as in surface brightness, print reflectance or uniformity checks. Put a matte white patch in the same plane, lit by the same lamp. The patch sees the lamp's drift, so the ratio cancels lamp and camera drift together.
- The part emits its own light, as with backlit legends, indicator lamps and displays. A lit patch would only add a constant, so use a reference lamp at fixed current inside the field, or a matte patch placed to catch only spill from the part itself. The spill-lit patch tracks the part's total output and so cancels the part's own drive variation; its coupling is set by distance and angle, so calibrate it against master units rather than trusting it bare.
Placement checks:
- The reference is visible in every frame at a position fixed by mechanics, not software.
- Its ROI is at least 100 x 100 pixels, well inside the patch or lamp image.
- Its mean sits in the same middle gray band as the features, well below 255.
- For a spill-lit patch, the nest position is part of the calibration; treat any fixture change as a recalibration.
A station built this way also does incoming checks on backlights: drive a panel at fixed current, image it, and compare center-to-corner ratios with your master panel before the panel ever reaches a line. The LS-BKL-0750 is a 180 x 100 mm high-luminance backlight of exactly the kind this check qualifies.
- Size
- 100-200 mm
- Type
- Standard
- Voltage
- 24 V
Step 3: Average ROIs, not points
A single pixel carries the sensor's random noise alone, several gray levels at mid-scale on a typical 8-bit camera; temporal noise is characterized per EMVA 1288 if you want the sensor-level number. Averaging N pixels cuts the noise of the mean by the square root of N, which is why a large ROI beats any single-point intensity tool.
Build the ROIs once, from the master image. Threshold the buttons' bright regions, then keep each ROI a few pixels inside the edge, so blur and nest shift never pull background pixels into the mean. Fixed ROIs placed this way beat per-image segmentation in production, because segmentation brings its own frame-to-frame variability; switch to segmentation-derived ROIs only when nesting is loose enough that features genuinely move in the field.
Subtract a dark frame before dividing. Cap the lens or kill the lamps for one frame, and subtract that pedestal from every mean. A 16-level pedestal on a 180/150 pair biases the ratio from 1.20 to (180 - 16) / (150 - 16) = 164 / 134 = 1.22, about 2% of the reading, silently absorbed into every master you ever recorded.
Watch each ROI's standard deviation, not just its mean: a σ that climbs while the mean stands still means the ROI is sliding onto an edge or a mark. And never average pixels pinned at 255. Clipped pixels carry no brightness information and drag the mean down exactly when the part is brightest.
Step 4: Set pass limits from measured repeatability
Limits come from how repeatable the measurement is, not from one flattering master frame. The recipe takes about half an hour.
- Image the master unit 30 times, re-nesting it every cycle, so nesting scatter sits inside the measurement where it belongs.
- Compute every ROI's dark-corrected ratio per frame; that gives a mean M and a spread σ per button.
- Gate: 3σ must be at most one tenth of the tolerance band, the classic 10:1 gauge rule from measurement-systems practice. If it fails, the station is the defect: tighten the nest, lengthen the warm-up, fix the drive before writing any limits.
- Write the limits at M plus and minus (per-side tolerance minus 3σ), reserving the gauge's share of the band so parts are never judged inside the measurement's own scatter.
- Make the logged verdict value the ratio, with the raw means kept alongside for diagnosis.
Worked example: twelve buttons on a backlit faceplate
One station, end to end. The camera is a 15 MP GigE unit in a dark enclosure, reading 8-bit gray levels from 0 to 255. Each of the twelve backlit buttons carries a 200 x 200 pixel ROI (N = 40,000); the reference lamp's ROI is 300 x 300 (N = 90,000). A 30-frame burst with nothing moving shows a single-pixel σ of 4 gray levels, and the dark frame reads 16 levels everywhere. In a session frame, one button's raw mean is 180 and the reference lamp's is 150. The product specification allows button brightness within ±10% of the master. The 30-frame master run, re-nested each cycle, shows a ratio σ of 0.006.
The rules at work: the mean's noise is σ_pixel / √N, the ratio's noise combines both ROIs in quadrature, and the gauge gate demands 3σ no larger than a tenth of the tolerance band.
- Button ROI mean noise: 4 / √40,000 = 4 / 200 = 0.02 gray levels. Reference ROI: 4 / √90,000 = 4 / 300 ≈ 0.013 levels.
- Dark-corrected master ratio: (180 - 16) / (150 - 16) = 164 / 134 = 1.22.
- Pixel-noise contribution to the ratio: 1.22 x √((0.02/164)² + (0.013/134)²) ≈ 1.22 x 0.00016 ≈ 0.0002, under 0.02% of the reading. Averaging has already done its work.
- Run-to-run scatter: 3σ = 3 x 0.006 = 0.018, which is 0.018 / 1.22 = 1.5% of the master ratio. The band is 20% wide, so the gate allows 2%: at 1.5%, the station qualifies.
- Limits per side: 10% - 1.5% = 8.5%, so 1.22 x 0.915 = 1.12 and 1.22 x 1.085 = 1.32.
The decision: write 1.12 to 1.32 into the recipe for every button, and a unit fails if any button falls outside its band. Note where the effort pays. Pixel noise (0.0002) is thirty times smaller than the re-nesting scatter (0.006), so a quieter camera or more pixels buys nothing, while a tighter nest and a longer warm-up buy everything. Had the gate failed at, say, 3σ = 3%, the fix list is the same, nest then warm-up then drive, and only then do limits mean anything.
Verify the station before trusting it
- Fault catch: on a sacrificial unit, drop one button's drive by 10%. Its ratio falls from 1.22 to about 1.10, below the 1.12 limit, so a real fault fails loudly instead of drifting through.
- Ambient test: verdicts identical with room lights on and off. If they move, the enclosure leaks, and the day-night shift difference will find it.
- Master pass: 30 of 30 master cycles inside the band, re-nested each time.
- Known failure: a dim button from the scrap bin fails the button it belongs to.
After release, image the master at every shift start and plot each ROI's ratio on a control chart. Investigate any point outside its historical ±3σ band before running parts: that drift is almost always lamp aging, dust on the optics or a loosening mount, all of them quick, low-cost fixes if you catch them early.
Common mistakes that destabilize the numbers
- Limits written from one master frame: nesting scatter alone puts units on the wrong side of the line at random.
- Any auto mode left on: the camera rescales every image and last month's limits silently stop meaning anything.
- Raw counts compared across sessions, exposure edits or replacement lamps.
- ROIs touching feature edges: a fraction of a millimeter of nest shift drags background in, and the ROI's σ is the tell.
- Clipped pixels at 255 averaged as if they were data.
- No dark frame, so a 10-20 level pedestal rides inside every ratio by a percent or two.
- Strobe width treated as fixed while it drifts, or an unsynchronized mains-driven lamp beating against the exposure at 100 or 120 Hz.
- A reference lamp on an unregulated supply: the reference then legitimizes drift instead of removing it.
Next step: put the station together
Size the camera around pixel budget and interface first: the camera finder filters by resolution, interface and shutter. Then pick the regulated drive in the light-controller finder. The lighting topic page collects the other illumination-method guides on this site. Send the enclosure sketch, button layout and tolerance through the contact page, and we will check the ROI plan against the parts you have shortlisted before you order.
The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.
Questions
Can a machine vision camera measure light intensity in lux?
Not directly. Gray counts are relative to exposure, gain and aperture, and a silicon sensor's spectral response is not the photopic curve a lux meter follows. You can map counts to a meter reading at one fixed exposure, but that calibration holds only for that spectrum and those settings. For pass or fail on brightness, the normalized ratio in this guide avoids the whole problem, because both the part and the reference move together.
How large should an ROI be for a stable intensity reading?
The noise of an ROI mean falls with the square root of its pixel count. With a single-pixel spread of 3-5 gray levels, a 30 x 30 ROI already cuts the mean's noise below 0.2 levels, and 100 x 100 makes it negligible against any realistic tolerance. Below roughly 10 x 10, single pixels start to dominate and readings jump. Keep the ROI a few pixels inside the feature edge so nest shift never pulls background in.
Should I normalize to a reflectance patch or a reference lamp?
Use a reflectance patch when your own light illuminates the part: the patch sees the lamp's drift too, so the ratio cancels lamp and camera together. Use a reference lamp at fixed current when the part emits its own light, as with backlit buttons; it cancels camera drift only, so its drive must be regulated. A white patch lit by the part's own glow can also track part output, but calibrate its coupling on master units.
Why do my readings drift during the first half hour?
The lamp's LED junction warms and its output falls a few percent, and the sensor's dark level rises with temperature. Neither settles instantly. Power the station for ten to fifteen minutes before judging, and log the reference ROI during warm-up on a new station: when the reference mean stops moving, the scale is stable. The ratio removes camera-side drift frame by frame, but source-side warm-up must be spent before limits mean anything.
How often should I re-image the master unit?
Once at every shift start, and after anything changes: a lens cleaned, a lamp replaced, an exposure edited, a fixture adjusted. Plot each master ratio on a control chart and act when a reading leaves the historical plus-or-minus 3-sigma band; that drift is usually lamp aging, contamination or a loose mount, not the parts. For the first week, add a check every one to two hours to learn how fast your station actually moves.



