CSE 473/573 Computer Vision and Image Processing (CVIP) Ifeoma Nwogu Lecture 6 – Color.

Slides:



Advertisements
Similar presentations
13- 1 Chapter 13: Color Processing 。 Color: An important descriptor of the world 。 The world is itself colorless 。 Color is caused by the vision system.
Advertisements

1 Color Kyongil Yoon VISA Color Chapter 6, “Computer Vision: A Modern Approach” The experience of colour Caused by the vision system responding.
Color Phillip Otto Runge ( ). Overview The nature of color Color processing in the human visual system Color spaces Adaptation and constancy White.
Computational Photography: Color perception, light spectra, contrast Connelly Barnes.
Computer Vision CS 776 Spring 2014 Color Prof. Alex Berg (Slide credits to many folks on individual slides)
Colour Reading: Chapter 6 Light is produced in different amounts at different wavelengths by each light source Light is differentially reflected at each.
Color Image Processing
School of Computing Science Simon Fraser University
Algorithms and Applications in Computer Vision Lihi Zelnik-Manor
Review: Image formation
SWE 423: Multimedia Systems Chapter 4: Graphics and Images (2)
Lecture 30: Light, color, and reflectance CS4670: Computer Vision Noah Snavely.
Capturing Light… in man and machine : Computational Photography Alexei Efros, CMU, Fall 2006 Some figures from Steve Seitz, Steve Palmer, Paul Debevec,
What is color for?.
Capturing Light… in man and machine : Computational Photography Alexei Efros, CMU, Fall 2010.
Capturing Light… in man and machine : Computational Photography Alexei Efros, CMU, Fall 2008.
1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.
Colors and sensors Slides from Bill Freeman, Fredo Durand, Rob Fergus, and David Forsyth, Alyosha Efros.
1 CSCE441: Computer Graphics: Color Models Jinxiang Chai.
CS559-Computer Graphics Copyright Stephen Chenney Color Recap The physical description of color is as a spectrum: the intensity of light at each wavelength.
Why Care About Color? Accurate color reproduction is commercially valuable - e.g. Kodak yellow, painting a house Color reproduction problems increased.
Color Monday, Feb 7 Prof. Kristen Grauman UT-Austin.
Light and Color Computational Photography Derek Hoiem, University of Illinois 09/08/11 “Empire of Light”, Magritte.
9/14/04© University of Wisconsin, CS559 Spring 2004 Last Time Intensity perception – the importance of ratios Dynamic Range – what it means and some of.
Color Based on Kristen Grauman's Slides for Computer Vision.
Color Computational Photography MIT Feb. 14, 2006 Bill Freeman and Fredo Durand.
Any questions about the current assignment? (I’ll do my best to help!)
1 Color vision and representation S M L.
Chapter 3: Colorimetry How to measure or specify color? Color dictionary?
Color Phillip Otto Runge ( ). What is color? Color is the result of interaction between physical light in the environment and our visual system.
Light and Color Jehee Lee Seoul National University With a lot of slides stolen from Alexei Efros, Stephen Palmer, Fredo Durand and others.
Color in image and video Mr.Nael Aburas. outline  Color Science  Color Models in Images  Color Models in Video.
Topic 5 - Imaging Mapping - II DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
CSC361/ Digital Media Burg/Wong
Graphics Lecture 4: Slide 1 Interactive Computer Graphics Lecture 4: Colour.
Sensory Information Processing
Three-Receptor Model Designing a system that can individually display thousands of colors is very difficult Instead, colors can be reproduced by mixing.
1 CSCE441: Computer Graphics: Color Models Jinxiang Chai.
Introduction to Computer Graphics
Color Models. Color models,cont’d Different meanings of color: painting wavelength of visible light human eye perception.
776 Computer Vision Jan-Michael Frahm & Enrique Dunn Spring 2012.
ECE 638: Principles of Digital Color Imaging Systems Lecture 3: Trichromatic theory of color.
David Luebke 1 2/5/2016 Color CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Capturing Light… in man and machine CS194: Image Manipulation & Computational Photography Alexei Efros, UC Berkeley, Fall 2015.
Color Phillip Otto Runge ( ). What is color? Color is a psychological property of our visual experiences when we look at objects and lights, not.
Hebrew University Image Processing Exercise Class 12: Color Many slides from Freeman and Durand Color Exercise Class 12.
Chapter 9: Perceiving Color. Figure 9-1 p200 Figure 9-2 p201.
09/10/02(c) University of Wisconsin, CS559 Fall 2002 Last Time Digital Images –Spatial and Color resolution Color –The physics of color.
1 of 32 Computer Graphics Color. 2 of 32 Basics Of Color elements of color:
CSE 185 Introduction to Computer Vision
Color Computer Vision Martin Jagersand Readings: – Szeliski, – Forsyth and Ponce, Chapter 6 What is the physics of color? How is color sensed? How.
Color Models Light property Color models.
ECE 638: Principles of Digital Color Imaging Systems
Capturing Light… in man and machine
Color Image Processing
Color Image Processing
(c) University of Wisconsin, CS559 Spring 2002
Physiology of Vision: a swift overview
Capturing Light… in man and machine
Chapter 6: Color Image Processing
Color Image Processing
Color April 16th, 2015 Yong Jae Lee UC Davis.
Color Representation Although we can differentiate a hundred different grey-levels, we can easily differentiate thousands of colors.
Computer Vision Lecture 4: Color
Outline Color perception Introduction Theories of color perception
Color Image Processing
Capturing Light… in man and machine
Slides taken from Scott Schaefer
Color Image Processing
Color Phillip Otto Runge ( ).
Presentation transcript:

CSE 473/573 Computer Vision and Image Processing (CVIP) Ifeoma Nwogu Lecture 6 – Color

Schedule Last class – Image formation – photometric properties Today – Color Readings for today: Forsyth and Ponce Chp. 3

What is color? Color is a psychological property of our visual experiences when we look at objects and lights, not a physical property of those objects or lights (S. Palmer, Vision Science: Photons to Phenomenology) Color is the result of interaction between physical light in the environment and our visual system

Color Human encoding of color Physics of color Color representation White balancing Applications in computer vision

Overview of Color Human encoding of color Physics of color Color representation White balancing Applications in computer vision

The Eye The human eye is a camera! But what’s the “film”? Lens - changes shape by using ciliary muscles (to focus on objects at different distances) Pupil - the hole (aperture) whose size is controlled by the iris Iris - colored annulus with radial muscles Retina - photoreceptor cells (cones and rods) – “the film” Slide by Steve Seitz

The Retina

Light sensitive receptors Cones – responsible for color vision – less sensitive – operate in high light Rods – responsible for gray-scale vision (intensity based perception) – highly sensitive – operate at night Rods and cones are non- uniformly distributed on the retina – Fovea - Small region (1 or 2°) at the center of the visual field containing the highest density of cones – and no rods Slide by Steve Seitz pigment molecules

Color matching

Color matching experiment 1 Source: W. Freeman

Color matching experiment 1 p 1 p 2 p 3 Source: W. Freeman

Color matching experiment 1 p 1 p 2 p 3 Source: W. Freeman

Color matching experiment 1 p 1 p 2 p 3 The primary color amounts needed for a match Source: W. Freeman

Color matching experiment 2 Source: W. Freeman

Color matching experiment 2 p 1 p 2 p 3 Source: W. Freeman

Color matching experiment 2 p 1 p 2 p 3 Source: W. Freeman

Color matching experiment 2 p 1 p 2 p 3 We say a “negative” amount of p 2 was needed to make the match, because we added it to the test color’s side. The primary color amounts needed for a match: p 1 p 2 p 3 Source: W. Freeman

Trichromacy In color matching experiments, most people can match any given light with three primaries – Primaries must be independent For the same light and same primaries, most people select the same weights – Exception: color blindness Trichromatic color theory – Three numbers seem to be sufficient for encoding color – Dates back to 18 th century (Thomas Young)

Grassman’s Laws Color matching appears to be linear If two test lights can be matched with the same set of weights, then they match each other: – Suppose A = u 1 P 1 + u 2 P 2 + u 3 P 3 and B = u 1 P 1 + u 2 P 2 + u 3 P 3. Then A = B. If we mix two test lights, then mixing the matches will match the result: – Suppose A = u 1 P 1 + u 2 P 2 + u 3 P 3 and B = v 1 P 1 + v 2 P 2 + v 3 P 3. Then A + B = (u 1 +v 1 ) P 1 + (u 2 +v 2 ) P 2 + (u 3 +v 3 ) P 3. If we scale the test light, then the matches get scaled by the same amount: – Suppose A = u 1 P 1 + u 2 P 2 + u 3 P 3. Then kA = (ku 1 ) P 1 + (ku 2 ) P 2 + (ku 3 ) P 3.

Physiology of color vision © Stephen E. Palmer, 2002 Three kinds of cones: Ratio of L to M to S cones: approx. 10:5:1 Almost no S cones in the center of the fovea S, M and L cones are respectively sensitive to short-, Medium- and long-wavelength lights

Interaction of light and surfaces Reflected color is the result of interaction of light source spectrum with surface reflectance

Interaction of light and surfaces What is the observed color of any surface under monochromatic light? Olafur Eliasson, Room for one color

Overview of Color Human encoding of color Physics of color Color representation White balancing

Any source of light can be completely described physically by its spectrum: the amount of energy emitted (per time unit) at each wavelength nm. © Stephen E. Palmer, 2002 Relative spectral power The physics of light

Electromagnetic spectrum Human Luminance Sensitivity Function

Some examples of the spectra of light sources © Stephen E. Palmer, 2002 Rel. power Spectra of light sources

Source: Popular Mechanics

Some examples of the reflectance spectra of surfaces Wavelength (nm) % Light Reflected Red Yellow Blue Purple © Stephen E. Palmer, 2002 Reflectance spectra of surfaces

Spectra of some real-world surfaces

Color Human encoding of color Physics of color Color representation White balancing Applications in computer vision

Linear color spaces Defined by a choice of three primaries The coordinates of a color are given by the weights of the primaries used to match it mixing two lights produces colors that lie along a straight line in color space mixing three lights produces colors that lie within the triangle they define in color space

Linear color spaces How to compute the weights of the primaries to match any spectral signal? p 1 p 2 p 3 ? Given: a choice of three primaries and a target color signal Find: weights of the primaries needed to match the color signal p 1 p 2 p 3 A = u 1 P 1 + u 2 P 2 + u 3 P 3.

Color matching functions How to compute the weights of the primaries to match any spectral signal? Let c(λ) be one of the matching functions, and let t(λ) be the spectrum of the signal. Then the weight of the corresponding primary needed to match t is λ Matching functions, c(λ) Signal to be matched, t(λ)

Computing color matches How do we compute the weights that will yield a perceptual match for any test light using a given set of primaries? 1.Select primaries 2.Estimate their color matching functions: observer matches series of monochromatic lights, one at each wavelength 3.Multiply matching functions and test light … … …

Foundations of Vision, by Brian Wandell, Sinauer Assoc., 1995 Slide credit: W. Freeman Color matching functions for a particular set of primaries p 1 = nm p 2 = nm p 3 = nm Rows of matrix C Computing color matches

matches Now have matching functions for all monochromatic light sources, so we know how to match a unit of each wavelength. … Arbitrary new spectral signal is a linear combination of the monochromatic sources. t Computing color matches

Fig from B. Wandell, 1996 Computing color matches So, given any set of primaries and their associated matching functions ( C ), we can compute weights ( w ) needed on each primary to give a perceptual match to any test light t (spectral signal).

Why is computing the color match for any color signal for a given set of primaries useful? – Want the colors in the world, on a monitor, and in a print format to all look the same. – Want to paint a carton of Kodak film with the Kodak yellow color. – Want to match skin color of a person in a photograph printed on an ink jet printer to their true skin color. Adapted from W. Freeman Computing color matches Image credit: pbs.org

Linear color spaces: RGB space Primaries are monochromatic lights (for monitors, they correspond to the three types of phosphors) Subtractive matching required for some wavelengths RGB matching functions RGB primaries

Linear color spaces: RGB space Single wavelength primaries Good for devices (e.g., phosphors for monitor), but not for perception

Linear color spaces: CIE XYZ Established by the commission international d’eclairage (CIE), 1931 Usually projected for 2D visualization as: (x,y) = (X/(X+Y+Z), Y/(X+Y+Z)) The Y parameter corresponds to brightness or luminance of a color Volume of all visible colors in CIE XYZ cone with vertex at origin Intersect the cone with plane X+Y+Z =1 to Get the 2-d CIE XYZ space

Linear color spaces: CIE XYZ Matching functions

Nonlinear color spaces: HSV Perceptually meaningful dimensions: Hue, Saturation, Value (Intensity)

Distances in color space Since it is hard to reproduce color exactly, it is important to know whether a color difference would be noticeable to a human viewer. – therefore, compare the significance of small color differences to several people – Humans can determine just noticeable differences, which when plotted form boundaries of indistinguishable colors. – In CIE XY, the properties of these boundary ellipses depend on where in the space they occur – Euclidean distance is therefore a poor indicator of the significance of color differences. ellipses would be more circular in a more uniform space distances in coordinate space would better represent the difference between 2 colors

Distances in color space Are distances between points in a color space perceptually meaningful? Not necessarily: CIE XYZ is not a uniform color space, so magnitude of differences in coordinates are poor indicator of color “distance”.

Uniform color spaces Unfortunately, differences in x,y coordinates do not reflect perceptual color differences CIE u’v’ is a projective transform of x,y to make the ellipses more uniform McAdam ellipses: Just noticeable differences in color

Attempt to correct this limitation by remapping color space so that just- noticeable differences are contained by circles  distances more perceptually meaningful. Examples: – CIE u’v’ – CIE Lab Uniform color spaces CIE XYZ CIE u’v’ CIE LAB is now almost universally the most popular uniform color space

Color Human encoding of color Physics of color Color representation White balancing Applications in computer vision

White balance When looking at a picture on screen or print, our eyes are adapted to the illuminant of the room, not to that of the scene in the picture When the white balance is not correct, the picture will have an unnatural color “cast” incorrect white balance correct white balance

White balance Light SourcesColor Temperature in K Clear Blue Sky10,000 to 15,000 Overcast Sky6,000 to 8,000 Noon Sun and Clear Sky6,500 Sunlight Average5,400 to 6,000 Electronic Flash5,400 to 6,000 Household Lighting2,500 to 3, watt Bulb2, watt Bulb2, watt Bulb2, watt Bulb2, watt Bulb2,650 Candle Flame1,200 to 1,500 Related to the concept of color temperature. – a way of measuring the quality of a light source. – unit for measuring this ratio is in degree Kelvin (K). WB is based on the ratio of blue light to red light – green light is ignored. A light with larger Kelvin value has more blue lights than one with value (lower color temperature)

White balance Film cameras: – Different types of film or different filters for different illumination conditions Digital cameras: – Automatic white balance – White balance settings corresponding to several common illuminants – Custom white balance using a reference object

White balance Von Kries adaptation – Multiply each channel by a gain factor Gray card – Take a picture of a neutral object (white or gray) – Deduce the weight of each channel If the object is recoded as r w, g w, b w, use weights 1/r w, 1/g w, 1/b w

White balance Without gray cards: we need to “guess” which pixels correspond to white objects Gray world assumption – The image average r ave, g ave, b ave is gray – Use weights 1/r ave, 1/g ave, 1/b ave Brightest pixel assumption – Highlights usually have the color of the light source – Use weights inversely proportional to the values of the brightest pixels Gamut mapping – Gamut: convex hull of all pixel colors in an image – Find the transformation that matches the gamut of the image to the gamut of a “typical” image under white light Use image statistics, learning techniques

White balance by recognition Key idea: for each of the semantic classes present in the image, – compute the illuminant that transforms the pixels assigned to that class – Do this so that the average color of that class matches the average color of the same class in a database of “typical” images – Use learning techniques to represent the distribution of “typical images” J. Van de Weijer, C. Schmid and J. Verbeek, Using High-Level Visual Information for Color Constancy, ICCV 2007.Using High-Level Visual Information for Color Constancy

Mixed illumination When there are several types of illuminants in the scene, different reference points will yield different results Reference: moonReference: stone

Spatially varying white balance E. Hsu, T. Mertens, S. Paris, S. Avidan, and F. Durand, “Light Mixture Estimation for Spatially Varying White Balance,” SIGGRAPH 2008Light Mixture Estimation for Spatially Varying White Balance InputAlpha mapOutput

Given an input image (a), extract dominant material colors using a voting technique (pixels corresponding to white material colors) (b); and brown material colors (c). Estimate the local relative contributions of each light (d). Voting scheme only labels reliable pixels so unreliable pixels, shown in blue, are inferred using an interpolation scheme (e). The mixture information can then be used to compute a visually pleasing white balance (f).

Assumptions from that paper There are two illuminant types present in the scene and their colors are known beforehand. Scenes are dominated by only a small number of material colors. In other words, the set of reflectance spectra is sparse. The interaction of light can be described using RGB channels only, instead of requiring full spectra. Surfaces are Lambertian and non-fluorescent, so image color is the product of illumination and reflectance in each channel. Color bleeding due to indirect illumination can be ignored. Lesson: there are still many open problems in vision that are only partially solved

Color Human encoding of color Physics of color Color representation White balancing Applications in computer vision

Uses of color in computer vision Color histograms for image matching Swain and Ballard, Color Indexing, IJCV 1991.Color Indexing

Uses of color in computer vision Image segmentation and retrieval C. Carson, S. Belongie, H. Greenspan, and J. Malik, Blobworld: Image segmentation using Expectation-Maximization and its application to image querying, ICVIS 1999.

Uses of color in computer vision Color-based image retrieval Given collection (database) of images: – Extract and store one color histogram per image Given new query image: – Extract its color histogram – For each database image: Compute intersection between query histogram and database histogram – Sort intersection values (highest score = most similar) – Rank database items relative to query based on this sorted order

Example database Color-based image retrieval

Example retrievals Color-based image retrieval

Example retrievals Color-based image retrieval

Uses of color in computer vision Skin detection M. Jones and J. Rehg, Statistical Color Models with Application to Skin Detection, IJCV 2002.Statistical Color Models with Application to Skin Detection

Uses of color in computer vision Building appearance models for tracking D. Ramanan, D. Forsyth, and A. Zisserman. Tracking People by Learning their Appearance. PAMI 2007.Tracking People by Learning their Appearance

Next class Linear filters Readings for next lecture: – Forsyth and Ponce Chp 4.1, 4.2; Szeliski (optional) Readings for today: – Forsyth and Ponce 3; Szeliski (optional)

Questions