What a camera does

The condition chooses no axes

It has long been said here that a sensor satisfying the Luther condition exactly adapts worse than a silicon one, and offered a reason — that its channels are the matching functions, and a gain on those is the oldest mistake in the subject. The measurement was of one sensor. The condition leaves the axes entirely free.

Assumes A sensor designed for its inverse, Luther said when it would work and Only one of these devices adapts.

Two essays on this site carry a sentence of the form the property that makes a sensor a good colorimeter makes it a bad von Kries observer. The measurement behind it is real and it is a measurement of one sensor. The generalisation is false, and the way it is false is the interesting part.

Four cameras that all satisfy the Luther condition exactly. Four sensors whose sensitivities are linear combinations of the colour-matching functions — the theoretical ideal, satisfying the condition to machine precision, each with an adaptation basis that does not move when the light does. They differ only in which linear combination, which the condition does not constrain, and they leave 2.46, 0.97, 1.65, 2.37 ΔE00 after a white balance. The best of them reaches 0.974, which is the best any basis at all achieves. Being a perfect colorimeter costs nothing in adaptation; what costs is the mixing matrix, and the control measured here carries one nobody chose.
Fig. 1 Four sensors that satisfy the Luther condition to machine precision, differing only in which linear combination of the matching functions they are. Their adaptation figures span a factor of 2.5.

The claim

A Luther-satisfying sensor’s adaptation basis is exactly its mixing matrix, and the condition does not constrain the mixing matrix at all. So a colorimetric camera can have any adaptation basis whatsoever — including the best one there is — with a drift of zero. Four such sensors leave 0.97, 1.65, 2.37 and 2.46 ΔE00, and the control measured here is the second-worst of them.

  • The algebra is one line. If the sensitivities are A x̄, the illuminant cancels from S B(E)⁻¹ and what remains is A.
  • A is free. The condition says some nonsingular linear combination and says nothing about which.
  • The control’s A is XYZ-like, which is why it scores 2.46 — almost exactly XYZ scaling’s 2.37.
  • Mixed for the best basis, the same ideal sensor reaches 0.974, which is the unconstrained optimum over all nine numbers.
  • And its drift is still zero, so it is simultaneously a perfect colorimeter, a fixed-basis device and the best adapter available.
  • Nothing in this changes a measured number. What changes is a sentence of explanation that has been carried in a docstring and in two essays, and the correction is the reason this one exists.

What the old sentence was measuring

This collection’s machinery carries a control it calls a colorimetric sensor: sensitivities that are the colour-matching functions put through a fixed mixing matrix. It cannot be built — the matching functions go negative in the middle of the construction, and a filter with negative transmittance is not a filter — and that is the point of having it. Every measurement in this collection that reports a sensor failure is run against the control too, so a residual of zero has something to mean.

The control’s mixing matrix is a set of nine numbers written into the source: roughly 0.62, 0.31, 0.07 across the top row, and similar mixtures below. They were chosen so that the three channels look like plausible camera channels — long, medium and short, each dominated by one matching function — and they were not chosen for anything else.

Scored as an adaptation basis, that matrix leaves 2.457 ΔE00, and XYZ scaling leaves 2.373. The two numbers are close because the matrix is close to the identity, and XYZ scaling is what this collection calls the oldest mistake still shipping.

So the assertion — a sensor satisfying the Luther condition exactly leaves more after white balance than a silicon one does — is true, and the explanation recorded beside it attributed the result to the condition. It belongs to the mixing matrix.

The one line

Write out what a camera’s adaptation basis is. Raw values are the sensor’s response to the light reaching it; the basis is the map from tristimulus values to raw, which is S B(E)⁻¹ where S is the sensor’s response to a reflectance basis under illuminant E and B(E) is the standard observer’s.

Now impose the condition. If the sensitivities are A x̄ for a nonsingular A, then S = A B(E) — the sensor’s response to anything is A times the observer’s response to the same thing, under any light, which is what the condition means. So

S B(E)⁻¹ = A B(E) B(E)⁻¹ = A.

The illuminant cancels, which is the well-known half and is why a colorimetric sensor’s basis does not drift. What is left is A, which is the half that has not been said: the adaptation basis of a colorimetric camera is its mixing matrix, and nothing about the condition says which mixing matrix.

Four cameras that all satisfy it

The family can be built and scored. Four members, all with a Luther residual below 10⁻¹⁵ and a drift below 10⁻⁶ degrees:

  • The control this collection ships: 2.457.
  • Mixed to the identity — raw values are X, Y and Z: 2.373.
  • Mixed for the receptors, using the construction from the dichromat confusion points: 1.651.
  • Mixed for the best adaptation basis: 0.974.
Three sensors, and the one that measures best adapts worst. Three sets of sensitivities scored on the same census. The designed dyes leave 0.97 ΔE00, the silicon-and-filter-array sensor leaves 1.62, and the sensor that satisfies the Luther condition exactly — the one that can measure any colour without error — leaves 2.46, which is the worst of the three. Its basis is a fixed linear image of the matching functions, and a fixed linear image of the matching functions is close to scaling XYZ, which is the oldest way of getting adaptation wrong.
Fig. 2 Three sensors on the same census: the silicon one, the designed dyes, and the control. The control’s position in this ranking is what the old sentence generalised from.
The dyes a camera has, and the dyes an adaptation basis would want. Three sensor sensitivities drawn twice: faintly, the silicon-and-filter-array set this collection models, and boldly, three Gaussian dyes chosen to make the inverse of their own response matrix a good basis for a white-balance gain. The designed dyes sit at 610, 542, 449 nm with widths of 35, 26, 30 nm — narrower and further apart than the real ones, which is what sharpening looks like when a search rather than a committee does it. They leave 0.97 ΔE00 against the real sensor's 1.62, and they are held within 0.28 of the Luther condition so that the result is still a camera.
Fig. 3 The two sets of curves the comparison is between: the dyes a camera has, drawn faintly, and the dyes an adaptation basis would ask for. Both are three functions spanning the same subspace, and only one of them is a good place to apply three gains.

The last of those is the sentence worth sitting with. A camera that measures colour exactly, whose basis does not move when the light does, and whose white balance is the best a von Kries gain can be — all three at once, in one device. It is unbuildable for the reason every Luther-satisfying sensor is unbuildable, and it is not unbuildable because of any tension between the properties.

What Luther’s condition actually says

The condition is worth restating precisely, because the version that circulates is a paraphrase and the paraphrase is where the error entered.

Robert Luther’s 1927 statement is about when a three-channel instrument can serve as a colorimeter. A sensor measures three numbers from a spectrum; the eye measures three numbers from the same spectrum; and the question is whether the first triple determines the second. It does exactly when the sensor’s three sensitivities span the same three-dimensional subspace of functions that the matching functions span — equivalently, when each sensitivity is a linear combination of the three matching functions.

Two things follow immediately and only one of them is usually stated.

The stated one: such a sensor has no metamers of its own. Two spectra that look alike to the eye give it identical raw values, and two that look different give it different ones, so a fixed 3×3 converts its raw to tristimulus values exactly — under every light, which is the part that fails for real sensors.

The unstated one: the condition is about a subspace, and a subspace has infinitely many bases. Nothing in it picks out which three combinations the three channels are. That freedom is exactly the nine numbers a colour match leaves free — the same nine these essays have been about throughout — reappearing inside a sensor rather than inside an observer.

Once that is said, the result of this essay is not surprising at all. It is the observer’s own indeterminacy, showing up in a device, and doing there exactly what it does everywhere else: leaving a decision that somebody has to make and nobody has recorded making.

One observer's matching functions, in three of the bases the matches leave freeThe three colour-matching functions after a change of basis 0.50 of the way from Hunt–Pointer–Estévez towards the set built from the dichromat confusion points. Every one of these triples predicts exactly the same matches as every other, because a match is an equality and a matrix applied to both sides of an equality changes nothing. What moves is where the peaks are and whether the curves go negative — these ones do not, and going negative is what the 1931 committee constructed XYZ to avoid.400500600700wavelength, nmpeaks at 570, 545, 445 nmthree curves, one observerbasis: 0.50 of the way between them
Fig. 4 The same three-dimensional subspace expressed in a different basis. Every set of curves like this spans what the matching functions span, so every one of them satisfies Luther’s condition.

Why a real sensor is not in the family

The four cameras above all have a Luther residual of zero. A real one does not, and the gap is what makes the comparison in the old essay a fair comparison of two real-ish things rather than a category error.

This collection’s silicon sensor leaves a residual of 0.317, meaning about a third of each sensitivity’s magnitude cannot be reached by any linear combination of the matching functions. That is a large miss, and it is what produces the sensor’s own metamers, its drifting basis and its need for a profile fitted under a stated light.

So the honest three-way statement is:

  • A real sensor has a basis set by its dyes and the light, drifting 16.6° across the census, leaving 1.62.
  • An ideal sensor has a basis set by its mixing matrix alone, drifting nothing, leaving anything between 0.97 and 2.46 depending on a choice nobody has to defend.
  • And the difference between the two rows is not a trade-off. It is the difference between a device whose axes are partly chosen by the room and one whose axes are entirely chosen by its designer.

What lies between the control and a camera

The control satisfies the condition exactly and adapts badly; a real sensor fails it and adapts better. Mixing them says something neither says on its own.

Blending the two sets of sensitivities at fractions from nought to one and scoring each blend: the Luther residual rises smoothly from 0 to 0.317, the worst basis drift from 0° to 16.63° — and the adaptation figure falls to a minimum of 1.443 at a half-and-half mix, below both parents.

The control leaves 2.457 and the real sensor leaves 1.622. A sensor that is half of each leaves 1.443, better than either, and better than the real camera by a tenth.

That is not what a blend usually does, and it is exactly what the algebra above predicts. A Luther sensor’s adaptation basis is its mixing matrix, and the control’s mixing matrix is XYZ-like, which is a poor basis. A real sensor’s basis is its dyes, which are sharper and better. Halfway between the two is a basis sharper than the control’s and less extreme than the camera’s, and it happens to land nearer the optimum than either end does.

And the drift saturates

The other half of the same blend is a law rather than a surprise.

Drift against the Luther residual across the blend runs 1.85° at a residual of 0.014, 3.54° at 0.027, 6.47° at 0.051, 12.31° at 0.124 and 16.63° at 0.317. Fitted between the ends, the exponent is 0.703: the drift grows as about the seven-tenths power of the residual rather than in proportion to it.

So the first sliver of Luther failure buys most of the drift. A sensor 4.4 per cent of the way from the control towards a real camera already carries eleven per cent of the camera’s drift; one 39 per cent of the way carries 74 per cent of it.

The condition is therefore not a dial whose middle is a compromise. It is a cliff at the exact point, and almost anywhere off it behaves like a real camera — which is the practical form of the condition constrains nothing, seen from the other side.

What was actually in tension

Nothing, and locating the mistake is worth doing carefully because it is a common shape.

The reasoning went: satisfying the condition means the raw channels are the matching functions; a gain on the matching functions is XYZ scaling; XYZ scaling is the worst basis in the comparison; therefore the condition costs adaptation.

The first step is the error. Satisfying the condition means the channels are a linear image of the matching functions, and one of this collection’s own essays even carries the hedge — and if the combination is the identity — before drawing the unhedged conclusion two clauses later. The hedge was the whole argument and it was written as an aside.

How a control acquires a second parameter

The general failure here is one this collection has now met twice in quick succession.

A control exists to isolate one property: build the ideal case, measure it, and attribute the difference to the property being isolated. That works when the ideal case is unique. When it is a family, the control is one member of it, and every measurement made on the control is a measurement of the property and of whichever member was chosen.

The essay on what the matches do not name found the same shape in the cone matrix: a set of fundamentals used everywhere on this site, carrying a comment saying it was a modelling choice, with years of work built on top and nobody measuring the choice. Here it is a mixing matrix inside a control, written to make three curves look like camera channels, deciding a whole column of a device comparison.

The tell in both cases is the same: a parameter with no stated reason. The control’s mixing matrix has a comment saying what it is and no comment saying why those numbers. That is the signature to look for.

What survives, and what has been changed

The assertion stands, at its original numbers, and the essay it supports still reports the same comparison: between these two specific cameras, the colorimetric one leaves more. That is a fact about a table with four rows in it.

What has been changed is the prose. The docstring that said no design has both now says what the assertion measures and points at the family; the two essays that generalised from it now name the mixing matrix; and the assertion keeps its name, which overstates what it establishes, for the reason a published result keeps its title.

The gate that would have caught this does not exist and probably cannot. Every check in this collection asks whether a number is right, and this number was right. What was wrong was a sentence about why.

That is worth a moment, because it is the second time in quick succession that this collection’s own commentary has outrun its own arithmetic. The pattern in both cases is a measurement that is correct, narrow and reported with a general reason attached, where the general reason is the natural-sounding one and the narrow one is the true one. Neither error would have survived somebody asking what else varies between these two cases — and in both cases the answer was a parameter written into the source with no justification beside it.

What a camera designer could do with this

Nothing directly, and something indirectly, and the distinction matters.

Directly: nothing. No sensor satisfies the condition, the four cameras above are unbuildable, and a real design has to trade spectral shape against photon capture in a way none of this arithmetic touches.

Indirectly: the result says where to look. A real sensor’s raw channels are not the axes anything has to be done in. A camera can apply a linear recombination to its raw values before white balancing, and that recombination is exactly the A this essay is about — a free choice, currently made by nobody, that decides which basis the gain acts in.

That is not hypothetical. Some camera pipelines already white balance in a sharpened space rather than in raw, precisely because the sharpened space makes the gain behave, and the practice is old enough in the computational colour constancy literature to be unremarkable. What this essay adds is the reason it works and a way of scoring the choice: it is a basis, and it can be measured against the census like any other.

The score for the current practice is available too. Applying the gain in raw leaves 1.62; recombining into the best basis first — which requires knowing the light well enough to compute the recombination, and is therefore not free — would leave 0.97 at the reference light.

A designed sensor's axes, and how far the room moves them. Each change of illumination in the census against how far it swings the designed sensor's adaptation basis, in degrees, with the sensor this collection models drawn faintly behind for scale. A display's basis does not appear because it does not move at all — its primaries are its axes, whatever the room is lit by. The designed sensor swings up to 6.1° and the real one up to 16.6°, and in both cases the worst rows are the narrowband sources. What was optimised at one light is not what is delivered at another, which is the difference between designing a display and designing a camera.
Fig. 5 How far each change of light swings a sensor’s basis. This is the quantity a recombination cannot remove, because the recombination is fixed and the drift is not.

Where the model stops

Unbuildable remains unbuildable. Every member of the family has negative sensitivities somewhere, so none of them is a camera anybody can make. What the family measures is what the condition costs, which is now known to be nothing, rather than what a real sensor can achieve.

A basis is not the whole of white balance. Estimating the white is a separate problem with an error larger than anything here, and the profile that converts raw to a colour space is fitted under one light and is a second source of error again.

And this says nothing about noise. A mixing matrix chosen for adaptation would amplify sensor noise differently from one chosen for anything else, and correcting colour costs noise is the essay about that trade. The family here is scored on one criterion.

Why no gate caught it

Every check in this collection asks whether a number is right. This number was right: the control does leave more than the silicon sensor, at the ratio the assertion requires, and it has done so on every build since it was written.

What was wrong was a sentence of explanation, and there is no mechanism anywhere here that reads a docstring and asks whether its reasoning follows from what the code measures. voice_check reads prose for the vocabulary of a build schedule; internals_check reads it for leaked repository paths; neither reads it for a non-sequitur, and neither could.

So the safeguard has to be a habit rather than a gate, and the habit is the one this essay ends on: when a control isolates a property, build a second control that differs only in the undeclared parameter, and see whether the conclusion survives. Here it takes six lines and it does not survive.

The generalisation

A control is a member of a family unless something proves it is the only member, and every measurement on a control is a joint measurement of the property and of the choice.

The remedy is cheap and is what this essay is: build several members, score them all, and report the spread. If the spread is small, the control was standing in for the family and the conclusion is safe. If it is a factor of 2.5, the control was standing in for itself.

The stronger form of the habit is to look for parameters that arrived without a reason. In a codebase they are the constants with a comment saying what and no comment saying why; in a paper they are the choices described as for convenience; and in both cases they are where an undeclared decision is sitting.

Where the ladder goes next

Three of the results here turn on a constraint costing much less than its size suggests, and one turns on a constraint costing much more. What decides which is a property of the optimum rather than of the constraint.

Named alongside this one

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

What links here

Every essay whose body links to this one.

The objects this essay names

Each one links to every other essay that touches it.

AssertionBasisCamera rawChromatic adaptationColour managementLuther conditionMeasurement errorSpectral sensitivityThe von Kries transformWhite balance