1 / 46

H331: Computer Graphics

H331: Computer Graphics. http://www.cs.kuleuven.ac.be/~graphics/H331/ Philip Dutré Department of Computer Science Wednesday, April 30. Today. Color & Perception Chapter 12. Shading …. 5. 10. 27. n = 3. 200. 0.1. 0.25. k s = 0.5. (by David Kurlander, Columbia University).

mali
Télécharger la présentation

H331: Computer Graphics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. H331: Computer Graphics http://www.cs.kuleuven.ac.be/~graphics/H331/Philip Dutré Department of Computer Science Wednesday, April 30

  2. Today • Color & Perception • Chapter 12

  3. Shading … 5 10 27 n = 3 200 0.1 0.25 ks = 0.5 (by David Kurlander, Columbia University)

  4. Shading • Repeat shading formula for each color channel red, green, blue • R,G,B “works”, because most output devices use R,G,B phosphors

  5. Color in CG • How are colors described in numerical terms? • How do the numbers correspond to daily descriptions of colors? • How are colors compared? • What range of colors can we display on an output device? • …

  6. Color in CG • How can a color be reproduced on a TV screen, using only 3 phosphors? R,G,B ? (PCG-Cornell University)

  7. Color in CG • How can a color be reproduced on a printer, using only 3 inks? CMY ? (PCG-Cornell University)

  8. What is color? • Light = electro-magnetic waves • Visible spectrum • 400 nm (violet)  700 nm (red) wavelength

  9. Power Power 400 Wavelength (nm) 700 400 Wavelength (nm) 700 D55: typical sunlight D65: typical average daylight D75: typical ‘north-sky’ light Power distributions of light sources Test lamp CIE standard (PCG-Cornell University)

  10. Reflectance distributions (PCG-Cornell University)

  11. Reflected spectrum Source Spectrum Product Reflectance Spectrum ? X (PCG-Cornell University)

  12. Fovea gaze Optical center Blind Spot Human eye (PCG-Cornell University)

  13. Human eye: retina Light passes through blood vessels & retinal layers before reaching rods & cones (PCG-Cornell University)

  14. Human eye: rods and cones Rods,Cones in Foveola (PCG-Cornell University)

  15. Human eye: rods and cones • Cones: color-sensitive cells • 3 types, respond to particular ‘color’ • ~6M cones in human eye • Rods • Sensitive to low levels of light • (colors disappear when it’s dark)

  16. Cone responses • S,M,L cones • Each type of cone is sensitive to a specific spectrum of light • Trichromatic visual system (PCG-Cornell University)

  17. P l 400 700 Trichromacy X This is what we ‘see’ S,M,L

  18. P l 400 700 Color metamers • Metamers produce the same visual sensation S1,M1,L1 X = P S2,M2,L2 X l 400 700

  19. Advantage of metamers: • Color on a monitor produces the same visual sensation as the ‘real’ color (PCG-Cornell University)

  20. How to describe colors? • Basic idea: describe a specific power spectrum P(l) that produces the visual sensation of the desired color

  21. Color Matching • Experiment: match a sample light with 3 test lights C(l) B(l) sample lamp S(l) A(l) observer

  22. Color Matching • Adjust intensity of 3 test lights, such that we have metamers: S(l) = aA(l) + bB(l) + cC(l) (read as: ‘are metamers’)

  23. Color Algebra • If (S(l) = P(l)) then (S(l)+N(l) = P(l)+N(l)) • If (S(l) = P(l)) then (aS(l) = aP(l))

  24. Color Matching • Color perception is 3-dimensional • S,M,L responses •  3 test lights R(l), G(l), B(l) • Think “red, “green, “blue” • Chosen because of cone responses • Any color C(l): C(l) = rR(l) + gG(l) + bB(l)

  25. 700 nm 546 nm Pure spectral Light (single wavelength) 438 nm observer Color Matching mono(l) = r(700 nm) + g(546 nm) + b(438 nm)

  26. 700 nm 546 nm Orange (600 nm) 438 nm observer Color Matching (600 nm) = 0.37(700 nm) + 0.08(546 nm) + 0.0(438 nm)

  27. Color Matching mono(l) = r(700 nm) + g(546 nm) + b(438 nm) Or … mono(l) = r (l) (700 nm) + g (l) (546 nm) + b (l) (438 nm) Color matching functions Normalization:

  28. Color Matching functions (PCG-Cornell University)

  29. Color Matching functions • Negative values? spectral light 700 nm 546 nm 438 nm observer

  30. Summary so far • We have 3 test lights: • 3 because color perception is 3-D (S,M,L) • Chosen in red, green, blue wavelengths • Every pure spectral color (power = 1): Color matching functions, can be negative

  31. So … • Any color with spectrum C(l):

  32. C l 400 700 So… r,g,b X

  33. Problems • Negative values! • Which R,G,B to choose? • Different R,G,B produce different color matching functions • Answer: CIE XYZ standardized color system

  34. XYZ color matching functions • 3 matching functions are chosen: • All positive • Computational convenience • standardized (PCG-Cornell University)

  35. C l 400 700 XYZ color matching functions x,y,z X

  36. XYZ color matching functions • X, Y, Z are NOT physical lights, they are defined only by their color matching functions • There is no color with x=1, y=0, z=0

  37. “Real” colors in RGB and XYZ (PCG-Cornell University)

  38. Chromaticity Diagram (PCG-Cornell University)

  39. Chromaticity Diagram

  40. I J K Chromaticity Diagram

  41. Monitor • Monitors have 3 types of phospors 0.012 Typical CRT 0.01 0.008 0.006 “B” Spectral Power (watts/m2) “G” 0.004 “R” “R” 0.002 0 350 400 450 500 550 600 650 700 750 λ(wavelength in nm) (PCG-Cornell University)

  42. Monitor color gamut • Not all colors are possible on a CRT • Chromaticity coordinates for each phosphor are different for each monitor

  43. Monitor • If you want to work correctly … • Compute everything in spectral space • Convert spectrum to XYZ • Convert XYZ to RGB (display device dependent) • Display RGB on device

  44. XYZ  RGB? • Find the XYZ coordinates of the primaries R, G, B: • Xr, Yr, Zr • Xg, Yg, Zg • Xb, Yb, Zb • Write color as linear combination in XYZ space • Same linear combination applies in RGB space

  45. XYZ  RGB? Example

  46. Interpolation in color space • for anti-aliasing • for Gouraud shading • for blending two images (fade-in, fade-out) • RGB, CIE: (affine transformation)straight lines  straight linessame interpolation results

More Related