No jobs
Core 11 min 2 of 5

Exposure is a decision, not a measurement

A darker picture is a gain the camera chose, from a weighted average of the frame you never saw.

What this repairs

Reading a darker image as a darker world, when the camera chose a gain from a metering rule that was never recorded alongside the image.

Exposure is a multiplier. The sensor stage forms a gain gg and multiplies the scene signal by it before anything is counted, and every stop of exposure is one doubling of gg — which is why exposure is quoted in EV at all: the quantity people reason about is logarithmic even though the sensor is strictly linear.

Where the gain comes from is the interesting part. With auto-exposure enabled, the camera meters the frame — forms one weighted-average luminance — and picks the gain that would move that average onto a target. The default target is 0.180.18 , middle grey, in linear light. So the delivered brightness of an image is a statement about the metering rule, and only indirectly about the scene.

How the gain is resolved

  1. gauto=LtargetLmeterg_{\text{auto}} = \frac{L_{\text{target}}}{L_{\text{meter}}}

    The metered gain: whatever multiplier puts the weighted-average luminance on the target. On its own this blows out any scene with a bright region.

  2. ghl=Lhl-targetP98.5(L)g_{\text{hl}} = \frac{L_{\text{hl-target}}}{P_{98.5}(L)}

    The largest gain that keeps the highlight percentile below its target, with p98.5 chosen so that a handful of specular pixels do not veto the exposure of the whole frame.

  3. gautoexp((1p)lngauto+plnghl),gauto>ghlg_{\text{auto}} \leftarrow \exp\big((1 - p)\ln g_{\text{auto}} + p \ln g_{\text{hl}}\big), \qquad g_{\text{auto}} > g_{\text{hl}}

    Highlight protection, and the load-bearing detail: the two candidates are blended in log space, not clamped. At p = 0.5 the result is the geometric mean of the two gains.

  4. g=clip(gauto2EVgmanw,  gmin,gmax)g = \operatorname{clip}\big(g_{\text{auto}} \cdot 2^{\text{EV}} \cdot g_{\text{man}}^{\,w},\; g_{\min},\, g_{\max}\big)

    Then exposure compensation, which brightens for positive EV here; then the manual gain entering as a power, so w = 0 ignores it and w = 1 multiplies it in whole; then the only hard clamp in the chain.

  5. ISO=clip ⁣(ISO0(gautoa) ⁣k ⁣,  ISOmin,ISOmax)\text{ISO} = \operatorname{clip}\!\left(\text{ISO}_0 \left(\frac{g_{\text{auto}}}{a}\right)^{\!k}\!,\; \text{ISO}_{\min},\, \text{ISO}_{\max}\right)

    And separately, the gain pressure resolves an ISO — floored so that a gain below the activation point a does not lower ISO. This is the line that turns a dark scene into a noisy image rather than a dark one.

The meter's weighting is the other half of the decision, and the modes differ in exactly one thing — which pixels are allowed to count:

  • Average — every pixel counts equally. Fails on any frame with sky in it, because the sky is the brightest and largest thing and the subject is not.
  • Centre-weighted — a Gaussian bump over the frame, σ\sigma about a third of the extent, blended with the flat average rather than replacing it. The blend matters: at a centre weight of 0.550.55 the corners still contribute, so a bright corner is discounted, not ignored.
  • Fog-aware centre-weighted — the same field, further down-weighted where the sky mask is set, where the fog opacity is high, and where the depth is large. This is the mode the fog pipeline uses, and it is the coupling point with the next topic.

Written as a per-pixel weight, the centre-weighted blend is (1w)/N+wgi/jgj(1 - w)/N + w\,g_i/\sum_j g_j , which is what a metering heat map should draw. Note that no pixel ever reaches zero weight while w<1w < 1 .

Check yourself

Two frames of the same street differ by a stop in mean brightness. What can you conclude about the two scenes?

Show answer

Almost nothing, until you know the gain. A stop of difference is exactly what you get from the metering rule reacting to a bright van entering the frame, or from the highlight protection binding in one frame and not the other, with the illumination unchanged. The scene-level questions — was it darker, was there fog — are answered by the resolved gain and ISO alongside the pixels, not by the pixels. If those were not recorded, the honest answer is that the information was thrown away in the camera.

Euler View - ML Experiment Monitor