Uneven Light
Last time I looked at how AE decides the amount of light, through the frame of the two seats. But an amount being settled doesn't mean that light lands evenly across the frame. The edges receive less light than the center, and sometimes light of a different color. This installment looks at that unevenness, lens shading, through the same frame.
Lens shading refers both to the phenomenon, in which the amount and color of light vary by position as light passes through the lens and sensor, and to the correction that flattens it back out. Photograph the same white surface and the center comes out bright while the edges come out dark, the center neutral while the edges are faintly tinted. Lens shading correction fills in this positional mismatch so that a single light looks the same everywhere in the frame.
What Lens Shading Decides
The mismatch it addresses runs along two strands: light falling off toward the edges (luminance shading), and the color of the light shifting by position (color shading).
Luminance shading is also called vignetting. Light passing through the lens at an angle to reach the sensor's edges is diminished compared to light entering straight at the center. On top of optical falloff, when the angle at which the lens bends light diverges from the angle at which a pixel accepts it, the edges gather less light. So even a uniform surface darkens from center to edge.
Color shading is trickier. Light striking the edges at an angle passes through the infrared cut filter at a different angle, and that filter's transmission characteristics vary with angle, so the color at the edges shifts slightly. The behavior of the microlens and color filter above each pixel is also sensitive to the angle of incidence. So white that was neutral at the center takes on a faint green or magenta tint at the edges.
Correction is a matter of multiplying by a different gain at each position. The frame is divided into a grid, a surface of positional gains (a gain map) is built for each of the R, G, and B channels, and multiplying by that surface lifts the darkened edges and pulls the tinted color back to neutral. The map is built by photographing a uniform white surface under uniform light and measuring how it actually darkens and how it actually shifts. Measurement → gain map → correction → switching surfaces per illuminant. That is the skeleton of lens shading.
The Core Is Fixing the Camera, Not the Scene
Within that skeleton, what most reveals lens shading's character is that what it fixes is not the scene.
AE responds to how bright the scene is. White balance, coming later, responds to what light the scene sits under. Both follow the world outside. Lens shading is different. The edges are dark and tinted not because of the scene but because of how this camera's lens and sensor take in light. Whatever you photograph, that mismatch is stamped onto every frame in nearly the same shape. Lens shading correction doesn't fix the scene. It erases the mark the camera leaves on every photograph it takes.
So this work is unit-specific. The shape of the mark, which regions darken by how much and which edges shift in which direction, comes out of the lens, the sensor, the infrared cut filter, and the alignment where they meet, and that combination differs slightly from module to module. That said, the mark isn't entirely fixed. Color shading varies with the color of the light. The edge tint under daylight is not the same as the tint under incandescent, so when the light changes the shape of the mark changes too, and a correction fit under one light doesn't quite fit under another. It is the camera's own problem, and yet it remains tethered, by one thread, to the light outside.
In the Two Seats, This Work Diverges
The two seats grip the work of measuring and flattening this mark from different ends.
In the ISP seat, the asset is the shading algorithm itself. What model represents the surface of positional gains (a grid, or a radial function), how many reference illuminants the differing surfaces are measured at and how the space between them is filled, which surface gets selected in real time, and how that selection interlocks with the estimate of the light's color. These are the handles this seat moves. But this seat does not choose which lens or sensor it will be paired with. Falloff has a different shape from lens to lens, and edge behavior differs from sensor to sensor. That optical mark is a given input, and the model representing the gain surface must be able to hold not one mark but a wide range of them. In this seat, the module's optical characteristics are not a handle you can move but a wall you cannot cross.
In the module seat, that handle and that wall swap places. The shading algorithm is now a given: it arrives with the ISP this module will run on. And the module, already designed and in production with its lens, sensor, and infrared cut filter, is fixed. What can be moved are the surfaces the algorithm leaves open. Under each reference illuminant you photograph a uniform white surface, measure how this module actually darkens and shifts, and seat the gain map (calibration); you decide how many anchor points to place between illuminants; and you bring the residual tint inside the allowed range. The optical mark that one seat cannot cross as a wall, the other measures directly under uniform light and uses as the starting point of the gain map. The same mark is a wall in one seat and a handle in the other.
So "It Went Well" Means Different Things
Both seats share the goal of passing spec. What diverges is what each protects beyond it.
What the ISP seat protects is breadth. A shading algorithm that flattens the mark of one lens and one sensor isn't enough. It has to hold optical systems with differently shaped falloff in a single model, fill the space between illuminants smoothly, stay stable where it interlocks with the estimate of the light's color, and offer a clean calibration interface where the integrating side can seat its own module's surfaces. Only then does that algorithm get chosen again on the next project. In this seat, lens shading "going well" is closer to a generality reused across optical systems.
What the module seat protects is repeatability. This one module passing its shading spec (uniform brightness across the frame under defined illuminants, residual tint below threshold) isn't the end. In production, slight lens decentering, assembly tilt, and mismatch between the microlens and the chief ray angle (CRA) shake the shape of the mark from unit to unit. Fit the gain map too tightly to a single golden sample and the unit on the next line ships with edges visibly dark or visibly tinted. In this seat, lens shading "going well" is closer to a specificity that repeats on this module.
Before Asking What White Is
Only once lens shading has flattened the frame can we say the frame sits under a single light. And then the next question opens. What color is that light, and what do we call white? What's more, as long as color shading varies with the color of the light, even choosing which surface to apply leans somewhat on knowing what color the light is. The next seat can't be put off.
The seat that measures this module's mark and the seat that catches that mark in a model: I have watched from both sides where the correction surface ends up between them. Next time I move the frame to the color of that light: white balance (AWB).
Top comments (0)