CS6825: Color CS6825: Color
Jan 17, 2016
CS6825: ColorCS6825: Color
22
Light and ColorLight and Color
Light is electromagnetic radiation Light is electromagnetic radiation Visible light: 400-700nm. rangeVisible light: 400-700nm. range
33
Color:Color: It is determined by light source, surface It is determined by light source, surface
properties (what light is absorbed & properties (what light is absorbed & reflected) and the sensor.reflected) and the sensor.
44
The Sensor - Human VisionThe Sensor - Human Vision
Human eyes have 2 types of sensors:Human eyes have 2 types of sensors:• CONESCONES
Sensitive to colored light, but not very sensitive Sensitive to colored light, but not very sensitive to dim light, Curves like Red, Green, Blueto dim light, Curves like Red, Green, Blue
• RODSRODS (very) Sensitive to achromatic light(very) Sensitive to achromatic light
55
Human ConesHuman Cones
We perceive We perceive color using three color using three different types of different types of cones:cones:• 440 nm (BLUE)440 nm (BLUE)• 545 nm (GREEN)545 nm (GREEN)• 580 nm (RED)580 nm (RED)
SG
SR
SB
66
Illumination Source - SunlightIllumination Source - Sunlight
Sunlight under Sunlight under different different conditions…is not conditions…is not pure white lightpure white light
77
Color ModelsColor ModelsThey provide a standard way of specifying They provide a standard way of specifying
a particular color using a 3D coordinate a particular color using a 3D coordinate system.system.
Hardware oriented:Hardware oriented:• RGBRGB• CMYCMY• YIQ YIQ (luminance, inphase, quadrature)(luminance, inphase, quadrature)
Image processing oriented:Image processing oriented:• HIS HIS (hue, intensity, saturation)(hue, intensity, saturation)
• XYZXYZ
88
CIE primaries: XYZCIE primaries: XYZ
The Commission Internationale de The Commission Internationale de l’Eclairage defined 3 standard l’Eclairage defined 3 standard primaries: X, Y, Z that can be added primaries: X, Y, Z that can be added to to form all visible colors.form all visible colors. (better at (better at this than Red, Green, Blue space )this than Red, Green, Blue space )
Y was chosen so that its color Y was chosen so that its color matching function matches the sum matching function matches the sum of the 3 human cone responses.of the 3 human cone responses.
99
CIE primaries: XYZCIE primaries: XYZ All positive spectral matching curvesAll positive spectral matching curves Y corresponds to brightnessY corresponds to brightness Equal energy white: X=Y=Z Equal energy white: X=Y=Z Relationship to RGBRelationship to RGB
1010
•x,y,z normalize x,y,z normalize X,Y,Z s.t. x+y+z=1X,Y,Z s.t. x+y+z=1
•Chromaticity is Chromaticity is given bygiven by
• HUE HUE • SATURATIONSATURATION
•Pure colors are at Pure colors are at the curved boundarythe curved boundary
•White is White is (1/3,1/3,1/3)(1/3,1/3,1/3)
Image Gonzales and Woods
1111
Mixing Colors on CIE diagramMixing Colors on CIE diagram
Any color along a Any color along a line can be obtained line can be obtained by mixing the colors by mixing the colors of the endpoints.of the endpoints.
Any point in a Any point in a triangle can be triangle can be obtained by mixing obtained by mixing the colors of the the colors of the vertices.vertices.
1212
RGB ModelRGB Model
Based on human visual Based on human visual system cones.system cones.
Additive model.Additive model.
An image consists of 3 An image consists of 3 BANDS: Red (R), Green (G), BANDS: Red (R), Green (G), Blue (B)Blue (B)
Used in computer Used in computer monitors, televisions, monitors, televisions, consumer digital cameras.consumer digital cameras.
Hence often used in media Hence often used in media vision systems.vision systems.
1313
RGB convert to XYZRGB convert to XYZ
Z
Y
X
B
G
R
8986.01185.00583.0
0283.09984.19843.0
2883.05326.09107.1
B
G
R
Z
Y
X
1149.10661.00000.0
1143.05868.02988.0
2001.01736.06067.0
1414
CMY ModelCMY Model
Cyan-Magenta-Yellow is a subtractive Cyan-Magenta-Yellow is a subtractive model which is good to model model which is good to model absorption of colors.absorption of colors.
Appropriate for paper printing. Appropriate for paper printing. Subtractive model Subtractive model
B
G
R
Y
M
C
1
1
1
1515
RGB Is RGB Is AdditiveAdditive
CMY Is CMY Is SubtractiveSubtractive
Typically used for projected/emitted light like TV / computers
Typically used for reflected lightlike in printers
1616
YIQ ModelYIQ Model
Used by NTSC TV standardUsed by NTSC TV standard Separates Hue (I,Q) from Separates Hue (I,Q) from
Luminance (Y) (so for old black Luminance (Y) (so for old black and white TVs can transmit/use and white TVs can transmit/use just Y).just Y).
B
G
R
Q
I
Y
311.0532.0212.0
321.0275.0596.0
114.0587.0299.0
1717
Luminance vs IntensityLuminance vs Intensity
1818
HSI ModelHSI Model
Multiple views of the HSI space
1919
RGB-HSI ConversionRGB-HSI Conversion(See Gonzalez and Woods)(See Gonzalez and Woods)
GBBGBRGR
BRGRH
GBBGBRGR
BRGRH
I
BGRS
BGRI
if ))(()(
)]()[(2/1cos360
if ))(()(
)]()[(2/1cos
),,min(1
3
)(
2
1
2
1
Note: R, G and B are in [0,1] rangeNote: R, G and B are in [0,1] range
2020
Color constancyColor constancy Ability to perceive the Ability to perceive the
colors of objects in a colors of objects in a scene independent for the scene independent for the most part from the color most part from the color of the ambient of the ambient illumination illumination
Research into how can Research into how can from a measurement such from a measurement such as R,G,B extract the as R,G,B extract the information from the true information from the true color of the object color of the object (surface) and REMOVE the (surface) and REMOVE the factors of the illumination factors of the illumination source and the sensor source and the sensor limitation/properties.limitation/properties.
2121
Color Balancing by von Kries Color Balancing by von Kries methodmethod
balancingbalancing is the global adjustment of the intensities is the global adjustment of the intensities of the colorsof the colors
Refer to Refer to wiki ((http://en.wikipedia.org/wiki/Color_balance) ) for details of for details of this simple algorithm that uses XYZ space.this simple algorithm that uses XYZ space.
Here are the results:Here are the results:
2222
ConclusionConclusion Color is an important visual clue – how would you Color is an important visual clue – how would you
know how to grab a red pen without the red cap?know how to grab a red pen without the red cap? Color can and is represented in many different “color Color can and is represented in many different “color
spaces”…like RGB, CMY, XYZ,etc.spaces”…like RGB, CMY, XYZ,etc. We typically use different color spaces for different We typically use different color spaces for different
purposes (i.e. CMY for printers, RGB for monitors and purposes (i.e. CMY for printers, RGB for monitors and cameras).cameras).
Color correction looks at trying to reduce or if Color correction looks at trying to reduce or if possible eliminate the effects the illumination has on possible eliminate the effects the illumination has on the appearance of the color of an object. This is an the appearance of the color of an object. This is an active area of research in color. We saw a simple active area of research in color. We saw a simple color balance method.color balance method.