Cameras & sensorsTroubleshooting

HDR image looks unchanged: verify the exposure fusion really runs

The HDR image looks unchanged after you enable it. Run the ratio-0 histogram test, measure the headroom your scene needs, and fix the stream or the control.

LumaSpec Vision9 min read Share on LinkedIn

On this page 9 sections
  1. 01The test that decides it: ratio 0 against ratio 4
  2. 02Cause 1: the stream you are viewing is not the fused one
  3. 03Cause 2: the scene never clips, or clips more than the ratio covers
  4. 04Cause 3: the setting never took effect
  5. 05Cause 4: fusion runs, but the scene needs more than the ratio can give
  6. 06Worked example: glare on a turned part
  7. 07Prevention: lock, bracket, read back
  8. 08When the sensor ratio is not enough: cameras for the fallback
  9. 09Questions

You set the exposure-ratio control from 0 to 4, restart the pipeline, and the picture looks exactly the same. Before you conclude the HDR path is broken, remember what that control can change: it adds headroom above the point where a single exposure saturates, and nothing else. A scene that never clips will produce a fused frame that is allowed to look identical. This guide gives you a ten-minute verification: a paired capture with the ratio off and on, a histogram read that proves the fusion runs, a bracket method that measures how many stops your scene needs, and the places where the setting usually fails.

The test that decides it: ratio 0 against ratio 4

Fix the scene, lock the exposure and the gain, and capture two frames: one with the ratio at 0 (HDR off), one at 4. Auto-exposure must be off; an auto loop re-aims the exposure between captures and can hide working fusion behind a longer single exposure, which is the most common false negative. Save both frames to files and histogram the highlight region only, the area that sat at 255 in the ratio-0 frame.

The outcomes are unambiguous:

  • Pass: the 255 pile disappears and the highlight pixels spread below it. At ratio 4, a highlight one stop (2×) above the old saturation point lands near 255 × 2/4 ≈ 128 DN, and the band where the pixels settle tells you how far over it was.
  • Fail: the two histograms match. The fusion is not in this stream, or not in this build; work through the causes below in order.

Judge the histogram, never the preview. A fused frame is tone-mapped back into 8 bits, and a well-set tone curve keeps midtones where they were, so the overall look can stay close to the single-exposure image while the highlights change completely.

Cause 1: the stream you are viewing is not the fused one

Multi-exposure HDR lives in one of two places, and the fused image comes out of a different port in each.

Sensors that fuse on the die combine the sub-exposures in-pixel and output one finished stream; there is no unfused alternative to grab by mistake. Architectures where the sensor ships overlapping exposures to a downstream ISP are different: the fused, tone-mapped image exists only on that ISP's processed output, while the raw or sensor tap on the same node carries a single unfused leg that looks exactly like HDR-off.

Test it by capturing the same scene on every output the camera node offers. The fused output shows the histogram change described above; the raw leg keeps its 255 pile. Point your application at the processed stream only, and if the viewer applies its own display curve on top, judge saved files rather than the preview pane.

Machine-vision sensors generally sit in the first family: the die fuses, and the camera hands you one finished image. There the wrong-stream cause moves into your own software. A debug view that silently pulls a sensor tap, or stacks its own gamma on top, looks unchanged no matter what the camera does; histogram the saved files and the question disappears.

Cause 2: the scene never clips, or clips more than the ratio covers

The ratio buys a fixed amount of highlight headroom:

headroom = log2(R) stops # R = 2 -> 1 stop, 4 -> 2 stops, 8 -> 3 stops T_short = T_long / R

Two situations leave the image unchanged, and only one is a fault:

  1. The scene does not challenge the exposure. If the ratio-0 frame has no pixel at 255, there is nothing to recover, and a correct fusion is allowed to match it.
  2. The highlights sit above the headroom. At ratio 4 only highlights within two stops of saturation survive; anything brighter still clips, and the picture stays unchanged.

Tell them apart with a bracket test: halve the exposure in one-stop steps, 8 ms to 4 ms to 2 ms, until no pixel reaches 255. If the highlight cleans up two stops below your working exposure, it sits about two stops over saturation and ratio 4 is the bare minimum; three stops over needs ratio 8. If it never clips at any exposure, the scene was never the problem — raise the light or the exposure first, because HDR has nothing to add.

To turn this into repeatable numbers, shoot a gray step target and count the steps between the last clipping point and the brightest patch; the same procedure underlies the dynamic range measurement with a gray step target.

Cause 3: the setting never took effect

Some SDKs read the ratio only while building the camera node, so a value set after streaming starts is silently ignored. Some accept only the supported values, 0 to disable and 2, 4, 8, and quietly drop anything else. A few builds carry the control behind a non-default branch, where an error on read-back means the running build lacks the feature rather than a typo on your side.

The test is the same in every case: set the value, start the pipeline, read it back from the running camera, and print what came back. If the read-back does not show the ratio you set, fix the order of operations — set before start, or stop, set, start again — instead of debugging the image.

Check for conflicts too. An exposure override or an auto-exposure loop that runs after the ratio is applied rewrites the exposure the fusion depends on. Read the exposure time back as well; it should match the value you locked for the A/B test and stay stable across frames. Drift there points at the auto-exposure ROI instability from detection feedback pattern, not at HDR.

Cause 4: fusion runs, but the scene needs more than the ratio can give

The ratio ladder doubles as a measurement tool. With the scene locked, step the ratio 2, 4, then 8 and watch the highlight histogram. The first ratio that un-clips the highlight brackets it: clean at 2 means one to two stops over; 4 needed means two to three; still clipped at 8 means more than three stops over the long exposure's saturation, past what on-sensor ratio HDR can cover.

At that point, change the scene or the method. A two-stop stop-down from f/4 to f/8 buys two stops of highlight headroom at the cost of depth of field. Or keep the sensor single-exposure and capture two frames per scene at different exposure times, fused on the host: the HDR capture and fusion guide walks the merge, and the two exposures from one camera pattern shows how to get both frames from a single trigger without a serial command. That path trades away motion fidelity on fast parts, which the on-sensor versus multi-exposure comparison shows frame by frame; prefer the sensor's own ratio whenever the bracket says three stops is enough.

Worked example: glare on a turned part

Scene: a turned aluminium ring under a spot light, blown-out highlight on the machined OD, dark floor in the bore. Working exposure 8 ms at f/4, gain fixed, auto-exposure off, ratio 0.

  1. Bracket: 8 ms piles the highlight at 255; 4 ms still piles; 2 ms is clean, with the highlight peak at 190 DN.
  2. Over-saturation: 255/190 = 1.34× at 2 ms, so at 8 ms the highlight is 1.34 × 4 = 5.4× over, about 2.4 stops (log2 5.4 ≈ 2.4).
  3. Decision: ratio 4 adds two stops, so the highlight would land at 255 × 5.4/4 ≈ 344 DN, still clipped. Ratio 8 adds three stops: 255 × 5.4/8 ≈ 172 DN. Choose 8.
  4. Verify: at ratio 8 the pile moves to about 170 DN and the 255 line empties; the bore stays at 30 DN because the long leg is still 8 ms. Fusion was working all along; ratio 4 changed nothing because the highlight sat 2.4 stops over, not because HDR was off.

That is the whole diagnosis in four captures: bracket to stops, stops to ratio, ratio to histogram.

Prevention: lock, bracket, read back

  • Lock exposure and gain, and write the values down before any A/B capture.
  • Histogram the highlight region of saved files; preview panes apply their own curves.
  • Set the ratio before the pipeline starts, then read it back from the running camera.
  • Bracket once per lighting change and keep one stop of margin between the measured over-saturation and the chosen ratio.
  • Re-check cycle time after enabling: the sub-exposures share the frame period, so the usable long exposure shrinks.
  • Keep the exposure settings identical across runs and stations; the multi-exposure settings consistency guide lists what drifts between them.

When the sensor ratio is not enough: cameras for the fallback

The software-HDR fallback needs two things from the camera: a trigger input and per-frame exposure control, which is standard on area scan cameras. Global shutter keeps both frames registered when the part moves between exposures, and a smart camera covers no-PC cells by running the whole inspection on the device.

Two global-shutter examples: the MV-CU020-90GC pairs a 2.5 MP sensor with GigE, and the MV-CH120-11UC scales the same idea to 12 MP over USB3.

Area scan camerasHikrobot MV-CU020-90GC 2.5 MP Area Scan Camera, GigE, GMAX4002, ColorMV-CU020-90GC
Sensor format
1/1.7"
Lens mount
C-mount
$309.00View part
Area scan camerasHikrobot MV-CH120-11UC 12 MP Area Scan Camera, USB3, IMX304, High-speed version, ColorMV-CH120-11UC
Sensor format
1.1"
Lens mount
C-mount
$2,339.00 · quotedView and quote

If you are unsure whether your sensor carries a ratio control at all, pick candidates in the camera finder, build the pair you need in the camera configurator, or ask our applications team with your scene contrast in stops — that turns the choice into a one-line answer. More camera-side checks live on the cameras topic page.

Questions

Does the HDR exposure ratio reduce my frame rate?

The sub-exposures share one frame period, so they must fit inside it. At 30 fps the budget is about 33 ms; with ratio 8, a 25 ms long leg leaves about 3 ms for the short leg (25/8 ≈ 3.1). The ratio does not lower the frame count, but it caps usable exposure: the long leg cannot exceed the frame time minus the short leg. Sequential multi-exposure designs behave this way; overlapping sensor designs differ. If you need longer, lower the frame rate first.

Why does my HDR image still look flat?

The fused frame is tone-mapped back into 8 bits, and a well-set tone curve aims to keep the midtones where they were. The visible difference lives at the highlight end, so judge the histogram of the clipped region rather than the overall contrast. If the result needs more punch after fusion, adjust the tone-mapping weight, not the ratio; the ratio only sets the headroom.

Which ratio should I use: 2, 4 or 8?

Measure, then choose. Halve the exposure in one-stop steps until the highlight stops clipping; if it cleans up two stops down, the highlight is about two stops over and ratio 4 barely covers it. Three stops over needs ratio 8. Keep one stop of margin for flicker and part-to-part variation, so in practice a two-stop measurement argues for 8, and a one-stop measurement for 4.

Can I get HDR from a camera with no HDR mode?

Yes: two captures per scene, one exposed for the highlights and one for the shadows, fused in software on the host. The camera needs a trigger input and per-frame exposure control, which most GigE and USB3 area scan cameras provide. The cost appears on moving parts, because the two exposures are separate frames; check the motion-artifact comparison before you commit to it.

Does HDR change how the shadows look?

Little. The ratio only raises the saturation point of the short sub-exposure, so the gain sits at the bright end. Shadows improve indirectly: you can lengthen the long sub-exposure to lift them, because the short leg now holds the highlights. Deep-shadow noise still comes from the long leg, so keep the gain where it was and let exposure do the work.