ECE-161C Color. Nuno Vasconcelos ECE Department, UCSD (with thanks to David Forsyth)

Similar documents
Announcements. Lighting. Camera s sensor. HW1 has been posted See links on web page for readings on color. Intro Computer Vision.

Colour Reading: Chapter 6. Black body radiators

Lighting. Camera s sensor. Lambertian Surface BRDF

Color. Reading: Optional reading: Chapter 6, Forsyth & Ponce. Chapter 4 of Wandell, Foundations of Vision, Sinauer, 1995 has a good treatment of this.

Why does a visual system need color? Color. Why does a visual system need color? (an incomplete list ) Lecture outline. Reading: Optional reading:

What is color? What do we mean by: Color of an object Color of a light Subjective color impression. Are all these notions the same?

Announcements. Camera Calibration. Thin Lens: Image of Point. Limits for pinhole cameras. f O Z

Causes of color. Radiometry for color

Lecture 1 Image Formation.

Color to Binary Vision. The assignment Irfanview: A good utility Two parts: More challenging (Extra Credit) Lighting.

The Elements of Colour

Color and Shading. Color. Shapiro and Stockman, Chapter 6. Color and Machine Vision. Color and Perception

Reading. 2. Color. Emission spectra. The radiant energy spectrum. Watt, Chapter 15.

Lecture 12 Color model and color image processing

Fall 2015 Dr. Michael J. Reale

Spectral Color and Radiometry

Color. Computational Photography MIT Feb. 14, 2006 Bill Freeman and Fredo Durand

Digital Image Processing COSC 6380/4393. Lecture 19 Mar 26 th, 2019 Pranav Mantini

Introduction to color science

Digital Image Processing

CS635 Spring Department of Computer Science Purdue University

Chapter 5 Extraction of color and texture Comunicação Visual Interactiva. image labeled by cluster index

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Illumination and Shading

(0, 1, 1) (0, 1, 1) (0, 1, 0) What is light? What is color? Terminology

Game Programming. Bing-Yu Chen National Taiwan University

Physical Color. Color Theory - Center for Graphics and Geometric Computing, Technion 2

Mech 296: Vision for Robotic Applications

Image Formation. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Visible Color. 700 (red) 580 (yellow) 520 (green)

Color Vision. Spectral Distributions Various Light Sources

The Viewing Pipeline Coordinate Systems

Image Formation. Camera trial #1. Pinhole camera. What is an Image? Light and the EM spectrum The H.V.S. and Color Perception

CS452/552; EE465/505. Color Display Issues

Lecture #13. Point (pixel) transformations. Neighborhood processing. Color segmentation

Introduction to Computer Graphics with WebGL

Reading. 4. Color. Outline. The radiant energy spectrum. Suggested: w Watt (2 nd ed.), Chapter 14. Further reading:

CSE 167: Lecture #7: Color and Shading. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

CHAPTER 3 COLOR MEASUREMENT USING CHROMATICITY DIAGRAM - SOFTWARE

this is processed giving us: perceived color that we actually experience and base judgments upon.

Color, Edge and Texture

1. Final Projects 2. Radiometry 3. Color. Outline

Colour computer vision: fundamentals, applications and challenges. Dr. Ignacio Molina-Conde Depto. Tecnología Electrónica Univ.

Computer Graphics. Bing-Yu Chen National Taiwan University

The Display pipeline. The fast forward version. The Display Pipeline The order may vary somewhat. The Graphics Pipeline. To draw images.

Image Analysis and Formation (Formation et Analyse d'images)

Chapter 4 Color in Image and Video

CS184 LECTURE RADIOMETRY. Kevin Wu November 10, Material HEAVILY adapted from James O'Brien, Brandon Wang, Fu-Chung Huang, and Aayush Dawra

Image Processing. Color

CS 556: Computer Vision. Lecture 18

Announcements. Radiometry and Sources, Shadows, and Shading

Color. Phillip Otto Runge ( )

One image is worth 1,000 words

Understanding Variability

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

CSE 167: Introduction to Computer Graphics Lecture #6: Colors. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Lecture 11. Color. UW CSE vision faculty

CS-184: Computer Graphics. Today. Lecture 22: Radiometry! James O Brien University of California, Berkeley! V2014-S

Last update: May 4, Vision. CMSC 421: Chapter 24. CMSC 421: Chapter 24 1

Image Analysis. 1. A First Look at Image Classification

Digital Image Processing. Introduction

Capturing light. Source: A. Efros

Introduction to Computer Vision. Introduction CMPSCI 591A/691A CMPSCI 570/670. Image Formation

dq dt I = Irradiance or Light Intensity is Flux Φ per area A (W/m 2 ) Φ =

Image Acquisition Image Digitization Spatial domain Intensity domain Image Characteristics

Color. making some recognition problems easy. is 400nm (blue) to 700 nm (red) more; ex. X-rays, infrared, radio waves. n Used heavily in human vision

Multimedia Databases. 2. Summary. 2 Color-based Retrieval. 2.1 Multimedia Data Retrieval. 2.1 Multimedia Data Retrieval 4/14/2016.

A Survey of Modelling and Rendering of the Earth s Atmosphere

Reflectance & Lighting

Statistical image models

Lecture 16 Color. October 20, 2016

Announcements. Rotation. Camera Calibration

Color Space Transformations

CSE 167: Lecture #6: Color. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

1.1.1 Radiometry for Coloured Lights: Spectral Quantities

Global Illumination. Frank Dellaert Some slides by Jim Rehg, Philip Dutre

Other approaches to obtaining 3D structure

Introduction to Homogeneous coordinates

Radiometry. Reflectance & Lighting. Solid Angle. Radiance. Radiance Power is energy per unit time

Visualisatie BMT. Rendering. Arjan Kok

Color Image Processing

CSE 167: Lecture #6: Color. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

dq dt I = Irradiance or Light Intensity is Flux Φ per area A (W/m 2 ) Φ =

Photometric Stereo. Lighting and Photometric Stereo. Computer Vision I. Last lecture in a nutshell BRDF. CSE252A Lecture 7

COMP3421. Global Lighting Part 2: Radiosity

When this experiment is performed, subjects find that they can always. test field. adjustable field

ELEC Dr Reji Mathew Electrical Engineering UNSW

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

Cvision 3 Color and Noise

Radiometry. Radiometry. Measuring Angle. Solid Angle. Radiance

Electromagnetic waves and power spectrum. Rays. Rays. CS348B Lecture 4 Pat Hanrahan, Spring 2002

ITP 140 Mobile App Technologies. Colors

Paths, diffuse interreflections, caching and radiometry. D.A. Forsyth

Sources, Surfaces, Eyes

Announcement. Lighting and Photometric Stereo. Computer Vision I. Surface Reflectance Models. Lambertian (Diffuse) Surface.

6-1 LECTURE #6: OPTICAL PROPERTIES OF SOLIDS. Basic question: How do solids interact with light? The answers are linked to:

1 Affine and Projective Coordinate Notation

CS 445 HW#6 Solutions

MODELING LED LIGHTING COLOR EFFECTS IN MODERN OPTICAL ANALYSIS SOFTWARE LED Professional Magazine Webinar 10/27/2015

Light. Computer Vision. James Hays

Transcription:

ECE-6C Color Nuno Vasconcelos ECE Department, UCSD (with thanks to David Forsyth)

Color so far we have talked about geometry where is a 3D point map mapped into, in terms of image coordinates? perspective projection and light f ( x, y) =, Z ( X Y ) what is the brightness of that image pixel radiance of Lambertian surfaces, point source at infinity ρd L = E cos n, s π today we look at the missing link: color 2

Radiometry for color All definitions are now per unit wavelength All units are now per unit wavelength All terms are now spectral Radiance becomes spectral radiance watts per square meter per steradian per unit wavelength radiance emitted in [λ,λdλ] is Spectral radiosity, spectral exitance, etc. Spectral BRDF ρ λ bd λ L ( x, θ, φ) dλ ( θ, φ, θ, φ ) = i i o o L λ i L λ ( x, θ, φ) λ Lo ( P, θo, φo ) ( P, θ, φ )cosθ dω i i i 3

Spectral albedos different leaves, color names attached. Different colors typically have different spectral albedo, but that different spectral albedoes may result in the same perceived color (compare the two whites). Measurements by E.Koivisto. 4

The appearance of colors To talk about color we need to know how it is perceived by people Hering, Helmholtz: color appearance strongly affected by nearby colors, adaptation to previous views, state of mind Film color mode: view colored surface through a hole in a sheet, so that the color looks like a film in space; controls for nearby colors, and state of mind. Principle of trichromacy: it is possible to match almost all colors, viewed in film mode, using only three primary sources. Most of what follows discusses film mode. 5

Color matching experiments Subject shown a split field: one side shows the light whose color one wants to measure, other a weighted mixture of primaries (fixed lights). Subject adjusts dials so as to make mixture equal to test 6

Color matching experiments (cont d) Most colors can be represented as a mixture of P,P 2,P 3 M=a P b P 2 c P 3 where the = sign should be read as matches This is additive matching. Important because if two people who agree on P,P 2,P 3 need only supply (a, b, c) to describe a color. Some colors can t be matched like this: instead we need This is subtractive matching. Ma P = b P 2 c P 3 We can interpret it as (-a, b, c) 7

The principle of trichromacy Experimental facts: Three primaries will work for most people if we allow subtractive matching Exceptional people can match with two or only one primary. This could be caused by a variety of deficiencies. Most people make the same matches. There are some anomalous trichromats, who use three primaries but make different combinations to match. Color matching is linear (Grassman s laws) 8

9 Grassman s Laws. mixture of coordinates matches the mixture of the lights 2. equal coordinates means equal lights 3. matching is linear note: these statements are as true as any biological law. 3 2 2 2 2 2 3 2 2 2 2 2 3 2 ) ( ) ( ) ( P c c P b b P a a T T P c P b P a T P c b P P a T = = = 2 3 2 2 3 2 T T cp bp ap T cp bp ap T = = = 32 2 3 2 kcp kbp kap kt cp bp ap T = =

Linear color spaces Because color matching is linear in the primaries it makes sense to think of the primaries as the basis of a linear color space Note that the space is infinite dimensional. think of L(λ) as L(λ, λ 2,, λ Ν ) 2. take N to infinity The space of valid colors is a 3D-subspace Problem: the basis is not necessarily orthogonal P 3 (a,b,c) P 2 P 0

Basis functions you are probably used to vector spaces with a finite number of components f = (f,..., f n ) when n goes to infinity we have a function f = f(t) this is also a vector space, but now a vector space of functions everything that you have learned still holds, we only need to change our operators a little the main difference is that summations become integrations e.g. for the dot product between f and g f g i < f, g >= < f, g >= f ( t ) g ( t dt i i )

Basis functions a basis for a subspace of dimension d is a set of d functions b (t),..., b d (t) such that any function in the space is a linear combination of these d functions (the b i (t) span the space) d f ( t ) = α b ( t ) i = the b i (t) are linearly independent (i.e. there is no linear combination that will add to the zero function other than α i =0) the basis is orthonormal if the b i (t) are orthogonal functions and have unit norm b ( t ), b ( t ) i j i i =, if i = j bi ( t ) b j ( t ) dt = 0, if i j 2

Fourier series note that you have already seen this for example, the Fourier series is the result of the projection of a function f(x) on the basis whose functions are cos(nx) and sin(nx) note that the basis is orthogonal, since cos( nx )sin( mx ) dx = 0 π, sin( nx )sin( mx ) dx = 0, π, cos( nx )cos( mx ) dx = 0, n = m n m n = m n m the series coefficients are the coordinate on this basis α 0 = f ( x ) dx αn = f ( x )cos( nx ) dx βn = f ( x )sin( nx ) dx π π π 3

Fourier series the function is a linear combination of the basis functions f ( x ) note that the basis functions do not have unit norm, and so we need the /π factors the picture is = α 2 0 αn cos( nx ) βn sin( nx ) n = n = 0 f(x) Fourier coefficients α i sin(nx) or cos(nx) (basis functions) 4

Linear color spaces Back to color Because color matching is linear in the primaries it makes sense to think of the primaries as the basis of a linear color space Note that the space is infinite dimensional The space of valid colors is a 3D-subspace Problem: the basis is not necessarily orthogonal P 3 (a,b,c) P 2 P 5

Color matching functions How do we get the color coordinates? pick a source δ(λ λ 0 ) of unit radiance at wavelength λ we know that there is a set of weights that matches it denote the weight of P i by f i (λ 0 ) δ ( λ ) = i( 0 i λ 0 f λ ) P repeat for all λ 0 The f i (λ) are called color matching functions because we can write L( λ) λ = L( λ0 ) δ ( λ0 λ) d { 0 = L( λ } = 0) fi( λ0) dλ0 Pi i i i ω P i i 6

7 Color matching functions (cont d) The color coordinates are the projections of the spectral radiance on the three matching functions Note that this means that we can specify the color space by specifying a set of matching functions This can sometimes lead to primaries that are not physically feasible (e.g. if we constrain the MFs to be non-negative) OK because we really only care about the coordinates 0 0 3 0 0 0 2 0 0 0 0 ) ( ) ( ) ( ) ( ) ( ) ( λ λ λ λ λ λ λ λ λ d f L c d f L b d f L a = = =

Linear color spaces RGB: primaries are monochromatic energies are 645.2nm, 526.3nm, 444.4nm. color matching functions have negative parts some colors can be matched only subtractively matching functions 8

RGB space primaries are the phosphors monitors use as primaries the color space is a cube axes represent the amount of red, green, and blue each color has coordinates between 0 and (0 and 255) 9

Linear color spaces CIE XYZ: color matching functions positive due to this primaries are imaginary, but have convenient properties color coordinates are (X,Y,Z), where X is amount of X primary, etc. matching functions 20

CIE xy 2D is easier to visualize than 3D usually work with CIE xy, where x=x/(xyz) y=y/(xyz) this is the intersection of the color space with the plane XYZ= 2

Color perception human perception of color is best described in terms of three fundamental color properties hue: this is what you would refer to as the color itself e.g. red vs yellow note that there is a circular structure (we start and finish with red) for this reason color is usually visualized in a color wheel 22

Color perception saturation: this is the adjective: e.g. vivid red, pale yellow it is the radial coordinate on the color wheel colors at the center are unsaturated, colors at the boundaries are highly saturated 23

Color perception intensity: is the amount of brightness dark yellow vs light yellow the color wheel can be replicated at each intensity level 0 0.25 0.5 0.75 Note that: the center is always the intensity level at zero intensity, hue and saturation are irrelevant saturation becomes more important at higher intensities 24

Perceptual color spaces HSV: hue, saturation, value (intensity) is a natural perceptual color space very non-linear, colors form a cone this can be bad for some applications e.g. TVs where primaries have nothing to do with perception but with building CRTs but very good for others 25

Perceptual color spaces note that, in general, we can extract the three properties from any space this picture shows H,S, and V in CIE xy the problem is that the transformation is non-linear in CIExy two colors that are near do not necessarily look similar 26

MacAdam elipses ellipses: colors that human observers matched to color on their center; boundary shows just noticeable difference. left: magnified 0x. The ellipses at the top are larger than those at the bottom, and rotate as they move up. difference in x,y is poor guide to color difference! 27

Perceptual color spaces Uniform: equal (small!) steps give the same perceived color changes this is important, for example for image retrieval based on color similarity compute an histogram of color values for each image and measure image similarity by the similarity of the color histograms works surprisingly well (more on this later) 28

Uniform color spaces but there are many other applications lots of research on constructing color spaces so that differences in coordinates are a good guide to differences in color e.g. CIE u v which is a projective transform of x, y transform x,y so that ellipses are most like one another. Figure shows the transformed ellipses 29

Uniform color spaces L*a*b is quite popular 3 rd order approximation to the Munsell color notation system (which we will not get into) represents colors relative to a reference white point, that defines white light the whitest light generated by a given device. (In this sense L*a*b* is device dependent; equal colors are truly equal iff relative to the same white point.) 30

TV color spaces in between linear and perceptual decomposition into intensity plus two color channels (e.g. R-Y, B-Y) linear transformation of RGB compatibility: modulate color on top of BW; MPEG support of existing TV sets compression: main perceptually relevant feature is that people have less color than intensity resolution NTSC: YIQ (/2 color bandwidth) JPEG/MPEG: YCbCr (4:2:0 for broadcast, 4:2:2 for studio) MPEG 3

Printers for printers the story is quite different: we have to consider subtractive color spaces ink pigments remove color from incident light remaining light is reflected by the paper e.g. red ink is a die that absorbs blue and green most common space is CMY with primaries cyan (white minus red) magenta (white minus green) yellow (white minus blue) but mixtures can still be evaluated wrt to the RGB space E.g. CM = (W-R) (W-G) = RGB-R-G = B (WW = W because ink cannot increase the amount of light) 32

CMY and CMYK the relationship to RGB can be summarized pictorially it turns that that it is difficult to generate black in this way lots of synchronization problems CMYK solves this by explicitly including a black ink 33

34 Conversions in practice, we often have to do color-space conversions here are some of the formulas (for more details see http://www.easyrgb.com/math.html) RGB to XYZ: see homework CIE XYZ to CIE u v CIE XYZ to L*a*b (X n,y n,z n ) are (X,Y,Z) coordinates of a reference white patch. = Z Y X Y Z Y X X v u 3 5 9, 3 5 4 ) ' ', ( 6 6 * 3 = Y n Y L = 3 3 500 * n Y n Y X X a = 3 3 200 * n Z n Z Y Y b

Conversions RGB to CMY C = -R M = -G Y=-B CMY to CMYK K = min(c,m,y) C = C-K M = M-K Y=Y-K RGB to YCrCb Y = 0.29900R 0.58700G 0.400B C b = 0. 6874R 0.3326G 0.50000B C r = 0.50000R-0.4869G 0.083B 35

Conversions RGB to HSV Min = min(r,g,b); Max = max(r,g,b); = Max Min; V = Max; if ( == 0 ) {H = 0; S = 0} else { S = / Max; R = [(Max - R) / 6 ( / 2) ] / ; G = [(Max - G) / 6 ( / 2) ] / B = [(Max - B) / 6 ( / 2) ] / } if ( R == Max ) H = B - G else if ( G == Max ) H = ( / 3 ) R - B else if ( B == Max ) H = ( 2 / 3 ) G R if ( H < 0 ) ; H = ; if ( H > ) ; H -= 36

Why three primaries? color perception is the result of evolution let s look at the human eye Two types of receptors: rods: responsible for vision at low light levels, do not mediate color vision cones: active at higher light levels, capable of color vision rods dominate in the periphery of the eye, the center is mostly composed of cones three types of cones: S, M, and L 37

Rod vs cone density very high concentration of cones in the center high resolution and color density decays very quickly center periphery 38

Color receptors and thricromacy trichromacy is justified: three types of cones, which vary in their sensitivity to light at different wavelengths picture shows a cone mosaic, spatial distribution of the different types of cones blue: S cones red: L cones green: M cones note the different densities 39

Color receptors relative sensitivity as a function of wavelength. S (for short) cone responds most strongly at short wavelengths; the M (for medium) at medium wavelengths and the L (for long) at long wavelengths. occasionally called B, G and R cones respectively, but that s misleading - you don t see red because your R cone is activated. explains 3 primaries 40

4