Original article: WeChat official account “迁移函数”

Reference paper: Color correction for multi-camera systems: aligning white points

Reference code: Hurricane-k/Demo-AlignWhitePoints

When we switch from the main camera to the telephoto camera on a phone or drone, the colors of the same scene may suddenly change. White-point inconsistency is one reason, but differences in the cameras’ spectral responses (QE/camera spectral sensitivity curves) we hope that the image colors will be more consistent when switching lenses.

Color comparison of the uncropped main-camera image, its crop, and the 3× telephoto image

The left image is the uncropped main-camera image, the middle image is cropped from it, and the right image was taken with the 3× telephoto camera. These images were taken one after another at approximately the same time, so the sea surface may differ slightly.

Why do the color tones differ? An easily overlooked cause

Images from different lenses use different white points during automatic white balance (AWB). Different lenses capture different fields of view and may therefore produce different white-point estimates. We found that mapping and aligning the white points of two cameras noticeably improves color consistency in many scenes.

Our approach: establish a “white-point correspondence” between two lenses/cameras

We use the white point estimated from the main-camera image as the reference, because the main camera has a wider field of view than the 3× telephoto camera. Suppose the white-point raw signal of an illuminant in the main camera is $[R_{\mathrm{M}}, G_{\mathrm{M}}, B_{\mathrm{M}}]$. How can we obtain the white-point raw signal $[R_{\mathrm{T}}, G_{\mathrm{T}}, B_{\mathrm{T}}]$ of that illuminant in the 3× telephoto camera?

We obtain a $3 \times 3$ transformation matrix $\mathbf{M}$ and use it to map the main-camera white point to the telephoto-camera white point $\mathbf{M}$:

$$ \begin{bmatrix} R_{\mathrm{T}} & G_{\mathrm{T}} & B_{\mathrm{T}} \end{bmatrix} = \begin{bmatrix} R_{\mathrm{M}} & G_{\mathrm{M}} & B_{\mathrm{M}} \end{bmatrix} \mathbf{M}. $$

How can this matrix work across more real-world scenes? We cannot measure the RAW signals of every illuminant in different cameras in the laboratory or on a production line. We therefore selected 19 representative illuminants from a large collection for calibration, then used least squares to obtain the transformation matrix from their corresponding white points in the two cameras. The details of how these 19 illuminants were selected are more academic, so we will not discuss them here.

Spectral power distributions of the 19 representative illuminants over the visible range

Spectral power distributions of the 19 representative illuminants over the visible range

You may ask: can these 19 illuminants be used to calibrate any two cameras? They were not selected for a single camera pair. Instead, they were selected using 756 camera pairings formed from 28 cameras and 544 illuminants. However, the actual performance still depends on how similar the spectral responses of the two cameras are.

How do we evaluate whether the method works?

We use angular error to measure the difference between the mapped telephoto-camera white point and the reference white point (ground truth). A smaller angular error means that the mapped white point is closer to the reference. Rather than discussing the data in Figure 8 here, let us look directly at the photo comparisons.

Main-camera and 3× telephoto color comparisons before and after cross-camera white-point mapping

The comparison on the left does not use cross-camera white-point mapping. In the comparison on the right, the 3× telephoto image uses the mapped white point. The colors of the 3× telephoto image on the right are clearly closer to those of the main-camera image.

What are the limitations?

If the spectral sensitivities of the two cameras differ substantially (a lower Vora value), the mapped white point is more likely to deviate from the reference white point (ground truth).

Interested readers can view and try the demonstration code on GitHub. However, the source data have been replaced with a public dataset, so the results will differ somewhat from those in the paper.