76
Comp 790 - Computational Photography Spatially Varying White Balance Megha Pandey Sept. 16, 2008

Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Comp 790 - Computational Photography

Spatially Varying White Balance

Megha PandeySept. 16, 2008

Page 2: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Color Constancy• Color Constancy – interpretation of material colors

independent of surrounding illumination.

Page 3: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Color Constancy• Color Constancy – interpretation of material colors

independent of surrounding illumination.

Page 4: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Digital Images under Varying Illumination• Cameras can not adapt to varying illumination as

humans do – images have a color cast depending on the light source.

Page 5: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

• Cameras can not adapt to varying illumination as humans do – images have a color cast depending on the light source.

Page 6: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Color Temperature• Color temperature of a

light source is the temperature of an ideal black body radiator at which the color of the color of the light source and the black body are identical.

Page 7: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Incandescent Light – Orange Color Cast

Page 8: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Moonlight – Blue Color Cast

Page 9: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Fluorescent Light : Green Color Cast

Page 10: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Color Balance• Color Balance – adjusting the color components to

eliminate color casts.• Chromatic Adaptation : estimation of representation of object as it

would appear under a different light source than the one in which it was recorded.

• White Balance – aims to render neutral colors correctly to emulate the property of color constancy

Page 11: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

• Color Balance – adjusting the color components to eliminate color casts.

• White Balance – aims to render neutral casts correctly to render visually pleasing images.

• white balanced image

Page 12: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

White Balance Tools

Digital Cameras

Page 13: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Auto White Balance

Page 14: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

White Balance Caps

Gray Cards

Page 15: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

• Take a picture of a neutral object (white or gray)

• Deduce the weight of each channel– If the object is recoded as R’w,

G’w, B’wuse weights 1/R’w, 1/G’w, 1/B’w

Page 16: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Auto WB Custom WB

Page 17: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Color Correction Filters

Page 18: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Mixed Lighting

Page 19: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Light Filters

Gel Filters

Light Filters

Page 20: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

White Balance under Mixed Lighting• Barnard [1997] – adaptation of gamut-based color constancy technique,Assumes smooth illumination

• Kawakami [2005] – outdoor scenes with hard shadows, illuminants restricted to black-body radiators

Page 21: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

• Lischinski [2006] – user scribbles, correct localized color casts

Page 22: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

• Ebner [2004] – local color shifts, “Gray World Assumption”

Page 23: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Local Color Shift

Page 24: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Light Mixture Estimation forSpatially Varying White Balance

Eugene HsuTom MertensSylvain ParisShai AvidanFredo Durand

(Several slides from Eugene Hsu)

Page 25: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Algorithm Overview• Recovers the dominant material colors and uses them to

estimate the relative proportion of the two light colors at each of the pixels.

Input image illuminated by two light types

Page 26: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Voting scheme to recover dominant material colors inthe scene.

Page 27: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Estimate light mixture at reliable pixels and interpolate missing values.

Page 28: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Estimated light mixture is used to achievespatially varying white balance.

Page 29: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Assumptions• Two light sources – specified by the user

• Interaction of light can be described using RGB channels only

• Surfaces are Lambertian and non-fluorescent - which implies that the image color is the product of illumination and reflectance.

• Color bleeding due to indirect illumination can be ignored

Page 30: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Image Formation Model

Observed pixel color is material color multipliedby scaled light color.

Page 31: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

White Balance

Proper white balance is achieved by inverting the effect of the light source color.

Page 32: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Proper white balance is achieved by inverting the effect of the light source color.

Page 33: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Image model with two light sources

Page 34: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Proper white balance can be achieved if the relativeproportion of the two light sources is known.

Page 35: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Solving for α is under-constrained since the actualmaterial colors are not given.

Page 36: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Material Color Estimation• Assume scene is dominated by a small set of

material colors, hence reflectance spectra is sparse.

Page 37: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Material Color Estimation• Assume scene is dominated by a small set of

material colors, hence reflectance spectra is sparse.

Page 38: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Material Color Estimation• Assume scene is dominated by a small set of

material colors, hence reflectance spectra is sparse.

Scene viewed in white light

Page 39: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Material Color Estimation• Assume scene is dominated by a small set of

material colors, hence reflectance spectra is sparse.

Scene viewed in mixed light

Page 40: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Sample material colors and find the one that accountsfor the observed color of most pixels.

Page 41: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Given a candidate material color…

Page 42: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

…a pixel votes for a material color only if the observedcolor can be explained by a combination of given lightsources.

Page 43: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

If this expression holds, we say that the pixel votes for the material color.

Page 44: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

48%

Page 45: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

48 %

16 %

Page 46: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Light mixture estimation for reliable pixels

Page 47: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Mixture Interpolation

Assume L1B and L2B are 1, divide out the blue channels.

This looks exactly like Image Matting.

Page 48: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Interpolation is performed using Matting Laplacian[Levin et al. 2006]

Page 49: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Scene shot with multiple exposures so that ground truthis available.

Page 50: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Constraint the marked points and interpolate the rest

Page 51: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Smooth interpolation is pretty bad.

Page 52: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Edge-aware interpolation doesn’t work satisfactorilyeither.

Page 53: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Matting Laplacian gives much better result.

Page 54: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance
Page 55: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance
Page 56: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance
Page 57: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Experiments – Synthetic Data

Input

Page 58: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Output

Page 59: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Input Output

Ground Truth Comparison

Page 60: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance
Page 61: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Experiments – Real Data

Input Alpha Map Output

Page 62: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Input

Page 63: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Output

Page 64: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Input

LME Local Color Shift

Page 65: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

LME Local Color Shift

Page 66: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Scene Relighting

Separate the two lighting contributions from the whiteBalanced image

Page 67: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

• The observed scene is a blend of two images as seen by either of the light sources in proportions αand 1- α.

Multiply the white balanced image by α for the firstcontribution

Page 68: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Multiply the white balanced image by α for the firstContribution and by 1- α for the second contribution

Page 69: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance
Page 70: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance
Page 71: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance
Page 72: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

We can choose new lights and add desired effects.

Page 73: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Input

Page 74: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Output

Page 75: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance
Page 76: Comp 790 - Computational Photography Spatially Varying ...lazebnik/research/fall08/megha_pandey.pdfSep 16, 2008  · Comp 790 - Computational Photography Spatially Varying White Balance

Discussion• Works best for raw image data

• Better results for indoor scenes

• Handles specularities and inter-reflections

• Material colors should exhibit enough color variation for the voting to work.

• Accurate specification of light sources is required.

• Scalability Issues