What a camera does

One row for every lamp costs the lamps that lose least

A corner correction fitted under one lamp is right under that lamp and can be badly wrong under another, so a converter unsure of its lamp was offered a single row fitted under several at once. Pooled over four lamps, one row holds every lamp's corner between 1.33 and 1.56 colour differences — no lamp worse than a grey-card map, and none near the 4.91 a wrong row can leave. The price falls on the white LED and the fluorescent tube, which it leaves four times worse than their own rows, because they lose the least red at the corner and the pooled row is built to repair the lamps that lose the most. Two rows, one per class of lamp, keep almost all of both.

Assumes A corner is corrected by one row, The corner of the frame has another filter and Two sensors disagree about deep red, not lines.

A corner is corrected by one row found the correction a short lens’s corner needs. At the corner, light crosses the filter that makes colour possible obliquely and its edge slides from 665 to 646 nm, cutting deep red out of the red channel; a grey-card gain map fixes the grey and leaves colours wrong, and a correction confined to the red row — the centre’s red rebuilt from the corner’s three channels — removes half of what the gain map leaves. But the row depends on the lamp it was fitted under. Fitted under daylight and used under tungsten it did well; fitted under tungsten and used in daylight it left the grey card 9.17 colour differences off and one patch 17.7.

So a converter holding per-lamp rows has to know its lamp, and two sensors disagree about deep red, not lines is one of several essays here on how hard that is. The earlier essay ended on the obvious hedge. A row fitted on charts photographed under several lamps together would trade some accuracy under each lamp for robustness under all, and the tungsten row’s failure suggested where the trade would lie: a daylight chart in the fit would pin the blue coefficient a tungsten chart leaves free.

Both halves of that are measured below. The trade is real, and it does not fall where the trade suggests.

A pooled row is safe and expensive in one place

One red row pooled over daylight, tungsten, a white LED and a fluorescent tube leaves every lamp’s corner between 1.33 and 1.56 colour differences at 25 degrees — below a grey-card map under every lamp, and far below the 4.91 a wrong per-lamp row can leave. Its cost falls on the LED and the tube: four times their own rows, and worse than their own gain maps. Those two lamps lose the least red at the corner, and their rows are interchangeable, so the only lamp question that matters is smooth or structured — and one row per class keeps almost everything.

  • Pooled over four lamps, the row leaves 1.33, 1.45, 1.39 and 1.56 under daylight, tungsten, the LED and the tube; the daylight gain map leaves 1.86 to 3.28.
  • The LED’s own row leaves 0.36 and the tube’s 0.37; the pooled row multiplies each by about four. It multiplies daylight’s and tungsten’s by 1.4 and 1.5.
  • At the corner the LED loses 4.1 per cent of its red and the tube 4.5, against 10.1 for daylight and 15.3 for tungsten.
  • The LED’s row and the tube’s are interchangeable: 0.36 and 0.38 on each other’s frames. Daylight and tungsten are not: daylight with tungsten’s row leaves 4.91.
  • A row pooled over each class matches the structured lamps’ own rows and costs the smooth lamps about a quarter, and beats the four-lamp pool unless the class is misjudged more than 12 to 16 per cent of the time for a smooth lamp.
  • Off the chart, pooling mends the tungsten row: 2.24 against its own 3.25, the worst surface 4.4 against 11.6.

Four corrections under four lamps

Four ways to correct the corner, under each of four lamps, at 25°The mean colour error left on the chart's coloured patches at the corner of the frame, under each lamp, after: the red row fitted under that lamp; one red row fitted on the chart under all four lamps with the grey held under daylight; a grey-card gain map calibrated under daylight; and the worst of the other lamps' rows used by mistake. daylight: 0.93, 1.33, 1.86, 4.91; tungsten: 0.99, 1.45, 1.87, 3.26; white LED: 0.36, 1.39, 3.28, 1.77; fluorescent: 0.37, 1.56, 3.09, 2.45. The pooled row holds every lamp between 1.33 and 1.56.its own rowone row for all foura grey-card mapworst wrong rowdaylight0.931.331.864.91tungsten0.991.451.873.26white LED0.361.393.281.77fluorescent0.371.563.092.45mean ΔE₀₀ on the chart's coloured patches, corner against centre25° at the cornera modelled sensor, not a datasheet
Fig. 1 Four ways to correct the corner of a frame at 25°, under each of four lamps.

The figure is the comparison at 25 degrees, the corner of a typical phone lens. Under each lamp there are four bars: the lamp’s own row, the row pooled over all four lamps with the grey card held exact under daylight, a grey-card gain map calibrated under daylight, and the worst of the other three lamps’ rows used by mistake.

The pooled row’s bars are the most even in the figure: 1.33, 1.45, 1.39, 1.56. Nothing else is. The gain map runs from 1.86 under daylight to 3.28 under the LED, and the worst wrong row from 1.77 under the LED to 4.91 under daylight. If the converter has no idea which lamp it is under, the pooled row is the correction that guarantees the most, which is what the hedge was for.

Against the lamp’s own row, the picture splits in two. Under daylight and tungsten, the pooled row costs 43 and 46 per cent more than the lamp’s own row. Under the LED and the tube it costs 286 and 322 per cent more. The pooled row, at 1.39 under the LED, is worse even than the LED’s own grey-card gain map, 0.80: for a white LED, a converter would be better off with no shape correction at all than with the pooled one.

Why the price falls where it does

The row rebuilds the red the corner lost, and how much there is to rebuild depends on how much of the lamp’s red sits in the band the moved edge cuts.

The corner's red row, per lamp and pooled, at 25°. The three numbers that rebuild the centre's red reading from the corner's red, green and blue: each lamp's own row, the rows pooled over the two smooth lamps and over the two structured lamps, and the row pooled over all four. On the right, the share of the red channel the corner loses under each lamp. The structured lamps lose 4.1 and 4.5 per cent and their rows barely reach into green and blue; tungsten loses 15.3 and its row leans hardest. The row pooled over all four, 1.40, -0.48, 0.29, is pulled most of the way to the smooth lamps'.
Fig. 2 The corner’s red row — the centre’s red as a combination of the corner’s red, green and blue — fitted under each lamp, pooled within each class of lamp, and pooled over all four; with the share of red the corner loses under each lamp.

Tungsten, glowing most strongly in the deep red, loses 15.3 per cent of its red reading at the corner; daylight loses 10.1. Their rows lean hard on the other channels — tungsten’s takes 1.49 of the red, subtracts 0.67 of the green and adds 0.63 of the blue — because there is a lot to put back and the other two channels are the only place to find it. The LED and the tube lose 4.1 and 4.5 per cent: their red is a phosphor band that has fallen away well before 650 nm, or lines near 610 to 630, most of it inside the moved edge, and their rows barely leave the identity at 1.16, −0.18 and 0.13.

The row pooled over all four is 1.40, −0.48 and 0.29. It sits among the smooth lamps’ rows, between daylight’s and tungsten’s, because a least-squares fit is pulled by the lamps with the largest residuals to remove and those are the lamps losing the most. Applied under an LED it puts back red that was never lost, which is exactly the fourfold cost in the figure above.

So the pooled row is not a compromise that shares its error evenly. It is the heavy correction a heavy loss needs, applied to lamps with a light loss. The trade the earlier essay expected — some accuracy under each for robustness under all — is lopsided: under half again from the lamps that needed a large correction, three to four times over from the lamps that needed a small one.

Only one lamp question matters

A converter with per-lamp rows has four to choose between, and the cost of choosing wrong depends on which two rows are confused.

Each lamp's corner row used under every lamp, at 25°. Rows: the lamp a frame is taken under. Columns: the lamp whose red row is applied. Each cell is the mean colour error left on the chart. The diagonal is each lamp's own row. The white LED's and the fluorescent tube's rows are interchangeable — 0.36 and 0.38 on each other's frames against 0.36 and 0.37 on their own — while daylight with tungsten's row leaves 4.91. The two boxes are the classes a classifier of smooth and structured lamps would choose between.
Fig. 3 Each lamp’s corner row used under every lamp: rows are the lamp a frame is taken under, columns the lamp whose row is applied. Boxed: rows from the same class of lamp.

Inside the structured class, the choice costs nothing. The LED’s row on a tube frame leaves 0.38, the tube’s row on an LED frame 0.36, and each lamp’s own row 0.36 and 0.37. Two lamps that lose the same small share of red in the same place need the same small correction. Inside the smooth class it costs a great deal in one direction: tungsten’s row under daylight leaves 4.91, while daylight’s under tungsten leaves 1.18. Across the classes it costs 1.6 to 3.3 in every cell.

That makes the lamp question a converter needs answered smaller than four ways. Daylight and tungsten differ in colour temperature by about 3,600 kelvin, which a white balance reads without difficulty. The LED against the tube does not matter. What remains is whether the lamp is smooth or structured — whether its spectrum is a continuum or has lines and gaps — and that is precisely the question a white balance cannot answer, because three numbers cannot see a line. It is the question the three essays on ambient sensors and flicker were written about.

A row for each class

If only the class matters, the natural arrangement is two rows: one pooled over the smooth lamps, with the grey held under daylight, and one pooled over the structured lamps, with the grey held under the LED.

A row for each class of lamp, against one row for all. Under each lamp, the mean colour error at the corner after its own row, after the row pooled over its class — smooth for daylight and tungsten, structured for the LED and the tube — after the row pooled over all four, and after the other class's row, which is what a misclassified frame gets. daylight: 0.93, 1.18, 1.33, 2.11; tungsten: 0.99, 1.21, 1.45, 3.19; white LED: 0.36, 0.35, 1.39, 1.65; fluorescent: 0.37, 0.37, 1.56, 1.86.
Fig. 4 Under each lamp, the corner’s mean error after its own row, its class’s pooled row, the row pooled over all four lamps, and the other class’s row — what a misjudged frame receives.

The structured row is the structured lamps’ own row: 0.35 under the LED and 0.37 under the tube, where their own rows leave 0.36 and 0.37. The smooth row costs its lamps about a quarter: 1.18 under daylight against 0.93, and 1.21 under tungsten against 0.99. Under every lamp the pair leaves less than the four-lamp pool — between 11 and 76 per cent less.

The fourth bar is what a mistake costs: the other class’s row, 2.11 and 3.19 for the smooth lamps and 1.65 and 1.86 for the structured. That is where the pair gives back what it gained, and whether it gives back more than the four-lamp pool would have cost depends on how often the class is misjudged.

How often the classifier must be right

What a class pair costs as its classifier errs, against one row for all. For each lamp, the expected mean colour error at the corner when a converter holds one row per class and picks the wrong class with the probability across the axis (solid lines), against one row pooled over all four lamps (dashed, flat). Where a solid line crosses its dashed one, the pair stops being the better choice: daylight at 16 per cent, tungsten at 12 per cent, white LED at 80 per cent, fluorescent at 80 per cent. The smooth lamps need their class judged right at least 84 per cent of the time; the structured lamps, 20 per cent.
Fig. 5 Expected corner error under each lamp as the chance of misjudging the frame’s class rises from nought to one (solid), against the row pooled over all four lamps (dashed); dots where the pair stops being the better choice.

The expected error of the pair is a straight line from its own class’s row at a perfect classifier to the other class’s row at a classifier that is always wrong. The four-lamp pool is flat. Where they cross is the misjudgement rate at which one row for all becomes the better choice: 16 per cent for daylight, 12 for tungsten, and 80 for both structured lamps.

The asymmetry is the same lopsidedness as before, seen from the other side. For a structured lamp, the pair’s right answer is so much better than the pool, and the pool so much worse than its right answer, that almost any classifier will do. For a smooth lamp the pair gains only a quarter of a unit by being right and loses one to two by being wrong, so it needs a classifier that is right 84 per cent of the time under daylight and 88 per cent under tungsten.

Eighty-eight per cent is well within what the ambient-sensor classifiers managed on the lamps they were tested on — a narrow channel has to be read on its own found one reading a single narrow channel alone that sorted fourteen lamps without a mistake through four per cent of calibration error. Whether it holds on lamps outside that set is the open question those essays left, and it is the one this choice inherits.

Off the chart

Every number above is measured on the chart the rows were fitted on, and the earlier essay found that the tungsten row’s worst failure was off it: on twenty-four surfaces more saturated and narrower-banded than the chart’s, it lost to a gain map, with one surface 11.6 colour differences off.

The same corrections on surfaces the chart does not contain. The mean colour error at the corner, at 25°, on twenty-four surfaces more saturated and narrower-banded than the chart's, under each lamp: after the lamp's own row, the row pooled over its class, the row pooled over all four lamps, and the lamp's own grey-card map; the worst surface in brackets. Under tungsten the own row leaves 3.25 with a worst of 11.6, the class row 2.13, the row pooled over all four 2.24 with a worst of 4.4, and the gain map 2.32. Under every lamp the class row leaves less than the row pooled over all four.
Fig. 6 The same corrections on twenty-four surfaces the chart does not contain, under each lamp, with the worst surface in brackets.

Pooling mends it. Under tungsten, on the held-out surfaces, the row pooled over all four lamps leaves 2.24 with a worst of 4.4, against tungsten’s own row at 3.25 and 11.6 and its gain map at 2.32. The class row does better still, 2.13. The earlier essay’s diagnosis was that a tungsten chart’s blue readings spread too little to pin the row’s blue coefficient, which the fit then used to chase the chart’s own quirks; the pooled row’s blue coefficient is 0.29 against tungsten’s 0.63, and the class row’s 0.23. A daylight chart in the fit set pins the coefficient, as predicted.

Under the other three lamps the held-out surfaces rank the corrections as the chart did: each lamp’s own row best, the class row close behind — 1.12 and 1.07 under the LED and the tube against their own 1.16 and 1.06 — and the four-lamp pool worst, at around two. So the class pair is the only arrangement that is never the worst of the three rows, on the chart or off it.

The split at every angle

The corner at 25 degrees is one position. A lens’s corner runs from the centre to 35 degrees at the far diagonal, and a converter holds a correction at every position.

The pooled row's cost over each lamp's own row, from 10° to 35°. For each lamp, the mean error the row pooled over all four lamps leaves at the corner, divided by what the lamp's own row leaves, at six angles. Daylight and tungsten stay between 1.37 and 1.59. The LED and the tube start at 4.5 and 5.2 and fall to 3.3 and 3.2, because their own rows' error grows faster with the angle than the pooled row's.
Fig. 7 The row pooled over all four lamps, as a multiple of each lamp’s own row’s error, from 10 to 35 degrees.

Daylight and tungsten stay between 1.37 and 1.59 times their own rows at every angle. The LED and the tube start at 4.5 and 5.2 times at 10 degrees and fall to 3.3 and 3.2 at 35. Their own rows’ error grows faster with the angle than the pooled row’s does — the LED’s own row goes from 0.05 to 0.84, a factor of seventeen, and the pooled row from 0.21 to 2.78, a factor of thirteen — so the multiple shrinks, but it never falls below three. The split between the classes is a property of the lamps, not of one position.

What a converter would hold

Two rows per position, not one and not four. One row pooled over the smooth lamps with the grey held under daylight, one pooled over the structured lamps with the grey held under an LED, and a class decision from whatever the camera has — an ambient sensor, a flicker reading of the kind flicker sorts lamps the wrong way tested, or metadata — with the white balance left to choose within the class as it already does. On this model’s four lamps the pair is within a quarter of each lamp’s own row, better than the four-lamp pool everywhere on the chart and off it, and it needs its class decision right 84 to 88 per cent of the time on smooth lamps and 20 per cent on structured ones.

If no class decision is available, pool over all four — but know that the cost is paid in the kitchen and the office, under exactly the LED and fluorescent light most photographs are now taken in, and that for those frames the pooled correction is worse than no shape correction at all.

How the rows were fitted

The sensor is the modelled silicon camera whose corner the two earlier essays measured: its own sensitivities with the infrared-cut filter’s transmittance exchanged for the one at the stated angle, the edge moving as the cosine of the refracted angle through a stack of effective index 1.8. The chart is twenty-four coloured test surfaces at a chroma of 0.55 and a grey scale; the held-out set is twenty-four surfaces at a chroma of 0.85 with narrower bands. The four lamps are D65 daylight, a 2856 K tungsten radiator extended into the infrared, a phosphor white LED and a fluorescent tube.

A pooled row is a least-squares fit of the centre’s red reading to the corner’s three readings, over the chart photographed under each lamp in the pool, with each lamp’s chart scaled so its grey reads one in green at the centre, so that no lamp counts by its brightness. The row’s three numbers are then scaled together so the grey card comes out exact under the stated lamp. Errors are ΔE₀₀ between the centre’s rendering and the corrected corner’s, through the pipeline fitted at the centre under the lamp in use — the per-lamp matrix a matrix is fitted under one light priced.

What this leaves out

Four lamps are two of each class. A real converter meets warm and cool LEDs, LEDs with red phosphors, high-rendering LEDs with a filled cyan region, and tubes of several phosphor sets, and a lamp is not a blackbody describes how different their spectra are. The finding that structured lamps’ rows are interchangeable is a finding about two lamps whose red is similar; an LED with a deep-red emitter would lose more red at the corner and sit between the classes.

The pooled row is weighted equally over lamps. Weighting by how often a converter meets each lamp would pull the four-lamp pool towards whichever lamps are commonest, and on today’s photographs that is towards the structured ones. That would narrow its cost there and widen it under daylight; it would not remove the lopsidedness, which comes from the difference in red loss.

And the classifier’s misjudgements are treated as independent of the frame. A real classifier errs on particular lamps, and a lamp that is misjudged every time is not described by a rate.

Still open: whether the class boundary is a red boundary

The two classes worked here because the smooth lamps lose a lot of red at the corner and the structured lamps lose a little. That coincides with smooth and structured on these four lamps, but it is not the same property — in the way two sensors disagree about deep red, not lines found an ambient sensor’s classifier reading deep red when it was built to read structure.

The prediction is that the right class boundary for a corner correction is the share of red a lamp loses at the corner, and that an LED with a deep-red emitter — structured, but losing as much red as daylight — wants the smooth row, not the structured one. If that is right, a class decision made by a structure classifier is the wrong input for the corner, and the converter should instead estimate the lamp’s red loss directly: the ratio of the corner’s red reading to the centre’s on a neutral region, which a frame carries in any case. The computation is this one with a red-emitter LED and a daylight with its deep red trimmed by glazing added, the rows pooled by red loss rather than by class, and the misjudgement rates recomputed for a classifier that reads red loss instead of structure.

A hedge is paid for by whoever needed least

The habit is about where the cost of a compromise lands.

A correction fitted to several conditions at once looks like an average of the corrections each would want, and an average looks fair — each condition gives up a little. A least-squares fit is not an average of conditions. It is pulled by the conditions with the most to correct, and a condition with little to correct receives the correction the others needed. Here that turned a hedge against an uncertain lamp into a fourfold loss on the two lamps whose correction had been nearly free.

The failure mode is to judge a pooled fit by its worst case alone. The four-lamp row’s worst case was the best of any arrangement, and it was bought by making the two best cases four times worse. The move is to look at the pooled fit’s cost lamp by lamp against each lamp’s own fit, find which conditions pay, and ask what distinguishes them — here, how much of their red the corner removes — because that is usually the variable a better partition should be drawn on.

Named alongside this one

Essays reaching for the same objects. Nobody chose these; they are what the index of named objects makes visible.

The objects this essay names

Each one links to every other essay that touches it.

CalibrationCamera rawColour matrixHeld-out validationIlluminantInfraredLeast-squaresLED emissionSpectral sensitivityWhite balance