A stereo depth rig hands you an exposure you did not choose: the auto-exposure loop samples one designated mono sensor and drives both mono cameras with it, so when that camera's view brightens, both images and the depth map swing together. No API setting relocates that base camera, and compensation only biases the shared target. This guide shows how to pin exposure time and gain on each mono camera separately, with the arithmetic that picks the values and the checks that prove they hold.
Why does one mono camera set the exposure of both?
In the common rig of two mono sensors plus a color sensor, the depth pipeline takes auto-exposure statistics from one designated mono camera — on most designs the right one — and writes the resulting exposure time and gain to both mono sensors, so the left camera never measures light for itself.
One loop keeps the two views photometrically close, which is what the matching stage wants, but it couples them as well: a bright fixture visible only to the base camera drags the whole rig brighter, and a dark patch in its view darkens the depth map. Upstream the symptom is brightness hunting; downstream it is frame-to-frame depth jitter, which the stereo depth jitter troubleshooting guide traces end to end.
Can you switch the auto-exposure base from the right mono to the left?
No — on stereo depth rigs of this kind there is no API setting that relocates the base camera; the choice is fixed inside the depth pipeline, so the working fix is to stop depending on the shared loop and drive each camera's exposure yourself.
That leaves two options: accept the shared behavior, or take both mono cameras to manual exposure. Manual control removes the coupling entirely — each sensor then holds the value you measured for its own view — and it is the only route that gives the left camera an exposure of its own. The rest of this guide is that route.
Do exposure compensation settings fix the imbalance?
No — a per-camera compensation call biases the shared brightness target up or down, so it shifts both mono images together and cannot give the left camera its own exposure; one SDK names the call setAutoExposureCompensation, and no value of it moves the measurement to the other sensor.
The imbalance you see usually has a physical cause: the left camera looks through a guard window, sits farther off-axis, or sees less of the lamp. A physical cause needs its own integration time, not a nudge to a target the camera never measures. Compensation left at a nonzero value on top of manual exposure changes nothing you measure; zero it when you pin the cameras.
How do you set exposure time and gain separately on each camera?
You open one control session per mono camera, switch the GenICam auto features off, and write ExposureTime and Gain to each handle by its serial number — 5,000 µs on the right and 8,000 µs on the left in this guide's example.
What you need:
- The serial number or device ID of each mono camera, so each session lands on the intended sensor
- A control library that reaches the camera's GenICam features — the GenICam exposure example in Python shows the pattern
- A gray patch or a representative part placed where both cameras see it
- Your running frame rate (30 fps in this guide's numbers)
Steps:
- Open one control session per mono camera. A write to one handle never appears on the other, so per-camera control starts here.
- On each camera, set ExposureAuto to Off and GainAuto to Off — GenICam standard feature names every compliant camera publishes. If an enumeration rejects your string, read back the feature's symbolic list and use the exact spelling it reports; the GenICam enumeration check shows the routine.
- Write ExposureTime: 5000 µs on the right mono and 8000 µs on the left, the measured values from the next section. Both sit under the 33,333 µs frame-period cap at 30 fps.
- Write Gain to its base value (0 dB on a dB-scaled camera, 1 on a factor-scaled one) on both cameras, and leave it there until the blur budget forces a step up.
- Decide the color camera separately: leave its own auto exposure running unless your application compares color against depth.
- Save the settings to the camera's user set if it offers one, or apply them in the startup path before streaming begins — writes that land after the stream starts can be silently ignored, which is the startup setting-order failure.
What exposure time should each camera get?
Measure it: run a short trial exposure on both cameras, read each mean gray level, and scale — a 2,000 µs trial reading 52 on the right and 33 on the left, against a target mean of 130, sets 5,000 µs on the right and 8,000 µs on the left.
How do you scale from a trial exposure?
Brightness scales linearly with exposure time while the sensor stays in its linear range, so each setting is trial time multiplied by target over measured:
Take the trial at 2,000 µs and a target mean of 130 gray levels, near the middle of the 8-bit range so highlights and shadows keep headroom:
- Right mono reads 52: 2,000 × 130 / 52 = 5,000 µs
- Left mono reads 33: 2,000 × 130 / 33 = 7,879 µs, set to the nearest 100 µs step at 8,000 µs
How much motion blur does each value cost?
Blur in pixels equals part speed times exposure time divided by the pixel footprint:
A 400 mm wide field on a 1,280-pixel-wide image gives p = 400 / 1280 = 0.3125 mm per pixel. At a belt speed of 100 mm/s:
- Right mono at 5,000 µs: 100 × 0.005 / 0.3125 = 1.6 px of blur
- Left mono at 8,000 µs: 100 × 0.008 / 0.3125 = 2.6 px of blur
Keep blur under roughly 2 px so disparity still finds sharp edges. The left value breaks that budget at 100 mm/s, which sets the decision: raise the left side's illuminance by about 1.6× (52 / 33 = 1.58, so a 60% brighter left view runs 5,000 µs like the right), or slow the belt to 60 mm/s, where the left camera's blur falls to 60 × 0.008 / 0.3125 = 1.5 px.
Aperture moves the same numbers the other way. Closing one stop, f/2.8 to f/4, cuts light to (2.8 / 4)² ≈ 0.49 of what it was, so a camera pinned at 5,000 µs would need about 10,000 µs and its blur would rise to 100 × 0.010 / 0.3125 = 3.2 px. Opening one stop halves the exposure a view needs. Gain doubles brightness exactly as a doubled exposure does but amplifies noise with the signal, so exhaust the blur budget first and step gain only after.
How do you verify the new settings took hold?
Read both exposure values back from their device handles, stream about 200 frames, and check that each camera's mean gray level holds within about ±3 levels frame to frame with the depth frame rate still at 30 fps.
- Read ExposureTime from each handle: 5000 and 8000 µs, matching your writes. Under auto exposure you would instead chase changing values in frame metadata — the frame metadata exposure readout explains that source.
- Compute the per-frame mean gray level of each mono stream. A pinned camera sits flat; a camera still on auto sawtooths between its exposure limits.
- Confirm the depth stream still delivers 30 fps and no frame arrives dark. If values read back correctly but flicker persists, your startup script is re-enabling auto exposure after your writes — a setting-order problem, not an exposure problem.
What goes wrong most often?
The recurring failure is leaving auto exposure active on one mono while pinning the other — the shared base loop still drives both, so brightness keeps hunting — followed by exposure times above the frame period, which drop frames from a 30 fps stream.
- One mono pinned, one still on auto. The base loop wins; set ExposureAuto to Off on both.
- Exposure time over the frame period. Past 33,333 µs at 30 fps, frames clip and depth latencies grow.
- Gain stepped before exposure was exhausted. You paid in noise for brightness the blur budget still allowed as exposure time.
- Compensation left nonzero under manual exposure. It biases nothing you measure anymore; zero it.
- One mono sensor dark on every frame. Stereo depth dies entirely rather than degrading — the missing mono sensor fix walks that diagnosis.
If depth stays noisy after exposure is pinned and both means sit steady, brightness is no longer the suspect; weak texture and the matching stage take over, which the noisy stereo disparity troubleshooting guide follows from there.
When does auto exposure still make sense?
Keep auto exposure when ambient light genuinely changes across the day — a loading dock, an outdoor cell — and the part is slow or static; pin both mono cameras manually whenever the lighting is enclosed and fixed, as it is in most inspection cells.
Under auto exposure, cap the damage: set a maximum exposure time below the motion-blur limit with the maximum exposure cap, and hold the brightness target fixed with the brightness target setting. Even then, expect residual flicker — a shared loop balancing two scenes never sits perfectly still. Decision: enclosed lighting, manual; ambient light you cannot control, auto with both caps set.
Should you move to an integrated stereo 3D camera instead?
If the rig is still on the drawing board, an integrated stereo or structured-light 3D camera removes the problem at the source: the sensors ship factory-matched and calibrated, and you control exposure through one device interface instead of balancing two camera handles.
Which integrated cameras fit which depth job?
Integrated depth cameras cover these jobs without any per-camera exposure balancing. Depth over pallets, carton flow or tote dimensions calls for logistics-class structured light or time-of-flight; surface scanning along a programmed path suits a laser galvanometer stereo camera, which steers a laser line with mirrors; the full range sits in the 3D sensors category.
- Type
- Stereo / structured light
- Type
- Stereo / structured light
- Type
- Depth / ToF camera
What makes a good DIY mono pair?
If you assemble the rig from discrete machine-vision cameras instead, choose a matched pair — same sensor, same lens — so both sides respond alike at the same exposure, and compare sensitivity figures from the EMVA 1288 data sheets. For a bench cell where the part is clamped during capture:
- Sensor format
- 1"
- Lens mount
- C-mount
- Interface
- USB3
- Resolution
- 16-25 MP
The MV-CS200-10UM pairs a 20 MP IMX183 sensor with USB3.0, C-mount and mono output.
On a moving belt, a rolling shutter smears the image row by row; select a global-shutter mono pair in the camera finder instead — the area scan camera category groups the whole line. Fire both cameras from one trigger source so the two exposures land on the same instant.
Decision, in one line each. Enclosed lighting and a real belt speed: pin both mono cameras manually — 5,000 µs right, 8,000 µs left in the example, both under the 33,333 µs cap. Ambient light you cannot control: keep auto exposure on both monos and cap its maximum exposure. Buying hardware rather than debugging it: an integrated stereo or structured-light camera ends the balancing act before it starts. To spec either route, start at the camera configurator, send the layout through the quote form and we will check the exposure numbers with you; the 3D vision topic page collects the depth-rig guides around this one.
Questions
Does the color camera share auto exposure with the mono pair?
In the common two-mono-plus-color rig, no: the shared statistics serve the mono pair that feeds disparity, while the color sensor runs its own exposure loop. If your application compares color against depth — defect overlays, for instance — pin the color camera to a manual exposure as well, using the same frame-period cap and the same trial-and-scale measurement.
How much gain can I add before noise hurts stereo matching?
Treat about two doublings (×4) as the working ceiling. Gain buys brightness in one-stop steps, and each step amplifies noise along with the signal, so the edge contrast that sub-pixel matching depends on fades. Exhaust the motion-blur exposure budget first, then add gain one step at a time and re-check disparity edge quality on a real part.
What exposure cap keeps the depth frame rate from dropping?
Exposure time must stay below the frame period: cap in microseconds = 1,000,000 / frame rate in fps. At 30 fps that is 33,333 µs; at 60 fps it is 16,667 µs. Leave about 10% margin for readout overhead, so a 30 fps rig should pin exposure at or below 30,000 µs.
Do I need to recalibrate the rig after changing exposure?
No. Exposure time and gain change image brightness only; focal length, distortion and the stereo extrinsics are untouched, so the calibration stays valid. What changes is matching quality, so re-run a depth check on a known part: if badly exposed frames once produced wrong depths there, the cause was exposure, not calibration.
Does a laser profiler have the same base-camera problem?
No. A laser profiler builds its height image from a projected laser line on a single sensor, so there is no second camera and no shared auto-exposure loop to fight; you set exposure once on the profiler itself. The base-camera question only exists where two cameras form the depth image by stereo matching.



