CS6640 Computational Photography. 6. Color science for digital photography Steve Marschner

Similar documents
Color Science. What light is. Measuring light. CS 4620 Lecture 15. Salient property is the spectral power distribution (SPD)

Color Science. CS 4620 Lecture 15

Images. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 38

Introduction to Color Science (Cont)

Understand brightness, intensity, eye characteristics, and gamma correction, halftone technology, Understand general usage of color

To discuss. Color Science Color Models in image. Computer Graphics 2

COLOR. and the human response to light

COLOR and the human response to light

Color & Graphics. Color & Vision. The complete display system is: We'll talk about: Model Frame Buffer Screen Eye Brain

Color , , Computational Photography Fall 2017, Lecture 11

Color Image Processing. Gonzales & Woods: Chapter 6

A World of Color. Session 4 Color Spaces. OLLI at Illinois Spring D. H. Tracy

Image and video processing (EBU723U) Colour Images. Dr. Yi-Zhe Song

Color , , Computational Photography Fall 2018, Lecture 7

Computer Graphics Si Lu Fall /27/2016

Color. Fredo Durand Many slides by Victor Ostromoukhov. Color Vision 1

Color Computer Vision Spring 2018, Lecture 15

PERCEIVING COLOR. Functions of Color Vision

What is Color Gamut? Public Information Display. How do we see color and why it matters for your PID options?

University of British Columbia CPSC 414 Computer Graphics

Lecture: Color. Juan Carlos Niebles and Ranjay Krishna Stanford AI Lab. Lecture 1 - Stanford University

Visual Imaging and the Electronic Age Color Science

12/02/2017. From light to colour spaces. Electromagnetic spectrum. Colour. Correlated colour temperature. Black body radiation.

19. Vision and color

Capturing Light in man and machine

Color and Perception. CS535 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Light. intensity wavelength. Light is electromagnetic waves Laser is light that contains only a narrow spectrum of frequencies

CMPSCI 670: Computer Vision! Color. University of Massachusetts, Amherst September 15, 2014 Instructor: Subhransu Maji

Lecture 8. Color Image Processing

Multimedia Systems Color Space Mahdi Amiri March 2012 Sharif University of Technology

Today. Color. Color and light. Color and light. Electromagnetic spectrum 2/7/2011. CS376 Lecture 6: Color 1. What is color?

Waitlist. We ll let you know as soon as we can. Biggest issue is TAs

Mahdi Amiri. March Sharif University of Technology

Lecture Color Image Processing. by Shahid Farid

Digital Image Processing

Capturing Light in man and machine

Capturing Light in man and machine

12 Color Models and Color Applications. Chapter 12. Color Models and Color Applications. Department of Computer Science and Engineering 12-1

Color Image Processing EEE 6209 Digital Image Processing. Outline

Digital Image Processing Color Models &Processing

Oversubscription. Sorry, not fixed yet. We ll let you know as soon as we can.

Comparing Sound and Light. Light and Color. More complicated light. Seeing colors. Rods and cones

Vision and color. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

The Principles of Chromatics

University of British Columbia CPSC 314 Computer Graphics Jan-Apr Tamara Munzner. Color.

Colour. Cunliffe & Elliott, Chapter 8 Chapman & Chapman, Digital Multimedia, Chapter 5. Autumn 2016 University of Stirling

Colorimetry and Color Modeling

Fig Color spectrum seen by passing white light through a prism.

Achim J. Lilienthal Mobile Robotics and Olfaction Lab, AASS, Örebro University

Digital Image Processing

Colour. Why/How do we perceive colours? Electromagnetic Spectrum (1: visible is very small part 2: not all colours are present in the rainbow!

Color. Phillip Otto Runge ( )

MULTIMEDIA SYSTEMS

Color vision and representation

What is Color? Color is a human perception (a percept). Color is not a physical property... But, it is related the the light spectrum of a stimulus.

Capturing Light in man and machine

For a long time I limited myself to one color as a form of discipline. Pablo Picasso. Color Image Processing

Colors in Images & Video

Digital Image Processing COSC 6380/4393. Lecture 20 Oct 25 th, 2018 Pranav Mantini

Announcements. Electromagnetic Spectrum. The appearance of colors. Homework 4 is due Tue, Dec 6, 11:59 PM Reading:

Visual Perception. Overview. The Eye. Information Processing by Human Observer

Color images C1 C2 C3

Introduction. The Spectral Basis for Color

Introduction to Computer Vision CSE 152 Lecture 18

Colour. Electromagnetic Spectrum (1: visible is very small part 2: not all colours are present in the rainbow!) Colour Lecture!

COLOR. Elements of color. Visible spectrum. The Fovea. Lecture 3 October 30, Ingela Nyström 1. There are three types of cones, S, M and L

Capturing Light in man and machine

TIEA311 Tietokonegrafiikan perusteet kevät 2017

Reading for Color. Vision/Color. RGB Color. Vision/Color. University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013.

Color Image Processing

Lecture 3: Grey and Color Image Processing

A World of Color. Session 5 Colors of Things. OLLI at Illinois Spring D. H. Tracy

CS 89.15/189.5, Fall 2015 ASPECTS OF DIGITAL PHOTOGRAPHY COMPUTATIONAL. Image Processing Basics. Wojciech Jarosz

COLOR. Elements of color. Visible spectrum. The Human Visual System. The Fovea. There are three types of cones, S, M and L. r( λ)

Digital Image Processing. Lecture # 6 Corner Detection & Color Processing

What will be on the final exam?

Image Processing for Mechatronics Engineering For senior undergraduate students Academic Year 2017/2018, Winter Semester

What is Color. Color is a fundamental attribute of human visual perception.

Prof. Feng Liu. Winter /09/2017

Digital Image Processing. Lecture # 8 Color Processing

LECTURE 07 COLORS IN IMAGES & VIDEO

Radiometric and Photometric Measurements with TAOS PhotoSensors

6 Color Image Processing

Lecture Notes 11 Introduction to Color Imaging

Capturing Light in man and machine. Some figures from Steve Seitz, Steve Palmer, Paul Debevec, and Gonzalez et al.

Nikon D2x Simple Spectral Model for HDR Images

Color and perception Christian Miller CS Fall 2011

Reading. Foley, Computer graphics, Chapter 13. Optional. Color. Brian Wandell. Foundations of Vision. Sinauer Associates, Sunderland, MA 1995.

Color Outline. Color appearance. Color opponency. Brightness or value. Wavelength encoding (trichromacy) Color appearance

Color Perception. Color, What is It Good For? G Perception October 5, 2009 Maloney. perceptual organization. perceptual organization

Colors in images. Color spaces, perception, mixing, printing, manipulating...

Test 1: Example #2. Paul Avery PHY 3400 Feb. 15, Note: * indicates the correct answer.

Photometric Colorimetry

CSCI 1290: Comp Photo

Color image processing

Cvision 2. António J. R. Neves João Paulo Silva Cunha. Bernardo Cunha. IEETA / Universidade de Aveiro

Digital Image Processing

Multimedia Systems and Technologies

Bettina Selig. Centre for Image Analysis. Swedish University of Agricultural Sciences Uppsala University

CS 89.15/189.5, Fall 2015 ASPECTS OF DIGITAL PHOTOGRAPHY COMPUTATIONAL. Sensors & Demosaicing. Wojciech Jarosz

Transcription:

CS6640 Computational Photography 6. Color science for digital photography 2012 Steve Marschner 1

What visible light is One octave of the electromagnetic spectrum (380-760nm) NASA/Wikimedia Commons 2

What color is Colors are the sensations that arise from light energy with different wavelength distributions Color is a phenomenon of human perception; it is not a universal property of light Roughly speaking, things appear colored when they depend on wavelength and gray when they do not. 3

Measuring light Salient property is the spectral power distribution (SPD) the amount of light present at each wavelength units: Watts per nanometer (tells you how much power you ll find in a narrow range of wavelengths) for color, often use relative units when overall intensity is not important amount of light = 180 dλ (relative units) wavelength band (width dλ) wavelength (nm) 4

The problem of color science Build a model for human color perception That is, map a physical light description to a perceptual color sensation [Stone 2003]? Physical Perceptual 5

The eye as a measurement device We can model the low-level behavior of the eye by thinking of it as a light-measuring machine its optics are much like a camera its detection mechanism is also much like a camera [Greger et al. 1995] Light is measured by the photoreceptors in the retina they respond to visible light different types respond to different wavelengths 6

A simple light detector Produces a scalar value (a number) when photons land on it this value depends strictly on the number of photons detected each photon has a probability of being detected that depends on the wavelength there is no way to tell the difference between signals caused by light of different wavelengths: there is just a number This model works for many detectors: based on semiconductors (such as in a digital camera) based on visual photopigments (such as in human eyes) 7

A simple light detector 8

Light detection math Same math carries over to power distributions spectum entering the detector has its spectral power distribution (SPD), s(λ) detector has its spectral sensitivity or spectral response, r(λ) measured signal detector s sensitivity input spectrum 9

Light detection math or If we think of s and r as vectors, this operation is a dot product (aka inner product) in fact, the computation is done exactly this way, using sampled representations of the spectra. let λ i be regularly spaced sample points Δλ apart; then: this sum is very clearly a dot product 10

Cone Responses S,M,L cones have broadband spectral sensitivity S,M,L neural response is integrated w.r.t. λ we ll call the response functions r S, r M, r L Results in a trichromatic visual system S, M, and L are tristimulus values [source unknown] 11

Cone responses to a spectrum s 12

Colorimetry: an answer to the problem Wanted to map a physical light description to a perceptual color sensation Basic solution was known and standardized by 1930 Though not quite in this form more on that in a bit [Stone 2003] s Physical Perceptual 13

Basic fact of colorimetry Take a spectrum (which is a function) Eye produces three numbers This throws away a lot of information! Quite possible to have two different spectra that have the same S, M, L tristimulus values Two such spectra are metamers 14

Pseudo-geometric interpretation A dot product is a projection We are projecting a high dimensional vector (a spectrum) onto three vectors differences that are perpendicular to all 3 vectors are not detectable For intuition, we can imagine a 3D analog 3D stands in for high-d vectors 2D stands in for 3D Then vision is just projection onto a plane 15

Pseudo-geometric interpretation The information available to the visual system about a spectrum is three values this amounts to a loss of information analogous to projection on a plane Two spectra that produce the same response are metamers 16

Pseudo-geometric interpretation The information available to the visual system about a spectrum is three values this amounts to a loss of information analogous to projection on a plane Two spectra that produce the same response are metamers Questions? 16

Basic colorimetric concepts Luminance the overall magnitude of the the visual response to a spectrum (independent of its color) corresponds to the everyday concept brightness determined by product of SPD with the luminous efficiency function V λ that describes the eye s overall ability to detect light at each wavelength e.g. lamps are optimized to improve their luminous efficiency (tungsten vs. fluorescent vs. sodium vapor) [Stone 2003] 17

Luminance, mathematically Y just has another response curve (like S, M, and L) r Y is really called V λ V λ is a linear combination of S, M, and L Has to be, since it s derived from cone outputs 18

More basic colorimetric concepts Chromaticity what s left after luminance is factored out (the color without regard for overall brightness) scaling a spectrum up or down leaves chromaticity alone Dominant wavelength many colors can be matched by white plus a spectral color correlates to everyday concept hue Purity ratio of pure color to white in matching mixture correlates to everyday concept colorfulness or saturation 19

Color reproduction Have a spectrum s; want to match on RGB monitor match means it looks the same any spectrum that projects to the same point in the visual color space is a good reproduction Must find a spectrum that the monitor can produce that is a metamer of s [cs417 Greenberg] R, G, B? 20

Additive Color [source unknown] 21

LCD display primaries Curves determined by (fluorescent or LED) backlight and filters 22

Spatial integration [source unknown] 23

Color reproduction Say we have a spectrum s we want to match on an RGB monitor match means it looks the same any spectrum that projects to the same point in the visual color space is a good reproduction So, we want to find a spectrum that the monitor can produce that matches s that is, we want to display a metamer of s on the screen 24

Color reproduction We want to compute the combination of R, G, B that will project to the same visual response as s. 25

Color reproduction as linear algebra The projection onto the three response functions can be written in matrix form: 26

Color reproduction as linear algebra The spectrum that is produced by the monitor for the color signals R, G, and B is: Again the discrete form can be written as a matrix: 27

Color reproduction as linear algebra What color do we see when we look at the display? Feed C to display Display produces s a Eye looks at s a and produces V 28

Color reproduction as linear algebra Goal of reproduction: visual response to s and s a is the same: Substituting in the expression for s a, color matching matrix for RGB [source unknown] 29

Recap We now know how to match any color from the real world on a display We don t need to know the whole spectrum, only the projections onto S, M, and L response functions There is then a simple linear procedure to work out the combination of any 3 primaries to match the color 30

Recap We now know how to match any color from the real world on a display We don t need to know the whole spectrum, only the projections onto S, M, and L response functions There is then a simple linear procedure to work out the combination of any 3 primaries to match the color Questions? 30

Reflection from colored surface [Stone 2003] 31

Color constancy R. Beau Lotto 32

Color constancy R. Beau Lotto 32

Chromatic adaptation Objects have different spectra under different illuminants but your brain has no problem recognizing them anyway The human visual system automatically detects the illuminant color and adjusts for it so the same object (usually) looks (roughly) the same color under a wide range of illumination conditions this happens at a low level so you don t even notice But color constancy is not perfect and indeed can t be, with just 3 color receptors examples: sweater looks nice with pants in your closet, then looks different once you get out in the daylight 33

Chromatic adaptation Objects have different spectra under different illuminants but your brain has no problem recognizing them anyway The human visual system automatically detects the illuminant color and adjusts for it so the same object (usually) looks (roughly) the same color under a wide range of illumination conditions this happens at a low level so you don t even notice But color constancy is not perfect and indeed can t be, with just 3 color receptors examples: sweater looks nice with pants in your closet, then looks different once you get out in the daylight Questions? 33

Color spaces Need three numbers to specify a color but what three numbers? a color space is an answer to this question Stored numbers often map nonlinearly to intensity of primary enables nonuniform quantization (smaller quantization steps in dark) common scheme is R = (nr/255) ɣ Common example: monitor RGB define colors by what R, G, B signals will produce them on your monitor (in math, s = RR + GG + BB for some spectra R, G, B) device dependent (depends on gamma, phosphors, gains, ) if I choose RGB by looking at my monitor and send it to you, you may not see the same color also leaves out some colors (limited gamut), e.g. vivid yellow 34

Standard color spaces Standardized RGB (srgb) makes a particular monitor RGB standard standard quantization curve is almost gamma = 2.2 other color devices simulate that monitor by calibration srgb is usable as an interchange space; widely adopted today gamut is still limited Other RGB spaces Adobe RGB (more saturated primaries than srgb wider gamut) 35

A universal color space: XYZ Standardized by CIE (Commission Internationale de l Eclairage, the standards organization for color science) Based on three imaginary primaries X, Y, and Z (in math, s = XX + YY + ZZ) imaginary = only realizable by spectra that are negative at some wavelengths any stimulus can be matched with positive X, Y, and Z separates out luminance: X, Z have zero luminance, so Y tells you the luminance by itself [source unknown] 36

Separating luminance, chromaticity Luminance: Y Chromaticity: x, y, z, defined as since x + y + z = 1, we only need to record two of the three usually choose x and y, leading to (x, y, Y) coords 37

Chromaticity Diagram spectral locus purple line [source unknown] 38

Chromaticity Diagram [source unknown] 39

Color Gamuts Monitors/printers can t produce all visible colors Reproduction is limited to a particular domain [source unknown] For additive color (e.g. monitor) gamut is the triangle defined by the chromaticities of the three primaries. 40

RGB limitations http://dba.med.sc.edu/price/irf/adobe_tg/manage/ images/gamuts.jpg http://www.petrvodnakphotography.com/articles/ ColorSpace.htm slide by Frédo Durand, MIT

Color sensing Sensor is like eye gives you projection onto a 3D (or >3D) space but it is the wrong space! Problems with measured data we have RGB, but not the right RGB projection onto sensitivities, not coefficients for primaries (always) projection onto wrong space (always in practice) results depend strongly on illuminant (help!) 42

Sensor color properties Like eye, key property is the spectral sensitivity curves KAI-2093 Image Sensor COLOR WITH MICROLENS QUANTUM EFFICIENCY Absolute Quantum Efficiency 0.40 0.35 0.30 0.25 0.20 0.15 0.10 0.05 With clear cover glass In a real camera, there will be a filter to block infrared 0.00 400 500 600 700 800 900 1000 Wavelength (nm) Red Green Figure 5: Quantum Efficiency Spectrum for Color Filter Array Sensors 43

Camera color problem Given camera response, determine corresponding visual response This guess has to involve assumptions about which reflectance spectra are more likely Mathematical approach: assume spectra in fixed subspace Or, more often, just derive a transformation empirically spectrum s span of eye s spectral response functions 44

Camera color problem Given camera response, determine corresponding visual response This guess has to involve assumptions about which reflectance spectra are more likely Mathematical approach: assume spectra in fixed subspace Or, more often, just derive a transformation empirically span of camera s spectral response functions spectrum s span of eye s spectral response functions 44

Camera color problem Given camera response, determine corresponding visual response This guess has to involve assumptions about which reflectance spectra are more likely Mathematical approach: assume spectra in fixed subspace Or, more often, just derive a transformation empirically span of camera s spectral response functions camera metamer of s spectrum s span of eye s spectral response functions 44

Camera color problem Given camera response, determine corresponding visual response This guess has to involve assumptions about which reflectance spectra are more likely span of camera s spectral response functions camera metamer of s Mathematical approach: assume spectra in fixed subspace Or, more often, just derive a transformation empirically visual metamer of s s spectrum s span of eye s spectral response functions 44

Camera color problem Given camera response, determine corresponding visual response guess This guess has to involve assumptions about which reflectance spectra are more likely span of camera s spectral response functions camera metamer of s Mathematical approach: assume spectra in fixed subspace Or, more often, just derive a transformation empirically visual metamer of s s spectrum s span of eye s spectral response functions 44

Camera color rendering via subspace Assume spectrum s is a combination of three spectra 2 3 4s5 = Work out what combination it is 2 3 R 4G5 = B 2 3 2 3 a 1 4s 1 s 2 s 3 5 4a 2 5 a 3 02 3 2 r R @ 4 r G 5 4s 1 s 2 s 3 r B 31 2 5A 4 same math as additive color matching a 1 a 2 a 3 3 5 Project that combination onto visual response 2 4 S M L 3 5 = 2 4 r 3 2 S r M 5 4 3 02 s 1 s 2 s 3 5 @ 4 r 3 2 R r G 5 4 31 s 1 s 2 s 3 5A r L r B 1 2 3 4 R G5 B 45

Camera color rendering via subspace Assume spectrum s is a combination of three spectra 2 3 4s5 = 2 3 2 3 a 1 4s 1 s 2 s 3 5 4a 2 5 a 3 Work out what combination it is 2 4 a 3 1 a 2 5 = a 3 02 @ 4 r 3 2 R r G 5 4 31 s 1 s 2 s 3 5A r B 1 2 3 4 R G5 B same math as additive color matching Project that combination onto visual response 2 4 S M L 3 5 = 2 4 r 3 2 S r M 5 4 3 02 s 1 s 2 s 3 5 @ 4 r 3 2 R r G 5 4 31 s 1 s 2 s 3 5A r L r B 1 2 3 4 R G5 B 45

Empirical color transformation Baseline method: use Macbeth Color Checker a set of square patches of known color (these days you buy the MCC from X-Rite) Procedure 1. Photograph the color checker under uniform illumination 2. Measure the camera-rgb values of the 24 squares 3. Look up the XYZ colors of the 24 squares 4. Use linear least squares to find a 3x3 matrix that approximately maps the camera responses to the correct answers min M kc macbeth MC camera k 3 24 3 3 3 24 46

White balancing Problem with previous slide the camera-rgb colors depend on the illuminant the matrix M only works for the illuminant that was used to calibrate Solutions? calibrate separately for every illuminant? correct for illuminant first, then apply matrix! Hypothesis of von Kries: eye accounts for illuminant by simply scaling the three cone signals separately some evidence this is a reasonable model for the eye leads to von Kries transform : multiply by a diagonal matrix 47

Range of illuminants 48

White balancing steps 1. Determine the camera RGB of the illuminant (up to scale) professional/studio setting: photograph a gray card poor man s version: find something gray in the image alternative: let user tell the camera (tungsten, daylight, ) practical solution: Auto White Balance software guesses 2. Divide all the pixel values by the illuminant RGB undetermined scale factor maybe fix luminance to 1 maybe scale lowest channel of illuminant to 1 Now neutral colors are neutral! this is unbelievably important for getting nice color 49

Putting it together: color processing Calibrate your color matrix using a carefully white-balanced image when solving for M, constrain to ensure rows sum to 1 (then M will leave neutral colors exactly alone) For each photograph: 1. determine illuminant 2. apply von Kries 3. apply color matrix 4. apply any desired nonlinearity 5. display the image! 50

raw sensor color test image for Canon EOS 650D (Rebel T4i) from dpreview.com 51

white balanced raw sensor color test image for Canon EOS 650D (Rebel T4i) from dpreview.com 52

white balanced and matrixed to srgb test image for Canon EOS 650D (Rebel T4i) from dpreview.com 53