COMPUTATIONAL ASPECTS OF DIGITAL PHOTOGRAPHY
Light & Color (continued)
Wojciech Jarosz
wojciech.k.jarosz@dartmouth.edu
Administrivia Assignment 2 available now - back to programming - - - PowerPoint PPT Presentation
C OMPUTATIONAL A SPECTS OF D IGITAL P HOTOGRAPHY Light & Color (continued) Wojciech Jarosz wojciech.k.jarosz@dartmouth.edu Administrivia Assignment 2 available now - back to programming - due next Wednesday CS 89/189: Computational
COMPUTATIONAL ASPECTS OF DIGITAL PHOTOGRAPHY
Light & Color (continued)
Wojciech Jarosz
wojciech.k.jarosz@dartmouth.edu
Assignment 2 available now
CS 89/189: Computational Photography, Fall 2015 2
Light & Color
CS 89/189: Computational Photography, Fall 2015 3
CS 89/189: Computational Photography, Fall 2015
4
Light can be a mixture of many wavelengths
CS 89/189: Computational Photography, Fall 2015 5
× =
CS 89/189: Computational Photography, Fall 2015 6 Foundations of Vision, by Wandell After a slide by Frédo Durand
CS 89/189: Computational Photography, Fall 2015 7 After a slide by Steve Marschner
Physical Perceptual
CS 89/189: Computational Photography, Fall 2015 8
near fovea away from fovea
CS 89/189: Computational Photography, Fall 2015
9
n(λ) p(λ) X =
Z
n(λ)p(λ) dλ
After a slide by Steve Marschner
CS 89/189: Computational Photography, Fall 2015 10
X =
Z
s(λ) r(λ) dλ
measured signal input spectrum detector’s sensitivity
After a slide by Steve Marschner
M =
Z
rM(λ) s(λ) dλ S =
Z
rS(λ) s(λ) dλ L =
Z
rL(λ) s(λ) dλ
Stimulus (arbitrary spectrum) Response curves Multiply Integrate
1 number 1 number 1 number
Start with infinite number of values (one per wavelength) End up with 3 values (one per cone type)
CS 89/189: Computational Photography, Fall 2015 12
Input L M S
After a slide by Matthias Zwicker
CS 89/189: Computational Photography, Fall 2015 13
cone sensitivities Input L M S
After a slide by Matthias Zwicker
CS 89/189: Computational Photography, Fall 2015 14
*
cone sensitivities input spectrum Input L M S
After a slide by Matthias Zwicker
Tristimulus response is a matrix-vector multiplication
CS 89/189: Computational Photography, Fall 2015 15
*
cone sensitivities input spectrum tristimulus response
=
Input L M S
After a slide by Matthias Zwicker
rS, rM and rL are N-dimensional vectors, where N ¡= ¡∞
CS 89/189: Computational Photography, Fall 2015 16
M =
Z
rM(λ) s(λ) dλ = rM · s S =
Z
rS(λ) s(λ) dλ = rS · s L =
Z
rL(λ) s(λ) dλ = rL · s S M L = rS rM rL
|
s
|
Integral notation: Matrix notation:
CS 89/189: Computational Photography, Fall 2015 17 After a slide by Steve Marschner
Physical Perceptual S M L = rS rM rL
|
s
|
Take a spectrum (which is an infinity of numbers) Eye produces three numbers (a projection to 3D) This throws away a lot of information!
CS 89/189: Computational Photography, Fall 2015 18 After a slide by Steve Marschner
Cone responses overlap & are not orthogonal! Basis functions for analysis
are different than for synthesis
The RGB in your camera is different than the RGB in your monitor!
CS 89/189: Computational Photography, Fall 2015 19 After a slide by Frédo Durand
We want to compute the combination of R, G, B that will project to the same visual response as s
CS 89/189: Computational Photography, Fall 2015 20 After a slide by Steve Marschner
What color do we see when we look at the display?
CS 89/189: Computational Photography, Fall 2015 21
B C
After a slide by Steve Marschner
What color do we see when we look at the display?
CS 89/189: Computational Photography, Fall 2015 22
L MRGB C
After a slide by Steve Marschner
What color do we see when we look at the display?
CS 89/189: Computational Photography, Fall 2015 23
S M L = rS · sR rS · sG rS · sB rM · sR rM · sG rM · sB rL · sR rL · sG rL · sB R G B E = MSML MRGB C
After a slide by Steve Marschner
Goal of reproduction: visual response to s and sa is the same: Substitute in expression for sa ¡,
CS 89/189: Computational Photography, Fall 2015 24
MSML s = MSML sa MSML s = MSML MRGB C C = (MSML MRGB)−1MSML s
color matching matrix for RGB
After a slide by Steve Marschner
Monochromatic wavelength λ can be reproduced with: b(λ) amount of the 435.8nm primary, + ¡g(λ) amount of the 546.1 primary, + ¡r(λ) amount of the 700 nm primary
CS 89/189: Computational Photography, Fall 2015 25
Negative light required?
Linear algebra to the rescue! Purely positive basis functions Linear transformation of CIE RGB Non-physical primaries
CS 89/189: Computational Photography, Fall 2015 26
CIE RGB CIE XYZ
X Y Z = 1 0.17697 0.49 0.31 0.20 0.17697 0.81240 0.01063 0.00 0.01 0.99 R G B
3D spaces can be hard to visualize Chrominance is our notion of color, as opposed to brightness/luminance Recall that our eyes correct for multiplicative scale factors
CS 89/189: Computational Photography, Fall 2015 27
Chromaticity (x,y) can be derived by normalizing the XYZ color components:
Combining xy with Y allows us to represent any color Plotting on xy plane allows us to see all colors of a single brightness
CS 89/189: Computational Photography, Fall 2015 29
x = X X + Y + Z y = Y X + Y + Z
Spectral colors along curved boundary Linear combination of two colors: line connecting two points Linear combination of 3 colors span a triangle (color gamut)
CS 89/189: Computational Photography, Fall 2015 30
Color primaries at: 435.8, 546.1, 700.0 nm
CS 89/189: Computational Photography, Fall 2015 31
CS 89/189: Computational Photography, Fall 2015 32
values ce ut
White Point Dominant wavelength Inverse color
CS 89/189: Computational Photography, Fall 2015 33
A A’ B
All these color spaces so far are perceptually non- uniform:
visually similar
Measuring “perceptual distance” in color spaces important for many industries Experiments by MacAdams
CS 89/189: Computational Photography, Fall 2015 34
CS 89/189: Computational Photography, Fall 2015 35
Test patches
Two attempts to make a perceptually-uniform color space MacAdams ellipses become nearly (but not perfectly) circular
CS 89/189: Computational Photography, Fall 2015 36
Color perception is much more complicated than response of SML cones… Visual pathway
CS 89/189: Computational Photography, Fall 2015 38
Also known as chromatic adaptation Color of object is perceived as the same even under varying illumination For example:
perceived as white, even though the reflected light is green! The human brain infers the white color from the context, which is “green-ish“ too because of the green illumination.
CS 89/189: Computational Photography, Fall 2015 39
CS 89/189: Computational Photography, Fall 2015
40
blue and black?
white and gold?
Color constancy failure
http://xkcd.com/1492/
Hering’s opponent process theory (1874)
After sensing by cones, colors are encoded as red versus green, blue versus yellow, and black versus white Physiological evidence found in the 1950s
CS 89/189: Computational Photography, Fall 2015 43
+
Receptors Blue/Yellow Receptors Black/White Receptors
+
Inputs are LMS cone responses Output has a different parameterization:
CS 89/189: Computational Photography, Fall 2015 44 Bk G Y Wh B R S L M
Trichromatic Stage Opponent-Process Stage
CS 89/189: Computational Photography, Fall 2015 45
Sums for brightness Differences for color
At the end, it’s just a 3x3 matrix compared to LMS
Image Afterimage
Luminance, red-green, blue-yellow CIELab YUV YcrCb
CS 89/189: Computational Photography, Fall 2015 55
YUV YCrCb
Y0 U V = 0.299 0.587 0.114
0.14713 0.28886
0.436 0.615
0.51499 0.10001
R G B R G B = 1 1.13983 1
0.39465 0.58060
1 2.03211 Y0 U V
Y0 = 0 + (0.299
·R0
D) + (0.587
·G0
D) + (0.114
·B0
D)
CB = 128 (0.168736 ·R0
D) (0.331264 ·G0 D) + (0.5
·B0
D)
CR = 128 + (0.5
·R0
D) (0.418688 ·G0 D) (0.081312 ·B0 D)
Gamma Colorspaces
separation
contrast
Spanish castle illusion Grayworld whitebalance Histograms
histogram matching
CS 89/189: Computational Photography, Fall 2015 56
Frédo Durand Steve Marschner Matthias Zwicker
CS 89/189: Computational Photography, Fall 2015 58