Cameras & sensorsExplainer

Pixel values to nits: calibrating a camera for luminance

Pixel values are relative luminance, not nits. Calibrate against a known patch at fixed exposure and gain, then convert DN to cd/m² and foot-lamberts.

LumaSpec Vision11 min read Share on LinkedIn

On this page 11 sections
  1. 01What an 8-bit pixel value actually measures
  2. 02Nits, foot-lamberts and what a camera sees
  3. 03The linear camera model
  4. 04Calibrating the camera against a reference
  5. 05Worked example: 100 cd/m² patch at f/4 and 10 ms
  6. 06Changing exposure, gain or aperture after calibration
  7. 07What breaks the conversion
  8. 08Choosing a camera and drive electronics
  9. 09Keeping the calibration valid
  10. 10Before you trust the number
  11. 11Questions

Your inspection code hands you grayscale values from 0 to 255, and the drawing in front of you demands nits or foot-lamberts: a backlight with a 350 cd/m² minimum, an avionics legend specified in foot-lamberts. The pixel value does not carry those units on its own. It is a relative luminance, rescaled by exposure time, gain, aperture, gamma and everything else in the optical path. This page gives you the linear model that connects the two worlds, a five-step calibration against a patch of known luminance, one worked example with the arithmetic written out, and the rules for changing settings afterwards without starting over. It is aimed at anyone building a luminance-check station from standard machine-vision hardware.

What an 8-bit pixel value actually measures

Each pixel value is a count of photoelectrons that the sensor's ADC turns into a digital number. Between the scene and that number sit exposure time, sensor gain, lens aperture, lens transmission, the sensor's spectral response, the black-level offset, and any gamma curve or lookup table the camera applies. Change the exposure from 10 ms to 20 ms and every value roughly doubles. Open the lens one stop and they double again. Switch gamma on and the straight line bends into a power curve.

On a color camera, the luminance plane your library computes is a weighted channel mix — about 21 percent red, 72 percent green, 7 percent blue for the sRGB weights — usually followed by display gamma. That is relative luminance as the display world defines it: a value scaled to a chosen white point, not a physical quantity with units.

A machine-vision mono camera normally ships with gamma off, a linear response. Keep it linear for this work. With fixed exposure, fixed gain and a fixed aperture, the pixel value is proportional to the luminance of the patch it images. Proportional — with a constant of proportionality that nobody publishes, because it includes your lens, your aperture and your unit's tolerance.

Nits, foot-lamberts and what a camera sees

A nit is one candela per square metre, written cd/m². A foot-lambert is 1/π candela per square foot, which comes to 3.426 cd/m². Both conversions fit on one line:

1 nit = 1 cd/m² 1 fL = 3.426 cd/m² L [fL] = L [cd/m²] ÷ 3.426 (≈ 0.292 × L [cd/m²]) L [cd/m²] = L [fL] × 3.426

Luminance is what a camera and your eye both measure: light arriving from a surface, per unit area, per unit solid angle, in a direction. Illuminance is different — light falling onto a surface — and that is what a lux meter reads. If your specification is written in lux at the working distance, start from Can you convert pixel values to lux with a camera? instead.

Where the units live: display and backlight production lines specify nits; aviation panel verification has traditionally specified foot-lamberts. Display calibration itself puts a reference screen near 100 cd/m², inside a commonly recommended 80-120 nit range — which makes a patch of about that luminance a convenient calibration reference for the camera too.

The linear camera model

In the linear part of its range — gamma off, nothing saturated, dark level subtracted — a mono camera obeys a one-line model:

DN_net = s · L · t · G / N² G = 10^(gain dB / 20) → 6 dB ≈ ×2 k = L_ref / (DN_ref - DN_dark) [cd/m² per DN] L = (DN - DN_dark) · k

DN_net is the pixel value after subtracting the dark level. L is the patch luminance in cd/m², t is exposure time, and G is the gain factor. Machine-vision gain is usually specified in dB on the 20·log convention, where 6 dB is a factor of about 2. N is the f-number and the square matters: opening from f/4 to f/2.8 multiplies the light by (4/2.8)² ≈ 2.0. The bundled factor s contains pixel area, lens transmission and sensor efficiency for your spectrum. Nobody publishes s for your exact optics, and no code can recover it. One reference measurement collapses s, t, G and N into a single constant k, in cd/m² per DN — and that constant is the whole conversion.

Calibrating the camera against a reference

Five steps on a bench, no custom hardware:

  1. Lock every setting: manual exposure, manual gain at 0 dB, gamma off, fixed-aperture C-mount lens, focus fixed. Record the values beside the calibration — they are part of the constant.
  2. Take a dark frame: cap the lens, keep the same exposure and gain, average 16 frames or more, record the mean as DN_dark.
  3. Present the reference: a uniform patch of known luminance — a calibrated light box, or a matte patch measured with a spot luminance meter. Fill at least a few hundred pixels and record the region mean as DN_ref and the meter value as L_ref in cd/m².
  4. Compute k = L_ref / (DN_ref − DN_dark) and keep its unit explicit: cd/m² per DN.
  5. Verify linearity: halve the exposure, take a second reference frame, and confirm the net value halves within a few percent. If it does not, exposure is clipping or the response curves — shorten the exposure until it behaves, or fit a full response curve instead of one k.

Step 1 needs nothing exotic: a 12 MP mono GigE camera with a C-mount such as the LS-CMR-0053 runs the whole procedure on any bench.

Area scan cameras12 MP GigE area scan camera, IMX226, 1/1.7" rolling shutter, 9 fps (LS-CMR-0053)LS-CMR-0053
Sensor format
1/1.7"
Lens mount
C-mount
Interface
GigE
Resolution
12 MP
$560.00View partBuild a system with it

Worked example: 100 cd/m² patch at f/4 and 10 ms

The case: a display-line station that must flag panels under a 100 cd/m² backlight minimum, measured through the camera instead of a hand meter. The inputs:

  • L_ref = 100 cd/m² — the spot luminance meter reading on the reference patch, set near the 80-120 nit range display calibration uses.
  • DN_ref = 180 — mean of the patch region in the 8-bit mono image.
  • DN_dark = 16 — mean of the lens-capped dark frame at the same settings.
  • t_ref = 10 ms, gain 0 dB (G = 1), aperture f/4, gamma off, the calibration lens in place.

The rule in words: the constant is the known luminance divided by the net reference value. Arithmetic: k = 100 cd/m² ÷ (180 − 16) DN = 100 ÷ 164 = 0.61 cd/m² per DN.

A production panel then lands under the camera, same settings, and its patch region reads DN 200. Net value and luminance: (200 − 16) DN × 0.61 cd/m²/DN = 184 × 0.61 = 112.2 ≈ 112 cd/m². For the drawing that still speaks foot-lamberts: 112.2 ÷ 3.426 = 32.7 fL.

Decision: the 100 cd/m² minimum corresponds to a net value of 164 DN, an indicated DN of 180 at these settings — so DN 180 on a panel is the go/no-go line on the production floor. This panel reads DN 200, which is 112 cd/m² (32.7 fL) and passes with a 12 percent margin. The factor 0.61 cd/m²/DN is valid only at 10 ms, 0 dB, f/4, gamma off, with this lens; change any of those and rescale as below.

Changing exposure, gain or aperture after calibration

A new reference measurement is only needed when the lens changes or the spectrum changes. For exposure, gain and aperture the model rescales directly:

L ≈ (DN - DN_dark) · k · (t_ref / t) · (N / N_ref)² / 10^(Δgain dB / 20)

Move exposure from 10 ms to 20 ms and each DN is worth half as much: k drops from 0.61 to 0.31 cd/m² per DN. Add 6 dB of gain and DN doubles, so k halves again. Open the iris from f/4 to f/2.8 and DN multiplies by (4/2.8)² ≈ 2.0, so k drops by the same factor.

Check the gain convention on your camera before trusting the 6 dB figure: most follow 20·log, where 6.0 dB is ×2.0, but some expose gain in stops or in raw register steps instead. Camera exposure and gain units: interpreting raw values shows how to read the raw values before you divide.

What breaks the conversion

Gamma first: with it on, DN follows a power curve of the linear signal (about 1/2.2 for sRGB-style curves), so one k cannot hold across the range. Turn gamma off in the camera features, and check for an applied lookup table while you are there.

Auto modes second: auto exposure and auto gain re-aim the brightness frame by frame, so k drifts with them. The failure mode and the fix are the same ones in Camera image brightness drifts over time: turn every auto mode off.

Color weighting third: white balance multiplies each channel before the grayscale mix, so a color camera's luminance plane depends on that day's balance gains. Calibrate the color camera exactly as delivered, or move the measurement to a mono model.

Spectrum fourth, and it is the one that surprises: silicon keeps sensitivity into the near infrared — past 900 nm with the IR-cut filter absent — while the photopic eye response peaks at 555 nm and fades near 700 nm. A camera calibrated under a white LED over-reads a red or infrared backlight because it sees wavelengths the calibration never weighted. Calibrate against the same spectrum you will measure, and treat an infrared-backlight reading as a camera-scaled figure, not a photometric one.

Dark subtraction, last: subtracting DN_dark can push dark pixels negative in 8-bit arithmetic, which SNR calculation from 8-bit camera images: fix negative signed values handles. And if the camera ships 10-bit ADC data as 8-bit images, the DN scale itself shifts — ADC bit depth vs pixel format: why 10-bit sensors ship 8-bit images explains the mapping your k must match.

Choosing a camera and drive electronics

The camera side needs four properties: a mono sensor, manual exposure and gain you can lock, a gamma setting that turns off, and a lens mount that survives lens swaps without moving the optics. GigE and USB3 both carry the job; the choice is cable length and host ports, not calibration accuracy.

The three mono cameras below hold a calibration equally well; pick by resolution, format and interface:

Specification MV-CT0MG0060/R/NN/NN MV-CS200-10UM LS-CMR-0053
Sensor type CMOS, rolling shutter CMOS, rolling shutter CMOS
Sensor model Sony IMX178 Sony® IMX183 IMX 226
Pixel size 2.4 μm × 2.4 μm 2.4 μm × 2.4 μm 1.85 μm x 1.85 μm
Sensor size 1/1.8" 1" 1/1.7"
Resolution 3072 × 2048 5472 × 3648 4000 px x 3000 px
Max. frame rate 19.5 fps @ 3072 × 2048 Mono 8 19.2 fps @ 5472 × 3648 Mono 8 9 fps
Dynamic range 71.3 dB 65.5 dB 60.0 dB
SNR 41.3 dB 41.5 dB >38.5 dB
Gain 0 dB to 24 dB 0 dB to 24 dB –
Exposure time 25 μs to 3.1 sec 44 μs to 0.83 sec –
Exposure mode Off/Once/Continuous exposure mode, supports Rolling and Global Reset Off/Once/Continuous exposure mode, supports Global Reset and Rolling –
Pixel format Mono 8/10/10Packed/12/12Packed Mono 8/10/10Packed/12/12Packed –
Price $909.00 $759.00 $560.00

Values as printed in each product's data sheet; open a part for its drawing and full specifications.

For dense luminance maps — many patches in one frame, or a full display — resolution pays directly. The MV-CS200-10UM puts 20 MP of mono resolution on a 1-inch sensor over USB3, which splits a wide panel into more measured patches per image.

Area scan camerasHikrobot MV-CS200-10UM 20 MP Area Scan Camera, USB3.0, IMX183, 2nd Gen., MonoMV-CS200-10UM
Sensor format
1"
Lens mount
C-mount
Interface
USB3
Resolution
16-25 MP
$759.00View partBuild a system with it

The luminance you measure is only as repeatable as the drive through the LEDs. A constant-current controller such as the LS-CTL-0180 — a 4-channel constant-current unit rated 120 W for 24 V lights — holds LED current steady against supply ripple and dimming commands. Pair it with the feedback methods in Closed loop lighting control for repeatable vision images, and the light controllers category sorts the rest by channels and output type.

Light controllersConstant current controller, 4 ch, 120 W, 89 x 147 mm, for 24 V lights (LS-CTL-0180)LS-CTL-0180
Output
Constant current
Channels
4 channels
Control
Digital
Feature
Constant current
$359.00View partBuild a system with it

Keeping the calibration valid

Temperature moves the dark level: after the station reaches operating temperature, retake the dark frame, and again whenever the warm-up routine or enclosure airflow changes.

The reference drifts too: re-image the patch on a schedule — weekly during commissioning, monthly once stable. The scale is linear, so a 2 percent shift in net DN is a 2 percent error in every reading the station reports.

Settings resurrect themselves: a firmware update or a cloned configuration file can switch an auto mode or a gamma curve back on. Dump the feature list after every update; Industrial camera image quality settings: exposure, gain, balance lists the settings worth pinning.

Before you trust the number

  • Gamma off, auto exposure off, auto gain off.
  • Dark frame taken at operating temperature and subtracted from every reading.
  • Reference region spans a few hundred pixels or more, and you use its mean.
  • All values you will read sit mid-scale, roughly 30 to 220 net DN.
  • Exposure, gain, f-number, lens and bit depth recorded beside k.
  • Reference luminance re-verified against the spot meter before each run.

Nothing in the rig is exotic: one mono area scan camera, a manual C-mount lens, a reference patch and a meter. To size the camera and lock the settings chain, start from the camera configurator, the cameras finder or the cameras topic page. If you send us the exposure chain — camera, lens, light and target luminance — we will review the calibration plan with you through the contact page; expert support is free with every order.

Questions

How many foot-lamberts is one nit?

The foot-lambert is 1/π candela per square foot, which equals 3.426 cd/m², so one nit (1 cd/m²) is about 0.292 foot-lamberts. To convert a reading from nits to foot-lamberts, divide by 3.426: a 100 cd/m² display reads about 29.2 fL. Multiplying by 3.426 instead of dividing inflates the same display to over 340 fL, so keep the direction of the factor with the unit.

Does the calibration survive a lens or filter change?

No. The constant absorbs the optical path: lens transmission, the f-number the ring is set to, and any filter in the stack. Fit a different lens, refocus at another aperture, or add a neutral density or band-pass filter, and the reference measurement must be repeated. Record the lens part number and f-number beside the constant, and treat any optical change like a new calibration.

Why does a color camera disagree with a mono camera on the same scene?

A color camera builds luminance as a weighted mix of red, green and blue — about 21, 72 and 7 percent — and white balance multiplies each channel by its own gain before that mix. A mono sensor integrates its whole spectral response into one number. Two cameras therefore rarely agree without per-camera calibration against the same reference patch under the same spectrum.

Can I calibrate without a luminance meter?

Only against a source whose luminance you already trust. A recently calibrated display set near 100 cd/m² works as the reference. An uncalibrated white patch under room light does not: its luminance changes with every change in the room illumination, so the constant inherits that uncertainty. Published low-equipment calibration methods exist, but every one of them still needs a single trusted reference reading.

Where should the reference patch sit in the 8-bit range?

Aim the reference mean near 60 to 70 percent of full scale — about 150 to 180 DN after dark subtraction — with gain at 0 dB. That leaves headroom for brighter production panels and keeps dimmer ones well above the noise floor. The worked example above uses 180 DN, which puts the 100 cd/m² pass line exactly on the reference value.