Log in

View Full Version : Color Temperature filter?


WorBry
29th January 2008, 06:22
Just wondering, is there an AVISynth filter that can derive the (average) color temperature (in Degrees Kelvin) of a defined number of frames in a video sequence?

dbzgundam
29th January 2008, 15:23
It won't really be an exact measure (nor will it look that good) coming off of presumably 8-bit video.

3-Way RGB Color Correction (not sure if AVISynth has anything for this) could possibly help you out by choosing a white point and color shifting the image accordingly, but you'd probably want After Effects to help you with this.

Just keep in mind that if your image is too blue (ie, 5600k or higher, outdoor lighting), you'll need to add some orange/red in there to offset it, but this is nothing compared to actual white balance in the camera. The opposite is true for an image that is too red (3200k-ish, indoor lighting).

WorBry
29th January 2008, 21:10
Thanks dbzgundam.

Basically, I have a stack of indoor home DV footage that was not well balanced when I shot it. I'd had some success correcting 'uniform' casts (i.e. taken under fairly even artificial lighting) using Color YUV and HDRAGC, but clips shot under mixed lighting (not untypically tungsten, fluorescent and sometimes a video light on top - mostly halogen and some LED) have been more challenging.

I’ve just upgraded to Video Studio 11 Plus as my main editor, which now features a white balancing tool. There is an 'auto' option, which doesn’t do a bad job with even casts, but, again, struggles with mixed light sources. Like After Effects, there is a 'white picker' for 'manual' balancing, which is fine as long as you have a non-reflective, uniformly illuminated, pure white object in your shot, otherwise its hit and miss. Nowadays, depending on the circumstances, I manually white balance my camcorder (Panasonic GS400) off a digital grey card and/or include a calibrated white card in the shot for correcting in post. The archives I’m trying to correct were shot on a Sony DCR PC115 (until it was stolen :mad:) which had no manual WB control.

A third option in VS 11 Plus is to correct WB by adjusting the color temperature, using presets to first select the expected range (tungsten, fluorescent, daylight, cloudy etc) and then fine tuning the temperature in Degrees Kelvin. I guess I could persist in fiddling until the balance looks ‘about right’, but I figured if there is a way to measure the color temperature of the original frame (or sequence), with reasonable accuracy, I could just plug that value in. Whether that would give a better result than the AWB option, I’m not sure, as it is not entirely clear (to me at least) how the AWB mode works – does it simply pick a near neutral object in the frame and use that as a reference or use a more complex algorithm (grey-world, fuzzy logic etc) to arrive at some composite measure of neutrality or color temperature.

I receive your point about the likely inaccuracies in deriving color temperature from 8-bit video, but if there were an AVISynth (or VDub) filter that could do that, I’m keen to give it a try.

Cheers.

Wilbert
29th January 2008, 22:04
Forgive my ignorance, what is color temperature of a frame?

Sagekilla
29th January 2008, 22:09
Color temperature is merely a measure of the white point of an image (or frame in this example) Lower values are redder, higher are bluer, with white being somewhere between 5000K and 7000K. So, lower temperature for a frame means it'll look reddish, and higher means it'll look bluish.

You should read the wikipedia article (http://en.wikipedia.org/wiki/Color_temperature), it'll give you a pretty good idea if I didn't explain it too well here.

martin53
25th July 2013, 22:20
Although this thread is dead for a while, I'd like to point to a script that does color temperature shift (http://forum.doom9.org/showthread.php?p=1633260#post1633260).

I liked that function much in PaintShop X and miss it in most other amateur photo apps.

Now it's also available in FritzPhoto and all AviSynth environments, of course not restricted to photo.