3D visionHow-to

3D camera 2D stream settings: exposure, iris and gain defaults

How to pick 2D stream settings on a 3D camera: 10 ms exposure, iris 35, raised gain, brightness target in range; defaults that avoid a saturated image.

LumaSpec Vision10 min 读取 分享到LinkedIn

在此页面上 10 部分
  1. 01Start here: defaults chosen for a reason
  2. 02Why 50 ms saturates a normal scene
  3. 03What you need on the bench
  4. 04The procedure, step by step
  5. 05Worked example: static bench, then conveyor
  6. 06Exposure, iris or gain: which knob first
  7. 07Checks before you commit
  8. 08When these defaults are the wrong answer
  9. 09Thirty-second checklist
  10. 10Questions

A 3D camera earns its keep on depth, but the 2D color stream still has to look right, and the settings in the sample code rarely do. Defaults around 50 ms exposure with iris 50 saturate an ordinary indoor scene at about a metre: bright surfaces clip to white, color washes out, and the long exposure holds the stream under 20 fps. This procedure gives you a better starting point — 10 ms with the iris stepped down to 35, gain used last — and a halving rule that reaches a clean histogram in two or three moves. It works on any 3D camera that exposes manual exposure, gain and iris controls on its 2D stream.

Start here: defaults chosen for a reason

Sample code exists to prove the API call runs, not to produce a good picture, so replace its numbers with ones picked for the scene:

Control Typical sample default Start here What it buys
Exposure time 50 ms 10 ms Five times less charge; nothing clips; 100 fps ceiling
Iris 50 35 Smaller aperture; deeper sharp range
Gain floor raise last Brightness back; noise is the price
Brightness target 1.8 0.45 on 0–1; 1.8 on 0–4 45 % of scale leaves highlight headroom
Mode auto manual, locked Grey values hold frame to frame

Ten milliseconds at iris 35 is the right first guess for an indoor scene at about a metre: readable, clear of clipping, and short enough for any frame rate you would actually run. The histogram then tells you which way to move and by how much. The 3D sensors range spans structured light, stereo, galvanometer and ToF designs, and this tuning procedure is the same on any of them that expose manual controls on the 2D stream:

3D sensorsHikrobot MV-DPS200P-02 Projected structured-light 3D cameraMV-DPS200P-02
Type
Stereo / structured light
$8,829.00 · quotedView and quote
3D sensorsHikrobot MV-DT01WMU ToF sensing cameraMV-DT01WMU
Type
Depth / ToF camera
Price on requestView and quote

Why 50 ms saturates a normal scene

Charge on a pixel is light times time, and grey value follows charge until the pixel fills. Work it from the baseline above: a surface reading grey 115 there reads 115 × 50 / 10 = 575 at 50 ms, and the pixel clips at 255 long before that. Turned around, at 50 ms every surface brighter than grey 51 at the reference exposure is clipped. That is why the default picture looks washed out on anything but a dark scene.

grey_new ≈ grey_old × t_new / t_old fps_ceiling ≈ 1000 / exposure_ms blur_mm = speed_mm_per_s × exposure_ms / 1000

The three lines are the whole budget. Grey scales with exposure time until clipping. A 50 ms exposure cannot deliver more than 1000 / 50 = 20 fps, which is why a stream configured for 30 fps arrives slower — depth camera frame rate drops when exposure settings cap the FPS covers that failure. And blur is speed times time, paid in millimetres on a moving part.

Gain sits outside the budget because it creates no charge: it scales the sensor readout, signal and noise together, after the fact. Where analog gain sits in the camera pipeline shows why that ordering matters once you push it.

What you need on the bench

  • The camera, mounted where it will run, with the scene lit as it will run.
  • A viewer or a short script that shows the histogram and the mean grey value.
  • The part speed, if the part moves.
  • The control ranges, read from the device.

Query every range before writing any value. Exposure, gain, iris and the brightness target each carry a minimum, maximum and step the camera defines, and a value outside that range is rejected or clamped. Querying the option range before setting exposure or gain shows the call.

One caution for the bench: the projector window on a structured-light or ToF camera is a laser source, so keep eyes out of the beam and follow the laser-class label on the housing.

The procedure, step by step

  1. Query the ranges for exposure, gain, iris and brightness target, and plan values inside them. A rejected setting usually surfaces as an error on the next capture — diagnosing rejected color-stream exposure settings lists the patterns.
  2. Switch the 2D stream to manual: auto exposure off, gain at its floor, exposure at the table's starting value, iris 35. Move one control at a time from here.
  3. Read the histogram. Count pixels at 250 or above, 8-bit. If more than about 0.5 % of the frame clips, halve the exposure and look again: 5 ms, then 2.5 ms. Two halvings clear almost every overexposed indoor scene.
  4. Set brightness with gain. Raise gain until the mean sits near 115 — 45 % of scale, headroom above. Each 6 dB of gain doubles the level, and the noise doubles with it.
  5. Cap for motion before anything else if the part moves: compute the exposure ceiling from the blur budget, then run steps 3 and 4 down from that ceiling. The arithmetic is in the worked example below.
  6. If you hand control back to auto, steer it with the brightness target at 45 % of the range: 1.8 on a 0 to 4 range, 0.45 on a 0 to 1 range, passed as a float. Why integer values get rejected on a 0 to 1 brightness range explains the failure mode, and setting an auto-exposure brightness target the practice.
  7. Write the four values into your startup code and apply them explicitly after the camera opens, every run. Camera settings saved but not applied at open is the classic way a good bench tune disappears in production.

Worked example: static bench, then conveyor

Static scene. Camera at 1.00 m, ordinary indoor lighting, iris 35, gain at the floor. At the starting exposure the mean grey reads 235 with 4 % of pixels at 255 — overexposed. Halve once: 235 × 5 / 10 = 118, and the clipped fraction falls to zero. Final settings: 5 ms, iris 35, gain 0 dB.

Moving part. Same camera and lighting, but the part rides at 250 mm/s and the 2D stream covers 600 mm across 1280 pixels: 600 / 1280 = 0.47 mm per pixel. Allowing one pixel of blur sets the exposure ceiling: 0.47 mm ÷ 250 mm/s = 1.9 ms. From the static baseline the mean falls with time: 235 × 1.9 / 10 = 45. Lifting 45 to about 115 needs a factor of 2.6, which is 6 × log2(115 / 45) ≈ 8 dB of gain — or 2.6 times more light on the part. The fps ceiling at 1.9 ms is 1000 / 1.9 ≈ 530, so a 30 fps stream is nowhere near limited.

Decisions from those numbers: static and bright, start at the table value and halve once if the histogram says so; static and dark, grow exposure toward the frame period (33 ms at 30 fps) before adding gain; moving, pin exposure to the blur budget and pay with gain or light; tall part needing sharp near and far edges, close the iris and pay the same way.

Exposure, iris or gain: which knob first

You need Turn first The price
Less clipping Halve exposure A darker image, regained with gain
Brighter image, static part Double exposure The fps ceiling halves
Brighter image, moving part Gain, or light Noise, or a lighting change
Deeper sharp range Close the iris, 35 toward 21 Light lost, repaid with gain
Stable grey values Manual, locked None — do it anyway

On these cameras a lower iris value is a smaller aperture: less light, more depth of field. If your model reverses the convention, stepping the control while watching the image settles the direction in seconds. Closing from 35 toward 21 keeps both edges of a tall part sharp in the 2D picture, and the grey value you give up comes back as gain. Automatic iris, exposure and gain control and auto exposure versus iris control cover how those loops interact when more than one runs automatically. The same exposure–gain budget on plain 2D cameras is worked through in industrial camera image quality settings.

Checks before you commit

  • Histogram: under 0.5 % of pixels at 250 or above; mean between 100 and 130.
  • Noise: standard deviation below about 6 grey levels on a flat patch. Above that, trade gain back for exposure, iris or light.
  • Delivered fps with color and depth running together: color stream fps lower than configured and three depth cameras dropping to low fps cover the bandwidth reasons a stream arrives slow.
  • Depth untouched: projector exposure is a separate parameter with its own procedure, manual IR gain tuning for near range.
  • Every setting re-applied in code at open, and a capture saved from the final state for the commissioning record.

When these defaults are the wrong answer

A dark booth changes the order. At 30 fps the frame period is 33 ms, so exposure has room to triple before it costs frame rate; take that first, gain second, and treat added light as the real fix.

A tall part in tight clearance flips the iris decision: close toward 21, accept the gain, and check noise on a flat patch rather than guessing.

A model with no manual 2D controls cannot run this procedure at all — filter for the controls you need in the camera finder before shortlisting.

And if depth never enters the job, one plain camera with manual controls is the simpler system:

Area scan camerasHikrobot MV-CS200-10GC 20 MP Area Scan Camera, GigE, IMX183, Color, BasicMV-CS200-10GC
Sensor format
1"
Lens mount
C-mount
Interface
GigE
Resolution
16-25 MP
$739.00View partBuild a system with it

The MV-CS200-10GC is a 20 MP GigE camera with a 1-inch sensor and C-mount, so the whole exposure, gain and iris toolkit applies with no depth stream sharing the budget. Browse area scan cameras for the sensor and mount that fit instead.

Thirty-second checklist

  • Ranges queried; every planned value inside them.
  • Manual mode: starting exposure, iris 35, gain at floor.
  • Clipping under 0.5 %; mean near 115.
  • Blur budget met if the part moves.
  • Color and depth both at full fps together.
  • Values written into startup code, applied at open.

Set the numbers, read the histogram, lock the result in code. When the camera choice itself is still open, start a build at the camera step:

Build the whole station

The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.

Start with the camera

问题

Why do 50 ms defaults saturate the 2D image at one metre?

Because grey value follows collected charge, and charge scales with time. A scene that sits well-exposed at the starting time with iris 35 receives five times that charge at 50 ms, so every surface brighter than grey 51 at the reference clips at 255. The crossover moves with lighting and aperture: more light or a wider iris shifts it down, a darker booth can make even the shorter value the saturating one. The histogram, not the number, is the arbiter.

Does changing the 2D exposure affect the depth stream?

Quality, no: the projector or laser exposure that sets depth noise is a separate parameter with its own range, and the 2D numbers leave it alone. Two indirect paths remain. A very long 2D exposure caps that stream's frame rate, and color plus depth together share interface bandwidth, so the delivered fps of both can drop. Set depth exposure for the surface, 2D exposure for the picture, then check rates with both streams on.

What brightness target replaces 1.8 when the range is 0 to 1?

Scale it to the range the camera reports. 1.8 on a 0 to 4 range is 45 % of full scale, so the equivalent on a 0 to 1 range is 0.45 — both aim the loop near grey 115 at 8 bits. Pass the value as a float: integer values are rejected outright on a 0 to 1 range, and a query of the range before writing tells you which scale you are on.

How much gain is too much on a 2D stream?

Measure it, do not eyeball it: take the standard deviation of a flat, evenly lit patch. Below about 6 grey levels at 8 bits, noise rarely disturbs color judgment or edges; above it, something else should pay for the brightness — exposure time if blur allows, the iris if depth of field allows, light if neither does. Gain restores level one-for-one with noise, which is why it is the last knob, not the first.

Should auto exposure stay on for the 2D stream?

Leave auto on for walkthrough views where lighting genuinely changes and nobody measures pixels. Switch to manual for anything keyed to grey values — color comparison, presence checks, OCR — because the loop drifts exposure frame to frame and drags your thresholds with it. In auto, steer with the brightness target at 45 % of range; in manual, lock all four settings at open and keep them in code.