Cameras & sensorsHow-to

Camera dynamic range measurement with a gray step target

Measure a machine vision camera's dynamic range yourself: image a reflectance step wedge, plot gray level against target value, and read the usable range.

LumaSpec Vision9 min read Share on LinkedIn

On this page 13 sections
  1. 01What you are actually measuring
  2. 02What you need
  3. 03Step 1: set a fixed working exposure
  4. 04Step 2: capture the target frames and a dark frame
  5. 05Step 3: read each patch and correct for black level
  6. 06Step 4: plot the response curve
  7. 07Step 5: read the dynamic range from the plot
  8. 08Choosing a camera to test: what resolution adds
  9. 09Color cameras: one curve per channel
  10. 10Common mistakes that skew the result
  11. 11Quick checklist before you quote a number
  12. 12When the usual answer is wrong
  13. 13Questions

A camera's data sheet quotes a dynamic range in dB, but that number describes the sensor under laboratory conditions, not your lens, your light or your part. If you need to know how much signal range you actually have — for example to judge whether faint surface shading will survive next to a bright highlight — you can measure it on the bench in under an hour. This guide shows how to image a reflectance step target, plot the response curve, and read the usable range from it. It assumes a basic machine vision set-up: camera, lens, fixed light, and capture software that reports pixel values.

What you are actually measuring

Dynamic range is a ratio:

DR = S_max / S_min DR(dB) = 20 × log10(S_max / S_min)

Here S_max is the largest signal the camera records before the response flattens (saturation), and S_min is the smallest signal you can still tell apart from noise. The ratio is conventionally given in decibels; a 60 dB camera spans a factor of 1,000 between its noise floor and saturation.

You will not measure the sensor's full well capacity or read noise directly — that is what the EMVA 1288 standard characterizes with specialized equipment. What you can measure, and what matters in practice, is where the response curve saturates and where the steps become indistinguishable from noise under your working conditions.

What you need

  • The camera under test with its working lens mounted.
  • A gray-scale step target: a photographic step wedge or any printed chart with at least 12 patches of known, evenly spaced reflectance. Uniform matte patches, evenly spaced in log reflectance, are ideal.
  • A stable light source: a diffuse machine vision light on a constant-current controller. Avoid the AC-driven lamp on the bench ceiling; 50/60 Hz flicker corrupts low-signal readings.
  • Capture software that shows a pixel readout or histogram, or saves raw frames.
  • A dark frame: a lens cap shot at the same exposure time.

A mono camera keeps the analysis simple. For color cameras, see the notes on Bayer sensors near the end. A compact 20 MP USB3 model such as the MV-CS200-10UM is a convenient test camera: it connects to a laptop without a frame grabber, so you can move it between test stations.

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

Step 1: set a fixed working exposure

Mount the camera square to the target, fill roughly half the frame with the step chart, and set the illumination so the brightest patch sits at about 80 to 90 percent of full scale — just below saturation. Note the exposure time, gain and aperture. Every subsequent frame uses these values unchanged.

Set the gain to the value you actually use in production. Gain raises the noise floor as well as the signal, so measuring at an unrealistically low gain overstates the usable range.

If you want a refresher on what the raw exposure and gain numbers mean before you start, the guide to camera exposure and gain units explains how raw values map to microseconds and decibels.

Step 2: capture the target frames and a dark frame

Capture 8 to 16 frames of the target and average them patch by patch. Averaging suppresses photon shot noise so the curve shows the camera's response, not one lucky sample. Then cap the lens and capture the same number of dark frames at the identical exposure and gain.

Step 3: read each patch and correct for black level

For each patch, average a small region of interest well inside the patch — 30 by 30 pixels is plenty — and stay away from patch edges, where shading and sharpening distort the value. Record the mean P_i for each patch. Compute the dark mean D the same way, then subtract:

S_i = P_i - D

Also record the standard deviation σ_i of each patch region. You will use it to find the noise floor in Step 5.

Step 4: plot the response curve

Plot S_i on the y-axis against the target reflectance R_i (or log reflectance) on the x-axis. For a well-behaved linear sensor you should see a straight line through the origin, a soft knee where it flattens at saturation, and a flat plateau above the knee.

A useful sanity check is the linearity of the lower 70 percent of the curve. Fit a line to those points and look at the residuals: patches deviating more than a few percent from the fit indicate a non-linearity, stray light, or a target patch whose stated reflectance is off.

Step 5: read the dynamic range from the plot

Two numbers come off the curve:

  • Saturation level S_max: the highest corrected signal before the curve flattens, in gray levels.
  • Noise floor S_min: the signal at which the patch standard deviation σ equals the signal difference between adjacent steps — practically, the smallest step you can still resolve. A common approximation is to use the dark-frame noise plus shot noise at low signal; in bench terms, find where σ_i exceeds about half the step spacing.

Worked example, with the arithmetic:

  • Saturation knee at a corrected signal of 3,900 gray levels (a 12-bit camera, full scale 4,095).
  • Dark frame noise σ ≈ 3 gray levels; the smallest resolvable step works out to about 12 gray levels.
DR = 3900 / 12 = 325 DR(dB) = 20 × log10(325) ≈ 50 dB

A 50 dB bench figure against a data sheet value of 60 dB or more is normal. Your measurement includes the lens, the illumination non-uniformity, stray light and quantization; the data sheet number does not.

Choosing a camera to test: what resolution adds

Higher resolution helps the measurement itself: with more pixels per patch, your region-of-interest averages are tighter and the noise estimates more stable. If you are comparing cameras for a measuring task, a 12 MP model such as the LS-CMR-0166 gives you a 4000 × 3000 frame, so a 12-patch wedge can occupy hundreds of pixels per patch with room to spare.

Area scan cameras12 MP USB3 area scan camera, IMX226, 1/1.7" rolling shutter, 30 fps, 4000 × 3000 resolution (LS-CMR-0166)LS-CMR-0166
Sensor format
1/1.7"
Interface
USB3
Resolution
12 MP
Shutter
Rolling
$560.00View partBuild a system with it

When the point of the exercise is to choose between candidate cameras, run the identical target, light, exposure and gain through each, and compare the curves rather than single dB numbers. Two cameras with equal dynamic range can differ in linearity and in where the knee sits — and those differences decide which one handles your brightest highlight or your faintest shading.

Specification MV-CS200-10UM LS-CMR-0166
Sensor model Sony® IMX183 Sony IMX226
Pixel size 2.4 μm × 2.4 μm 1.85 μm
Sensor size 1" 1/1.7"
Resolution 5472 × 3648 4000 × 3000 (12MP)
Max. frame rate 19.2 fps @ 5472 × 3648 Mono 8 30 fps
Data interface USB3.0, compatible with USB2.0 USB 3.0
Price $759.00 $560.00

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

For a wider shortlist before you test, filter the area scan cameras by interface, resolution and sensor format, then borrow the top two or three into the bench procedure above.

Color cameras: one curve per channel

On a Bayer-sensor color camera, saturation is not one number. Green pixels usually saturate first because they carry twice the sensor area per unit frame, while red and blue channels reach full scale at different exposures. If your capture software can save raw frames, compute the response curve separately for R, G and B before demosaicing. If it only gives you processed RGB, treat the result as an indicative measurement: interpolation has already mixed neighboring pixels, and a curve drawn from demosaiced values will read smoother than the sensor really is.

The same caution applies to more exotic sensors. A hyperspectral camera — see the category of hyperspectral cameras — returns hundreds of narrow bands, and each band has its own response and saturation point. The step-wedge method still works, but you plot one curve per band and expect the usable range to vary across the spectrum.

Common mistakes that skew the result

  1. Auto exposure or auto gain left on. Each patch then gets its own operating point, and the plot is meaningless. Lock everything.
  2. Saturated target, not saturated camera. If your light drives the target beyond what the lens can deliver, the camera never shows its real knee. Check that lowering the light lowers the reading proportionally at the top end.
  3. Stray light on the chart. A glossy step target catches reflections and adds phantom signal. Use matte targets and shade the set-up; the article on scratch defect detection with lighting shows how directional glare behaves on surfaces and why diffuse light helps.
  4. Patch regions too close to edges. Optical vignetting and any lens shading darken patch corners. Sample the patch centre only, or flat-field correct first.
  5. Ignoring black level. Always subtract the dark frame, as in Step 3.

Quick checklist before you quote a number

  • Exposure, gain and aperture fixed and written down.
  • Dark frames captured at the same settings and subtracted.
  • At least 8 frames averaged per patch.
  • Brightest patch just below saturation, with the light verified stable.
  • Sample regions centred, well inside each patch.
  • Curve checked for linearity in the lower 70 percent.
  • Number reported with its conditions: exposure, gain, lens, light and bit depth.

When the usual answer is wrong

A step-wedge response curve answers one question: how much signal range is usable at one operating point. It does not tell you about temporal noise under line-scan conditions, about spectral response, or about whether 50 dB is enough for your defect. If the real question is image quality tuning rather than measurement, start with the practical guide to industrial camera image quality settings, and use the bench curve to confirm the settings rather than replace them.

When you have measured your camera and find the usable range falls short, the fix is usually not a new camera: lower the gain, add light to lift the dark end of the signal, or reposition the exposure so the features that matter sit inside the linear part of the curve. If a change of camera is genuinely needed, the camera finder or the step-by-step system configurator narrows candidates by sensor, interface and resolution, and our application team can review your response plots against candidate sensors before you order.

Questions

How many patches does a step target need for a usable response curve?

Twelve evenly spaced steps is a practical minimum for seeing the knee of the curve and the noise floor. A 20-step wedge resolves the toe and shoulder more finely, which matters if you need to quote the saturation point or a linear range precisely. Space the steps evenly in log reflectance so the plot reads evenly along the x-axis.

Should I use a color or mono camera for dynamic range measurement?

Measure each camera you plan to use. On a color camera with a Bayer filter, green pixels usually reach saturation first, so a single luminance reading can hide channel differences. Demosaicing also mixes neighboring pixels, so read raw values per channel if your capture software exposes them, and expect the red and blue channels to saturate earlier than green.

Why is my measured dynamic range lower than the data sheet value?

Data sheets quote the sensor's full well capacity divided by its read noise, often measured to an EMVA 1288 procedure under controlled conditions. Your bench measurement adds photon shot noise, non-uniform illumination, stray light and quantization, and it includes the lens and optics. A bench figure of 55 dB against a 68 dB data sheet value is normal, not a fault.

Can I measure dynamic range with ambient room light only?

Yes, if the room is dim and stable and you shade the target from stray reflections. What matters is that the illumination does not change between the dark reference frames and the bright target frames, and that no step saturates before the camera does. Dim, even, constant light from a machine vision light on a dimmer or constant-current controller is easier to hold steady than room lighting.