COLOR FOR IMAGE PROCESSING Václav Hlaváč Czech Technical University, Faculty of Electrical Engineering Center for Machine Perception, Prague, Czech Republic hlavac@cmp.felk.cvut.cz http://cmp.felk.cvut.cz/∼hlavac Physics of color. Humans and color perception. Color mixing. LECTURE PLAN Color constancy. Courtesy to K. Ikeuchi, T. Darrell, T. Muenzer for inspiration and some pictures found in their teaching presentations. 1/40 COLOR IN SEVERAL DISCIPLINES 2/40 Physics. Human vision, physiology. Psychophysics, perception. Computer vision. Color several disciplines Painting, photography, movies. Image formation, reflection physics. Segmentation. Color in image analysis Image retrieval, e.g., in image databases. ISAAC NEWTON’s STUDIES 3/40 COLOR SPECTRUM Color is a human interpretation of a mixture of light with different wavelength λ (a continuum of spectral colors). 4/40 The perception of color is an entirely subjective experience. ISAAC NEWTON’S FINDINGS He proposed in late 1660s that white light is a multispectral mixture. (He thought erroneously of 7 ‘primary’ colors). This was quite a radical idea to propose at the time, and many philosophers, such as Johann Wolfgang Goethe (1749-1832), refused to believe it. Isaac Newton (1642-1727) studied nature of light using prism. 5/40 Newton invented the color circle to predict how colors would look when mixed, i.e., using a linear combination rule. Newton circle (1709). Capital letters refer to notes of the diatonic scale. VISIBLE SPECTRUM Retina – 4 types of receptors. R, G, B cones, color vision. 6/40 Rods, monochromatic vision with higher sensitivity. PHYSICS OF COLOR 7/40 Spectrum of electromagnetic radiation LIGHT AND COLOR Light = electromagnetic radiation. Sensors do not have direct access to color, i.e., wavelength λ. Exception: spectrometer. 8/40 Response of i-th sensor Zλ2 si = s(λ) ri(λ) dλ , λ1 ri(λ) is spectral density of i-th sensor, s(λ) is spectral density of light. where BUNSEN PRISM MONOCHROMATOR 9/40 DIFFRACTION (GRATING) MONOCHROMATOR 10/40 SPECTRAL REFLECTANCE OF FLOWERS 11/40 RADIOMETRY, REVIEW E L V L – radiance. E – irradiance. n n – surface normal. 12/40 V – direction to observer. L(Θi, Φi) BRDF = f (Θi, Φi, Θe, Φe) = E(Θe, Φe) 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]. 13/40 Irradiance becomes spectral irradiance [watts per square meter per unit wavelength]. RADIOMETRY FOR COLOR 2 Dependence on wavelength λ is introduced into BRDF. L becomes spectral radiance. 14/40 E becomes spectral irradiance. L(Θi, Φi, λ) BRDF = f (Θi, Φi, Θe, Φe, λ) = E(Θe, Φe, λ) In computer vision, simplified models are often used which use relative measures instead of absolute measures. ILLUMINATION SPECTRUM 15/40 RELATIVE REFLECTANCE 16/40 RELATIVE TRANSMITTANCE 17/40 HUMANS AND TRICHROMACY 18/40 The eye reduces all the wavelengths at a given ‘pixel’ to just the total amount of red, green, and blue. HUMAN EYE SENSITIVITY TO λ CIE - Commission Internationale de l’Eclairage (Int. Commission on Illumination). Performed measurements with many humans. 19/40 Measurements from 1931 and improvements in later years. COLOR METAMER A metamer, in general, is defined as two things that are physically different but perceived the same. Red and green adding to produce yellow is a color metamer, because yellow could have also been produced by a spectral color (single light with wavelengths between green and red). 20/40 Human visual system is fooled into thinking that red+green is the same as yellow, when in fact red+green has a completely different spectral composition than yellow. COLOR SPACE IN 3 DIMENSIONS Three type of cones suggest that color is a quantity defined in 3-dimensional (vector) space. 21/40 How to define a color space? Shine given wavelength λ on a screen. User must control three pure R, G, B lights and their intensity until the colors look identical to him. Idea of the experimental procedure. This is possible because of color metamers. RGB COLOR MATCHING FUNCTIONS Issued by CIE. Negative lobe in red! All wavelengths cannot be generated with RGB components. 22/40 Solution: convert to new synthetic coordinate system to make the job easy. XYZ COLOR MATCHING FUNCTIONS Non-negative spectra but primary colors X, Y, Z are imaginary. Y (λ) should be coincident with the luminance. 23/40 Normalization: equal tri-stimulus values for an equi-energy spectrum. GAMUT OF PERCEIVABLE COLORS 24/40 The gamut of all perceivable colors is a subspace of 3D space in X, Y, Z. Y Color = X 0 X + Y 0 Y + Z 0 Z, where cZ , cY and cZ are weights in the mixture. X Gamut is often projected into a plane X 0 + Y 0 + Z 0 after normalization. Z GAMUT IN 2D CIE CHROMATICITY DIAGRAM Coordinates x, y. X x = X +Y +Z Y y = X0 + Y + Z z = 1−x−y y 0.8 All mixtures appear inside. CIE Chromaticity Diagram 1931 530 2 degrees observer 540 510 550 0.7 560 0.6 570 λ 580 0.5 590 0.4 0.3 All visible spectral colors appear on the outline of the ‘horse show’. 520 25/40 600 610 630 680 490 0.2 0.1 0.0 480 470 0.1 420 0.2 0.3 0.4 0.5 0.6 0.7 x COLOR GAMUTS OF DEVICES 26/40 y 520 0.8 CIE Chromaticity Diagram 1931 530 CRT monitor gamut 540 510 520 0.8 CIE Chromaticity Diagram 1931 y Color printer gamut 0.8 530 540 510 550 0.7 y 560 0.6 570 λ 570 590 0.3 0.2 0.1 0.0 480 470 0.2 0.3 0.4 0.5 560 570 0.3 590 600 610 630 680 490 0.6 CRT monitor 0.7 x 0.0 λ 580 0.5 0.4 0.1 420 550 0.6 0.2 0.1 Color film gamut 540 590 600 610 630 680 490 λ 580 0.5 0.4 530 0.7 560 0.6 580 0.5 CIE Chromaticity Diagram 1931 510 550 0.7 520 0.4 0.3 600 610 630 680 490 0.2 480 0.1 470 0.1 420 0.2 0.3 0.4 0.5 printer 0.6 0.7 x 0.0 480 470 0.1 420 0.2 0.3 0.4 film 0.5 0.6 0.7 x RGB COMPONENTS OF A COLOR IMAGE 27/40 COLOR BLINDNESS, ISHIHARA PLATES 28/40 MIXTURE OF COLORS 29/40 ADDITIVE COLOR MIXING 400 nm 500 nm + 600 nm 500 nm 600 nm 700 nm = YELLOW 400 nm 500 nm 600 nm Red plus yellow. Additive mixing model holds for CRT phosphors, multiple projectors aimed at a screen, Polachromeslide film, human eye cones. 700 nm GREEN 400 nm RED 30/40 700 nm green makes SUBTRACTIVE COLOR MIXING Applies when colors mix by multiplying the color spectra. Cyan (called blue in crayons) minus (actually multiply) yellow makes green. 31/40 Subtractive mixing model holds for most photographic films, paint, crayons, printing, cascaded optical filters. CYAN 400 nm 500 nm 600 nm - 700 nm YELLOW 400 nm 500 nm 600 nm 700 nm = GREEN 400 nm 500 nm 600 nm 700 nm COLOR CAMERAS 32/40 1 chip camera + filter 3 chip camera HUE, SATURATION, VALUE COLOR SPACE 33/40 COLOR CONSTANCY, MOTIVATION 34/40 Color constancy refers to our ability to remove the effect of the illuminant in perceiving the color of objects. Colorimetry versus color perception. FAILURES IN COLOR CONSTANCY 35/40 FAILURES IN COLOR CONSTANCY (2) 36/40 FAILURES IN COLOR CONSTANCY (3) 37/40 INFLUENCE OF ILLUMINATION 38/40 INFLUENCE OF ILLUMINATION (2) 39/40 INFLUENCE OF OUTLINE 40/40 Bezold effect