3

Let me try to explain the question in more detail.

Let's suppose:

  • I have a camera taking images in a dynamic environment (colour temperature is constantly changing)
  • I cannot use automatic in-camera white balancing or it is not available
  • I have software running and controlling the camera that I could utilise for white balancing
  • I have a "target" temperature

Now please do correct me as I may completely be making a wrong assumption on how white balancing works. However, is it possible:

During the capturing run, take a sample image, calculate the white balance corrections and apply them as camera colour gains (Red gain and blue gain) or perhaps adjusting the chromatic gains (U and V)?

To try to summarise:

What I want to create is an automated white balancing system that takes in the desired temperature and based on a sample image calculates "future" red/blue gains or U/V gains. Do modern cameras when setting the temperature do this or do they simply post-process?

Many thanks in advance and I do really understand that I might be completely wrong and such a thing is not possible, since all my research I am doing is describing how to change an image that has been already taken.

6
  • Proper WB is usually figured out by taking a sample image of a color checker of some sort. Will you have the ability to shoot your samples of a known object like this or is the scene going to always be dynamic?
    – OnBreak.
    May 3, 2018 at 15:16
  • 1
    To clarify, are you asking if cameras can dynamically vary analog gain for R, G, and B individually? AFAIK, for "normal" cameras, analog gain is always global, and balancing is done as post-processing. May 3, 2018 at 21:50
  • I cannot really open up a lot about the context of what we are doing because of an NDA, however the basic principle is: We are using an industrial grade Lumenera camera attached to a custom built payload that is attached to a helicopter. During a flight we take images, however the context needs us to set the white balance temperature manually. From trying to research the subject, I noticed that the colour temperature is somehow related to blue and red gains, but I could not find anywhere on how to calculate the relation. Hope this clarifies things a bit.
    – karmalis
    May 4, 2018 at 6:28
  • Not sure if this is what you are after but ... In Lightroom you can adjust White balance for a RAW image (and non RAW) and then copy these developer settings. This white balance adjustment can then be "copied" to any number of related images taken under similar conditions/lighting
    – MiguelH
    May 4, 2018 at 11:43
  • @karmalis in short, if you do not know how to evaluate white balance you should either hire somebody knowledgeable or you can try asking every single question on this site. May 4, 2018 at 17:54

5 Answers 5

2

Assuming your helicopter is going to be operating outdoors you would want to follow a procedure different from that engaged in by pictorial photographers. Accepted practice for remote sensing operations is to radiometricaly calibrate your camera system. This means to establish a standard illuminant and record the camera's channel-specific response curves.

Opto-electronic engineers will accomplish this task using an integrating sphere and bit-wise access to the digital response of the sensor. Once response is characterized, a transfer curve can be used to calibrate the total system response to an absolute radiometric state. This is generally accomplished by applying a RGGB transfer curve between the debayer and demosaic steps of post processing. If you have imagery in a known radiometric state you can then reconstitute it in any other color space or appearance you like.

This engineering rigor can be approximated using more readily available materials. The illumination on a bright, sunny day at noon at a moderate latitude is well known. If an image of a reliably uniform and spectrally balanced subject is captured under these conditions, a reasonable (accurate to around 3%) characterization can be made. To ensure the accuracy of your calibration, be sure to double check the spectral characteristics of your subject (for example, check it's metamerism properties) and also use varied exposure to investigate the toe and shoulder of your response curve.

Remember that in remote sensing applications we prefer imagery that is uniform to that which is pretty. Use rigorous calibration, be meticulous with your ground truth and good looking pictures will be a natural by-product.

0

Sure, there's no reason you couldn't take a previous image, calculate the white balance, and apply that to a future image. You can even get fancy and attempt to predict what the white balance will be, based on changes over the last X images.

But why would one do this? You're always going to get better results by examining the actual image which you're white balancing. In video you probably want some hysteresis to prevent abrupt and jarring shifts, but in photography that is not a concern.

2
  • Many thanks for the insights, however for our project, we will be taking a fair bit of images from multiple cameras in a raw format. Furthermore, (have expanded a bit in a comment under my OP), we have some other software and post processing running, which means we do not have time and resources to spare to post process the images. But what we can do and want - is set a fixed colour temperature to be applied for each shot, since we can easily adjust colour gains, as well as U/V gains.
    – karmalis
    May 4, 2018 at 6:37
  • If you set a fixed color temperature, then as the light changes the appearance of the same colored objects will change. When you set a color temperature you're not changing the actual light in the scene, you're changing the amount of compensation needed to make certain objects appear a certain color. If the light changes, your color temperature setting (and possibly other WB factors, such as along the green←→magenta axis) must also change to preserve consistent colors of the objects you are imaging.
    – Michael C
    May 4, 2018 at 8:50
0

If you mean "change the gain of three-primary-color(just like adjusting the tone curve) but not the gain of the CMOS' channels to achieve the pre-set white balance"

It is impossible.

Because the white balance actually change the "color matrix" (converting the signals from sensors'/color gamut to a certain color gamut(e.g. Rec.709) by mixing the signals from different channels).

it just like a process of "Channel mixer" in Photoshop (but color matric mix the linear signal)

And that is the reason of being impossible.

The pipline of color rendering

sourcing from 'Why You Should Forget Luminance Conversion and Do Something Better'

0

First things first: Color Temperature is but a single axis of two dimensional White Balance. The blue←→amber axis of color temperature is roughly perpendicular to the green←→magenta "tint" axis when plotted on a 'color wheel'.

enter image description here
The b axis is more or less what we call 'color temperature' (the actual color range of black body radiators would be a curve, starting at -b* and hooking right to exit between b* and a*) the a axis is what we call 'tint'.

But when plotted in CIE xyY color space, neither "axis" is a vector with a constant slope. Nor is the 'color temperature' axis a simple line between pure blue and pure red.

enter image description here

Here's a closeup of the area that the black body "color temperature" range moves through. Notice that as the color temperature changes, so does the angle of the green←→magenta range.

enter image description here

What this means is that it is even worse than you thought. You could have two different lighting conditions in which the illuminant is 5500K and one source could be more magenta and the other source could be more green. You would need to use different red and blue multipliers to make objects look the same colors under each 5500K light source.

0

Your question is manyfold, I cannot see the technical task behind it so clarrify anything you want in comments.

Do modern cameras when setting the temperature do this or do they simply post-process?

Cameras do not have any control over the sensor output except:

  • gain/ISO

  • shutter

  • shutter mode (electronic shutters are already used for years)

  • black level correction (in Canon sensors for example)

    Therefore:

During the capturing run, take a sample image, calculate the white balance corrections and apply them as camera colour gains (Red gain and blue gain) or perhaps adjusting the chromatic gains (U and V)?

Yes. Record raw images and post-process everything. Raw file can be slightly cooked (NR by Fuji, channel scaling by Nikon, compression artifacts in Sony MILC) but it's still excessively excellent in most cases.

What I want to create is an automated white balancing system that takes in the desired temperature and based on a sample image calculates "future" red/blue gains or U/V gains. Do modern cameras when setting the temperature do this or do they simply post-process?

It is possible given that you are OK with limitations:

  • as Clark said, black body temperature does not describe all light sources
  • whenever you can characterize light source well enough there can't possibly be any exact algorithm to apply white balance to compensate for that known light source to image (i.e. get the same colour balance as in image under reference light source for any object)

That's because image captures these three factors:

  • SPD of object
  • SPD of illuminant
  • spectral curves of sensor

You are already loosinig information whenever you use a tristimulus camera, you are loosing even more when you white-balance an image non-optically. I am not talking like there are any practical alternatives.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.