cs 184 computer graphics
play

CS-184: Computer Graphics Lecture #2: Color Prof. James OBrien - PowerPoint PPT Presentation

CS-184: Computer Graphics Lecture #2: Color Prof. James OBrien University of California, Berkeley V2016-F-02-1.0 With material from Ren Ng and Steve Marschner Announcements Sign up for Piazza Assignment 0: due Friday, September


  1. CS-184: Computer Graphics Lecture #2: Color Prof. James O’Brien University of California, Berkeley V2016-F-02-1.0 With material from Ren Ng and Steve Marschner Announcements • Sign up for Piazza • Assignment 0: due Friday, September 2nd., 11:59pm • See Piazza for class accounts • Email inst@eecs.berkeley.edu if unable to activate • Homework 1: due Wednesday, August. 31st, 1:00pm • Wait list... 2 02-Color.key - August 28, 2016

  2. Today • Color, Light, and Perception 3 What is Light? • Radiation in a particular frequency range 4 02-Color.key - August 28, 2016

  3. credit: Science Media Group. Spectral Colors • Light at a single frequency • Also called monochromatic (an overloaded term) R o y G. B i v • Bright and distinct in appearance White LED Reproductions only, can’t show a real spectral color! 6 02-Color.key - August 28, 2016

  4. Other Colors 7 Other Colors [Brian Wandell] Blue sky Solar disk 8 02-Color.key - August 28, 2016

  5. Other Colors Robert A. Rohde 9 Other Colors • Most colors seen are a mix light of several frequencies 10 Image from David Forsyth 02-Color.key - August 28, 2016

  6. Other Colors • Most colors seen are a mix light of several frequencies 11 Image from David Forsyth Reflected Light [Stone 2003] Φ ( λ ) L ( λ ) R ( λ ) Φ ( λ ) = L ( λ ) × R ( λ ) d λ 12 02-Color.key - August 28, 2016

  7. Simple Model of a Detector Φ ( λ ) S ( λ ) Φ ( λ ) × S ( λ ) Z s = Φ ( λ ) × S ( λ ) d λ 13 Perception -vs- Measurement • You do not “see” the spectrum of light • Eyes make limited measurements • Eyes physically adapt to circumstance • You brain adapts in various ways also • Weird psychological/psychophysical stuff also happens 14 02-Color.key - August 28, 2016

  8. Everything is Relative 15 Everything is Relative 16 02-Color.key - August 28, 2016

  9. Adapt 17 Adapt 18 02-Color.key - August 28, 2016

  10. Mach Bands 19 Everything’s Still Relative 20 02-Color.key - August 28, 2016

  11. Bezold Effect 21 Perception The eye does not see intensity values... 22 02-Color.key - August 28, 2016

  12. Perception The eye does not see intensity values... 23 Perception The eye does not see intensity values... 24 02-Color.key - August 28, 2016

  13. Perception 25 Eyes as Sensors • The human eye contains cells that sense light • Rods • No color (sort of) • Spread over the retina • More sensitive Image from Stephen Chenney • Cones • Three types of cones • Each sensitive to different frequency distribution • Concentrated in fovea (center of the retina) • Less sensitive 26 02-Color.key - August 28, 2016

  14. Eyes as Sensors Monochromatic Chromatic scotopic vision photopic vision (low light levels) (high light levels) 27 Eyes as Sensors 28 02-Color.key - August 28, 2016

  15. Cones • Each type of cone responds to different range of frequencies/wavelengths • Long, medium, short • Also called by color • Red, green, blue Normalized sensitivity curves • Misleading: “Red” does not mean your “red” cones are firing... 30 02-Color.key - August 28, 2016

  16. Recall Φ ( λ ) S ( λ ) Φ ( λ ) × S ( λ ) Z s = Φ ( λ ) × S ( λ ) d λ 31 Cones • Response of a cone is given by a convolution integral : Z continuous version of a dot product l = Φ ( λ ) × L ( λ ) d λ X l = Φ i × L i Z m = Φ ( λ ) × M ( λ ) d λ Z s = Φ ( λ ) × S ( λ ) d λ 32 02-Color.key - August 28, 2016

  17. Cones Images from David Forsyth • You can see that “red” and “green” respond to more more than just red and green... 33 Cones Images from David Forsyth • Our perception of color is not evenly spaced in wavelength. 34 02-Color.key - August 28, 2016

  18. Cones s Z l = Φ ( λ ) × L ( λ ) d λ Z m = Φ ( λ ) × M ( λ ) d λ Z s = Φ ( λ ) × S ( λ ) d λ m Marc Levoy l 35 Rods vs Cones Luminous efficacy (lumens/watt) 1800 1600 Scotopic (rod - dark adjusted) 1400 Photopic (cones - bright light) 1200 1000 800 600 400 200 0 350 400 450 500 550 600 650 700 750 800 Wavelength (nm) 36 02-Color.key - August 28, 2016

  19. 37 Cones and Metamers Cone response is an integral Z Z Z L = Φ ( λ ) L ( λ )d λ M = Φ ( λ ) M ( λ )d λ S = Φ ( λ ) S ( λ )d λ • 
 Metamers: Different light input produce 
 Φ 1 ( λ ) , Φ 2 ( λ ) same cone response L, M, S • Different spectra look the same • Useful for measuring color Brian Wandell 38 02-Color.key - August 28, 2016

  20. Trichromaticity Eye records color by 3 measurements We can “fool” it with combination of 3 signals So display devices (monitors, printers, etc.) can generate perceivable colors as mix of 3 primaries 39 Cone Responses are Linear • Response to stimulus is ( L 1 , M 1 , S 1 ) Φ 1 • Response to stimulus is ( L 2 , M 2 , S 2 ) Φ 2 • Then response to is ( L 1 + L 2 , M 1 + M 2 , S 1 + S 2 ) Φ 1 + Φ 2 • Response to is ( nL 1 , nM 2 , nS 1 ) n Φ 1 40 02-Color.key - August 28, 2016

  21. Additive Mixing • Given three primaries we agree on p 1 , p 2 , p 3 • Match generic input light with Φ = α p 1 + β p 2 + γ p 3 • Negative not realizable, but can add primary to test light • Color now described by α , β , γ • Example: computer monitor [RGB] 41 CRT Primaries • Curves determined by phosphor emission properties Ren Ng 42 02-Color.key - August 28, 2016

  22. LCD Primaries • Curves determined by (fluorescent) backlight and filters 43 Additive Color Matching Show test light spectrum on left Mix “primaries” on right until they match The primaries need not be RGB 44 02-Color.key - August 28, 2016

  23. Experiment 1 Slide from Durand and Freeman 06 45 Experiment 1 p 1 p 2 p 3 Slide from Durand and Freeman 06 46 02-Color.key - August 28, 2016

  24. Experiment 1 p 1 p 2 p 3 Slide from Durand and Freeman 06 47 Experiment 1 The primary color The primary color amounts needed amounts needed for a match for a match p 1 p 2 p 3 p 1 p 2 p 3 Slide from Durand and Freeman 06 48 02-Color.key - August 28, 2016

  25. Experiment 2 Slide from Durand and Freeman 06 49 Experiment 2 p 1 p 2 p 3 Slide from Durand and Freeman 06 50 02-Color.key - August 28, 2016

  26. Experiment 2 p 1 p 2 p 3 Slide from Durand and Freeman 06 51 Experiment 2 The primary color We say a amounts needed “negative” for a match: amount of p 2 was needed to make the match, because we p 1 p 2 p 3 added it to the test color’s side. p 1 p 2 p 3 p 1 p 2 p 3 Slide from Durand and Freeman 06 52 02-Color.key - August 28, 2016

  27. Color Matching Functions Kayvon Fatahalian λ 53 Color Matching Functions ¯ b ( λ ) r ( λ ) ¯ g ( λ ) ¯ Input wavelengths are CIE 1931 monochromatic primaries 54 02-Color.key - August 28, 2016

  28. Using Color Matching Functions • For a monochromatic light of wavelength 
 λ i we know the amount of each primary 
 necessary to match it: g ( λ i ) , ¯ r ( λ i ) , ¯ ¯ b ( λ i ) • Given a new light input signal  φ ( λ 1 )  . Φ = .   .   φ ( λ N ) • Compute the primaries necessary to match it 55 Using Color Matching Functions • Given color matching functions in matrix form and new light  r ( λ 1 ) ¯ r ( λ N ) ¯  . . . ¯ b ( λ ) r ( λ ) ¯ C = g ( λ 1 ) ¯ . . . ¯ g ( λ N )   ¯ ¯ g ( λ ) ¯ b ( λ 1 ) b ( λ N ) . . .  φ ( λ 1 )  . . Φ =   .   φ ( λ N ) • amount of each primary necessary to match is given by r ! g = C · Φ b 56 02-Color.key - August 28, 2016

  29. Using Color Matching Functions r ! r ! g g = C CRT · Φ = C LCD · Φ b b CRT LCD r ! r ! g = C LCD · C − P g CRT · b b LCD CRT r ! r ! g g = C CRT → LCD · b b LCD CRT r ! r ! g g = C display · b b display sRGB 57 CIE XYZ Imaginary set of color primaries with positive values, X, Y, Z 58 02-Color.key - August 28, 2016

  30. Rescaled XYZ to xyz Rescale X, Y, and Z to remove luminance, leaving chromaticity: x = X / ( X+Y+Z ) y = Y / ( X+Y+Z ) z = Z / ( X+Y+Z ) x+y+z = 1 Because the sum of the chromaticity values x, y, and z is always 1.0, a plot of any two of them loses no information Such a plot is a chromaticity diagram 59 CIE Chromaticity Diagram Pure (saturated) spectral colors around the edge of the plot Less pure (desaturated) colors in the interior of the plot White at the centroid of the plot (1/3, 1/3) 60 02-Color.key - August 28, 2016

  31. Gamut • Gamut is the chromaticities generated by a set of primaries • Because everything we’ve done is linear, interpolation between chromaticities on a chromaticity plot is also linear • Thus the gamut is the convex hull of the primary chromaticities • What is the gamut of the CIE 1931 primaries? 61 CIE 1931 RGB Gamut G = 546 nm R = 700 nm B = 438 nm 62 02-Color.key - August 28, 2016

  32. Other Gamuts (LCDs and NTSC) 63 Subtractive Mixing • Given three primaries we agree on p 1 , p 2 , p 3 • Make generic color with Φ = W − ( α p 1 + β p 2 + γ p 3 ) • Max limited by W • Color now described by α , β , γ • Example: ink [CMYK] Why 4th ink for black? 64 02-Color.key - August 28, 2016

Recommend


More recommend