Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 1
Introduction to color science Trichromacy Spectral matching functions CIE XYZ color system xy-chromaticity diagram Color gamut Color temperature Color balancing algorithms
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 2
Newton’s Prism Experiment - 1666
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 3
Color: visible range of the electromagnetic spectrum
380 nm 760 nm
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 4
Radiometry overview
illuminant
spectral reflectance at receiver:
sensor (tri-stimulus) response
CIE XYZ
???
color conversion RGB
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 5
Radiometric Quantities
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 6
Photometric Quantities
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 7
Human retina
Pseudo-color image of nasal retina, 1 degree eccentricity, in two male subjects, scale bar 5 micron
[Roorda, Williams, 1999]
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 8
Absorption of light in the cones of the human retina
Sens
itivi
ty
Wavelength 𝜆 (nm)
535 nm 445 nm 575 nm
——𝐿: 𝑆𝑅 𝜆 ——𝑀: 𝑆𝐺 𝜆 ——𝑆: 𝑆𝐵 𝜆
Note: curves are normalized. Much lower sensitivity to Blue, since fewer S-cones absorb less light.
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 9
Three-receptor model of color perception
Different spectra can map into the same tristimulus values and hence look identical (“metamers”)
Three numbers suffice to represent any color – Grassmann’s law
[T. Young, 1802] [J.C. Maxwell, 1890]
( ) ( )GS C dλ
λ λ λ∫
( ) ( )BS C dλ
λ λ λ∫
( )C λ
Rα
Gα
BαSpectral energy distribution
of incident light
Effective cone stimulation (“tristimulus values”)
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 10
Color matching Suppose 3 primary light sources with spectra Pk( ), k =1,2,3 Intensity of each light source can be adjusted by factor k How to choose k, k =1,2,3, such that desired tristimulus values (⟨ R, ⟨ G, ⟨ B) result ?
( ) ( )GS C dλ
λ λ λ∫
( ) ( )RS C dλ
λ λ λ∫
( ) ( )BS C dλ
λ λ λ∫
Rα
Gα
Bα
Color matching is linear!
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 11
Additive vs. subtractive color mixing
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 12
Color matching experiment
Courtesy B. Wandell, from [Foundations of Vision, 1996]
Eyes
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 13
Spectral matching functions
Color matching experiment: Monochromatic test light and monochromatic primary lights
Spectral RGB primaries (scaled, such that R=G=B matches spectrally flat white)
“Negative intensity”: color is added to test color Standard human observer: CIE (Commision
Internationale de L’Eclairage), 1931.
RGB Color Matching Functions
——𝑟 𝜆 ——𝑔 𝜆 ——𝑏 𝜆
435.8 nm 546.1 nm 700.0 nm Wavelength 𝜆 (nm)
Tris
timul
us v
alue
s
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 14
Luminosity function
Experiment: Match the brightness of a white reference light and a monochromatic test light of wavelength λ
Links photometric to radiometric quantities
Wavelength 𝜆 (nm)
Peak 555nm
Lum
inou
s ef
ficie
ncy
reference light
Monochromatic test light
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 15
CIE 1931 XYZ color system
Properties: All positive spectral matching functions
Y corresponds to luminance Equal energy white: X=Y=Z Virtual primaries
—— —— ——
XYZ Color Matching Functions
Tris
timul
us v
alue
s
Wavelength 𝜆 (nm)
.490 .310 .200
.177 .813 .011
.000 .010 .990
X RY GZ B
λ
λ
λ
=
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 16
Y
Z
X
X+Y+Z=1
Color gamut and chromaticity
XxX Y Z
YyX Y Z
=+ +
=+ +
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 17
CIE chromaticity diagram
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 18
Perceptual non-uniformity of xy chromaticity
Just noticeable chromaticity differences (10X enlarged) [MacAdam, 1942]
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 19
Color gamut
NTSC phosphors R: x=0.67, y=0.33 G: x=0.21, y=0.71 B: x=0.14, y=0.08 Reference white: x=0.31, y=0.32 Illuminant C
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 21
White at different color temperatures
1500 2000
2500 3000
4000 6000 10000
25000
Tc(K)
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 22
Blackbody radiation
Planck’s Law, 1900
Wien’s Law
414 nm
503 nm
725 nm
Wavelength λ (nm)
Planck’s Law Curves B
T(λ)
(W
m-2
sr-1
Hz-1
)
——7000 K ——5770 K ——4000 K
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 23
Color balancing Effect of different illuminants can be cancelled only in the spectral domain (impractical) Color balancing in 3-d color space is practical approximation Color constancy in human visual system: gain control in cone space LMS [von Kries,1902] Von Kries hypothesis applied to image acquisition devices (cameras, scanners)
How to determine kL, kM, kS automatically?
3x3 matrix
kL
kM
kS
3x3 matrix
Camera sensors
R
G
B 1T 2T
L
M
S
L’
M’
S’
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 24
Color balancing (cont.)
Von Kries hypothesis
If illumination (or a patch of white in the scene) is known, calculate
0 00 00 0
L
M
S
L k LM k MS k S
′ ′ = ′
; ; desired desired desiredL M S
actual actual actual
L M Sk k kL M S
= = =
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 25
Color balancing with unknown illumination
Gray-world
Scale-by-max Shades-of-gray
[Finlayson, Trezzi, 2004]
» Special cases: gray-world (p = 1), scale-by-max ( ) » Best performance for p ≈ 6
Refinements: smooth image, exclude saturated color/dark pixels, use spatial derivatives instead (“gray-edge,” “max-edge”) [van de Weijer, 2007])
p = ∞
kL L
x ,y∑ p
x, y
1p
= kM Mx ,y∑ p
x, y
1p
= kS Sx ,y∑ p
x, y
1p
kL L x, y = kM
x ,y∑ M x, y =
x ,y∑ kS S
x ,y∑ x, y
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 26
Color balancing example
Original Gray-world Scale-by-max Gray-edge Max-edge Shades-of-gray
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 27
Color balancing example
Original image courtesy Ciurea and Funt
Original Gray-world Scale-by-max
Gray-edge Max-edge Shades-of-gray
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 28
Daylight D65 CIE observer
Illuminant A CIE observer
Daylight D65 cheap camera
Digital Image Processing: Bernd Girod, © 2013 Stanford University -- Color 29
Color conversion cheat sheet (e.g. for HW2)
great website for insights, every possible color conversion scheme, and much more: www.brucelindbloom.com spectrum to CIE XYZ: CIE XYZ to CIE xyY: (no illuminant)
CIE XYZ to CIE RGB: approximation of CIE gamma:
CIE RGB to CIE XYZ: