Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adjusting one image's exposure / white balance to match another (with PIL?)

I have a cheap stereo camera rig that I use for diving. Sometimes each camera white balances or sets exposure differently. Example:

http://www.chrisevans3d.com/temp/forums/left.jpg

http://www.chrisevans3d.com/temp/forums/right.jpg

Is there a way to do this with getting im.histogram() of each, making a diff or LUT then transforming one image to the other? How does the 'Match Color' feature of photoshop work?

I would like to release a free software kit for making gopro stereo cameras more useable, so any help would be great.

like image 911
Chris Evans Avatar asked Jun 30 '11 10:06

Chris Evans


People also ask

How do you adjust white balance?

Your white balance setting can be accessed either in your camera's menu system or using a dedicated button labeled “WB” on your camera's body. Hold it down/press it and you'll be able to scroll through the different icons representing different lighting situations.

How do you adjust white balance in post processing?

To counter this is very simple: just pay a visit to the overall white balance slider and drag that thing in the opposite direction from the color you want to neutralize. So, for this image, you would drag the white balance from the blue side toward the yellow side until the scene no longer looks overly blue.

What is the white balance in photography?

White balance is used to adjust colors to match the color of the light source so that white objects appear white. Subjects may be lit by a number of different light sources, including sunlight, incandescent bulbs, and fluorescent lighting.

What is the purpose of white balance?

The function that corrects these color issues is the digital camera's "white balance." Essentially, white balance adjusts images to make white subjects look white in the final product. By making good use of white balance, you'll be able to manipulate the tone of your pictures at will.


1 Answers

Matching white balance is not a trivial task. A very basic method is to assume a gray world and scale the RGB channels of one image to match the average RGB values of another. This will fail easily when the scenes are biased towards a color (instead of gray). You can improve it further by rejecting dark/bright pixels etc. There are tonnes of papers on white balancing. Find an algorithm to estimate the color temperature of the image and then determine which one is more appropriate for the scene/camera settings & normalize the images.

It's a similar story with exposure i.e. adaptive algorithms identify region of interest in the image and match the average brightness.

I'd suggest, start with a simple algorithm and then improve as you encounter failures. Allow manual overrides also.

EDIT :

Worth a start : HP Adaptive White Balance

Tool for reading raw images + basic post processing : dcraw

like image 129
user Avatar answered Sep 28 '22 11:09

user