3D visionHow-to

Emitter on/off capture: why auto exposure is fixed and what to do

Why auto exposure stays fixed when the IR emitter alternates on and off, and the manual exposure, metadata checks and software normalization that fix it.

LumaSpec Vision10 min read Share on LinkedIn

On this page 9 sections
  1. 01Why auto exposure holds fixed when the emitter alternates
  2. 02What you need
  3. 03Set exposure and gain manually in six steps
  4. 04Worked example: 6,000 µs for an on/off pair under a 3:1 ambient swing
  5. 05Close the brightness gap in software
  6. 06Strobe an external emitter when one exposure cannot serve
  7. 07Checks and common mistakes
  8. 08When the usual answer is wrong
  9. 09Questions

You switch the IR emitter on for one frame and off for the next, and exposure and gain refuse to move even with auto exposure enabled. That is not a fault: on depth cameras that alternate the emitter, the auto-exposure loop holds its output fixed, because it cannot settle between two illumination levels arriving every other frame. This guide is for machine-vision and robotics engineers capturing paired on/off IR frames for background subtraction, texture on demand, or inspection under changing ambient light. You will set exposure and gain manually with real numbers, verify both from per-frame metadata, close the brightness gap in software, and decide when an external strobed emitter beats the built-in projector.

Why auto exposure holds fixed when the emitter alternates

Auto exposure is a feedback loop. The camera meters a frame, compares the result with a brightness target, applies a new exposure time and gain, captures again, and repeats until the error is small. Each change has to be observed before the next one, so settling takes several frames.

Emitter on/off breaks the loop at its first step. One frame sees ambient light only; the next sees ambient plus the full IR pulse. An exposure that suits the bright frame clips the dim one, and an exposure that suits the dim one starves the bright one, so the metering error flips sign every frame and the loop would oscillate instead of settle. Depth camera firmware avoids that by holding exposure and gain at their set values for as long as the emitter toggles. Hardware sync modes that switch the emitter between cameras freeze the same controls for the same reason.

Treat the freeze as expected behaviour and plan on manual control. Some firmware generations let gain track ambient while exposure holds, so check your unit before you assume either way; use any movement as a bonus, never as a calibration. The per-camera auto exposure set-up for a depth rig covers the case where both cameras stream continuously. There the loop works, because the illumination does not alternate.

What you need

  • A depth camera whose IR emitter the SDK can switch per frame, or a hardware sync line that toggles it.
  • Manual exposure and gain controls on the stereo sensor, with per-frame metadata readback for actual exposure and gain.
  • A capture program that applies settings before streaming starts; many cameras ignore or delay changes made mid-stream.
  • For the external-emitter route: an IR strobe light plus a light controller with a strobe output.
  • A matte gray reference card on the fixture, for metering.

A projected structured-light 3D camera such as the MV-DPS200P-02 carries its own IR projector, which is exactly the emitter this workflow switches.

3D sensorsHikrobot MV-DPS200P-02 Projected structured-light 3D cameraMV-DPS200P-02
Type
Stereo / structured light
$8,829.00 · quotedView and quote

Set exposure and gain manually in six steps

  1. Turn auto exposure and auto gain off on the stereo sensor. Every auto mode must go: one residual auto mode drifts the image and takes your fixed settings with it. The brightness-drift checklist lists all of them.
  2. Set exposure before the stream starts. Start in the mid band, 5,000-10,000 µs, then refine with the arithmetic in the worked example below. The manual-before-streaming order shows the sequence that avoids silent failures.
  3. Set gain to a fixed low value and keep it identical for both frame types. Gain scales ambient and emitter signal together, so it cannot rebalance a pair. Only exposure time and emitter energy can.
  4. Stream and read actual exposure and gain from per-frame metadata for 30 frames. Both values must be identical on emitter-on and emitter-off frames. The metadata verification workflow shows how to match values to frames.
  5. Meter a real part: aim the emitter-on frame at 70-90% of full scale (about 180-230 counts on an 8-bit frame) and keep the emitter-off frame above about 20 counts before any software gain.
  6. Apply the same settings at every stream start. Power cycling or re-enumeration can reset controls; the startup order fix covers settings that do not take effect.

Worked example: 6,000 µs for an on/off pair under a 3:1 ambient swing

Inputs:

  • 8-bit frames, full scale 255 counts (the sensor's pixel format).
  • Linear response: pixel counts = rate × exposure × gain. Illustrative rates metered on a matte mid-gray part at the brightest expected ambient, at unity gain: 0.040 counts/µs with the emitter on (0.010 ambient + 0.030 emitter) and 0.010 counts/µs with it off. Substitute your own metered rates; the method does not change.
  • Design targets: bright frame at or below 240 counts (6% headroom for metering error) and at least 20:1 signal-to-noise on the normalized off frame for reliable thresholding.
  • Starting band from step 2: 5,000-10,000 µs.

Rule in words: the largest exposure that keeps the bright frame inside its headroom also fixes the dim frame's level; the software gain needed to lift the dim frame tells you whether one exposure can cover the whole ambient range.

pixel = rate × t × gain (clip at 255 counts) t_max = 240 / rate_on g = 240 / (rate_off × t_max)

Arithmetic:

  • t_max = 240 / 0.040 = 6,000 µs, inside the 5,000-10,000 µs band, so one exposure is feasible at the bright reference.
  • Dim frame at 6,000 µs: 0.010 × 6,000 = 60 counts.
  • Software gain to bring it to 240 counts: 240 / 60 = 4×. Count quantization as about 1 count RMS and scale it with the gain: 4 counts of noise against 240 counts of signal is 60:1, comfortably above target.
  • Ambient 3× dimmer: 60 / 3 = 20 counts, gain 12×, noise 12 counts, SNR 240 / 12 = 20:1, exactly at target.
  • Ambient 10× dimmer: 6 counts, gain 40×, noise 40 counts, SNR 240 / 40 = 6:1, unusable for thresholding.

Decision: set 6,000 µs and unity gain on both frames and normalize the off frame by 4× in software. One exposure serves the pair while ambient stays within a 3:1 band of the bright reference. Beyond that swing the required gain pushes quantization noise past the 20:1 line, so switch exposure per frame pair in software or raise the emitter contribution with an external strobe.

Close the brightness gap in software

Three tools, in the order we reach for them:

  • Normalize: multiply the off frame by the gain from the example. Low overhead, and enough for thresholding and display.
  • Subtract: the emitter-only image is the on frame minus the off frame. Valid only because both frames share exposure and gain; the frozen auto exposure is what makes the difference meaningful.
  • Switch exposure per pair: if your SDK commits capture parameters between frames, give the dim frame a longer exposure of its own. The per-part parameter switching workflow covers the mechanics, the frame sequencer alternates exposure per frame in hardware, and one-trigger image sets keep the pair bound to a single trigger.

Once the two frames differ in exposure, direct subtraction no longer works: normalize by the exposure ratio first, and expect the dim frame's noise to rise by that same ratio.

A fourth option restructures the timing instead. Run one pass with the emitter off and one with it on, so each stream sees constant illumination; auto exposure then works within each pass, bound by the maximum auto exposure cap if parts move. The cost is half the rate and a part that must not move between passes.

Strobe an external emitter when one exposure cannot serve

When ambient swings wider than one exposure can cover, sizing the strobe is the same arithmetic in reverse: pick the exposure that serves the dim end, then choose pulse energy so the on frame reaches the headroom target. At 6,000 µs and the 10×-dimmer ambient (0.001 counts/µs), the emitter must contribute 240 / 6,000 - 0.001 = 0.039 counts/µs, about 30% more energy than the 0.030 counts/µs bright-case pulse. A strobe sized with margin delivers that at every pulse.

Drive the strobe from a controller with a dedicated strobe output so the pulse lands inside the exposure window at fixed energy; the external flash sync technique uses the exposure time itself as the shutter window. The LS-CTL-0070 is a 4-channel, 200 W digital controller with a strobe feature on 24 V constant-voltage output. A closed-loop lighting check keeps pulse energy stable across a shift, which is what your fixed exposure assumes.

Light controllersDigital control box, 4 ch, 200 W, RS232 (LS-CTL-0070)LS-CTL-0070
Output
Constant voltage 24 V
Channels
4 channels
Control
Digital
Feature
Strobe
$549.00View partBuild a system with it

Checks and common mistakes

Checks before the settings go to production:

  • 30 consecutive paired frames with identical actual exposure and gain in metadata.
  • Brightest on frame peaking below 240 counts, with no saturated pixels on the shiniest part you ship.
  • Off frame above 20 counts before software gain.
  • Room-lights test: off-frame brightness must move by no more than a few counts when the hall lights switch. If it moves, a mains lamp is beating against your fixed exposure; the flicker diagnosis guide traces it.
  • Fixture subtraction: on a bare fixture, on minus off must be near zero. Residue means the two frames did not share settings.

Common mistakes:

  • Auto gain left on after turning auto exposure off.
  • Exposure changed mid-stream and assumed to have taken effect.
  • Normalization ratios taken from the live preview instead of captured metadata.
  • Different settings on the two frames, then subtracting anyway.

When the usual answer is wrong

ToF cameras do not pair emitter-on and emitter-off frames at all: they read depth from continuously modulated light on every frame, and the trade you manage is exposure against frame rate, as the ToF exposure and frame rate trade-off explains. A ToF sensing camera such as the MV-DT01WMU is the right tool when you need depth on every frame without pairs. Laser profilers set exposure per scan line through their own model, and the wider family of profilers, stereo and structured-light cameras is listed under 3D sensors.

3D sensorsHikrobot MV-DT01WMU ToF sensing cameraMV-DT01WMU
Type
Depth / ToF camera
Price on requestView and quote

If uncontrolled daylight forces your hand, do not fight the freeze: run the emitter fixed on, let auto exposure work in a normal stream capped as in the two-pass option above, and take the passive reference at a different time or station.

Size the chain as one decision — camera exposure, emitter energy, controller strobe — in the light controller finder or the configurator started at the controller step. More depth-camera capture guides sit on the 3D imaging topic page. If a pair still refuses to behave, send the metadata trace through the contact page and we will read it with you.

Questions

Does auto exposure ever work while the emitter alternates on and off?

Expect it not to: with the emitter toggling every frame, exposure and gain hold at their last set values by design, because the loop cannot settle between two brightness levels. Some firmware generations adjusted gain while holding exposure, so behaviour can differ across versions; check your unit by reading actual exposure and gain metadata over 30 frames with the mode enabled. If either value moves, treat it as a bonus, not a control.

What exposure and gain should I start from before metering?

Start in the mid band: 5,000 to 10,000 µs at the lowest fixed gain, then meter a real part and adjust until the brightest emitter-on frame sits near 70-90% of full scale. Lock both values before streaming starts. For moving parts, halve the exposure until blur stops and recover the lost signal with emitter energy or gain rather than time; gain costs noise uniformly, energy costs only light.

Can I use different exposures for the on and off frames?

Only if your camera's parameter set can change between streamed frames without dropping or corrupting them; many models commit settings only at stream start, and a sequencer is the hardware way to alternate exposure per frame. If the two frames do end up with different exposures, normalize by the ratio before any comparison and expect the dim frame's noise to rise by that same ratio. Equal settings remain the cleanest pair.

Does the emitter on/off freeze also apply to ToF depth cameras?

No. A ToF camera does not pair an emitter-on and emitter-off frame; it reads depth from continuously modulated light, with exposure time traded against frame rate. The freeze described here concerns structured-light and projector-based stereo depth cameras whose emitter toggles per frame. If your task needs depth on every frame without pairs, a ToF sensor with its exposure-versus-rate trade-off is the different tool for the job.

Why do my emitter-off frames change brightness between captures?

That is ambient flicker, not the emitter: mains-powered lamps pulse at 100 or 120 Hz, and a fixed exposure samples that pulsing at whatever phase each frame lands on, so consecutive frames differ in brightness. Shorten the exposure below about 4 ms to shrink the beat, drive the inspection cell's lighting from a DC supply or a strobe controller, and confirm the pattern disappears with the room lights off.