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 1
Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 2 Newton s Prism Experiment - 1666
Color: visible range of the electromagnetic spectrum 380 nm 760 nm Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 3
Human retina [Roorda, Williams, 1999] Pseudo-color image of nasal retina, 1 degree eccentricity, in two male subjects, scale bar 5 micron Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 4
Absorption of light in the cones of the human retina Sensitivity 535 nm 445 nm 575 nm L: S R λ M: S G λ S: S B λ Note: curves are normalized. Much lower sensitivity to Blue, since fewer S-cones absorb less light. Wavelength λ (nm) Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 5
Three-receptor model of color perception α R C ( λ ) Spectral energy distribution of incident light λ λ G ( ) ( ) S λ C λ dλ B ( ) ( ) S λ C λ dλ α G α B Effective cone stimulation ( tristimulus values ) [T. Young, 1802] [J.C. Maxwell, 1890] Different spectra can map into the same tristimulus values and hence look identical ( metamers ) Three numbers suffice to represent any color Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 6
What is the smallest number of monochromatic components that the spectral energy distribution of light that appears white to a human observer must contain???? (a) 1 (b) 2 (c) 3 (d) infinitely many Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 7
Color matching Suppose 3 primary light sources with spectra P k (λ), 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? C( λ)= β 1 P 1 ( λ) ( ) ( ) +β 2 P 2 λ +β 3 P 3 λ λ λ λ R G ( ) ( ) S λ C λ dλ ( ) ( ) S λ C λ dλ B ( ) ( ) S λ C λ dλ α R α G α B α i = S i ( λ) β 1 P 1 ( λ)+ β 2 P 2 ( λ)+ β 3 P 3 ( λ) dλ λ = β 1 K i,1 + β 2 K i,2 + β 3 K i,3 with K i, j = S i ( λ) P j ( λ)dλ λ Color matching is linear! Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 8
Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 9 Additive vs. subtractive color mixing
Color matching experiment Eyes Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 10 Courtesy B. Wandell, from [Foundations of Vision, 1996]
Spectral matching functions RGB Color Matching Functions Tristimulus values r λ g λ b λ 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. Wavelength λ (nm) 435.8 nm 546.1 nm 700.0 nm Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 11
The human eye can distinguish monochromatic light between 650 and 700 nm only based on intensity, but not based on color. (a) True (b) False??? Spectral matching curves for any set of three primary lights are a linear combination of the 1931 CIE RGB color matching functions (a) False (b) True, but only if the primaries are monochromatic lights (c) True, but only if the tristimulus values of the primaries are linearly independent (d) True in general Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 12
Luminosity function Peak 555nm Monochromatic test light reference light Luminous efficiency Wavelength λ (nm) Experiment: Match the brightness of a white reference light and a monochromatic test light of wavelength λ Links photometric to radiometric quantities Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 13
CIE 1931 XYZ color system Tristimulus values XYZ Color Matching Functions x λ y λ z λ Properties: All positive spectral matching functions X.490.310.200 Rλ Y =.177.813.011 Gλ Z.000.010.990 B λ Y corresponds to luminance Equal energy white: X=Y=Z Virtual primaries Wavelength λ (nm) Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 14
Color gamut and chromaticity Z Y x y = = X X + Y + Z Y X + Y + Z X+Y+Z=1 Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 15 X
Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 16 CIE chromaticity diagram
Perceptual non-uniformity of xy chromaticity Just noticeable chromaticity differences (10X enlarged) [MacAdam, 1942] Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 17
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 18
It is not possible to build a display that directly uses X, Y, Z as primary light sources. (a) True (b) False??? With additive color mixing, how many primaries are required to perfectly reproduce every possible color? (a) 2 (b) 3 (c) 4 (d) 256 (e) infinitely many Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 19
White at different color temperatures 10000 25000 T c (K) 2500 3000 4000 6000 2000 1500 Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 20
Blackbody radiation Planck s Law Curves B T (λ) (W m -2 sr -1 Hz -1 ) 414 nm 503 nm 725 nm 7000 K 5770 K 4000 K Planck s Law, 1900 B T (λ) = 2hc2 / λ 5 e hc/λkt 1 Wien s Law Wavelength λ (nm) Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 21
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) Camera sensors 3x3 matrix L k M M k L L M 3x3 matrix T1 S 2 S T γ γ γ R γ G γ B γ k S How to determine k L, k M, k S automatically? Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 22
Color balancing (cont.) Von Kries hypothesis L kl 0 0 L M = 0 km 0 M S 0 0 k S S If illumination (or a patch of white in the scene) is known, calculate L M S kl = ; km = ; ks = L M S desired desired desired actual actual actual Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 23
Color balancing with unknown illumination Gray-world k L x,y L x, y = k M M x, y = k S S x,y x,y x, y Scale-by-max k L max x,y L x, y = k M max x,y M x, y = k S max x,y S x, y Shades-of-gray [Finlayson, Trezzi, 2004] k L L p x,y x, y 1 p = k M M p x, y x,y 1 p = k S S p x,y x, y 1 p» Special cases: gray-world (p = 1), scale-by-max ( p = )» 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]) Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 24
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 25
Color balancing example Original Gray-world Scale-by-max Gray-edge Max-edge Shades-of-gray Original image courtesy Ciurea and Funt Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 26
Even if the spectrum of the illuminant is known exactly, perfect color correction is generally not possible in a 3-dimensional color space. (a) True (b) False??? For accurate color reproduction, the absorption spectra of an R,G,B image sensor (a) Must exactly match the absorption spectra of the L,M,S cones in the human retina. (b) Must be a linear combination of the absorption spectra of the L,M,S cones. (c) Can be any set of 3 functions that are not linearly dependent and cover the entire visible spectrum. Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 27
Daylight D65 CIE observer Daylight D65 cheap camera Illuminant A CIE observer Digital Image Processing: Bernd Girod, 2013 Stanford University -- Color 28