Professional Documents
Culture Documents
Lecture6 Color
Lecture6 Color
3 4
5 6
1
Color image processing Color image processing
• Cones can be divided into three principal sensing categories: • Color TV: an example of the additive nature of light colors
red, green and blue • Interior of TV tube: a large array of triangular dot patterns of
electron sensitive phosphor
• Each dot in a triangle produces one of the primary colors
• Intensity of red-emitting phosphor is modulated by an electron
gun.
• Similarly for green-emitting and blue-emitting
• Three primary colors are added and received by the eye as a
full-color image
7 8
9 10
• Another approach for • Any point not actually on the boundary represents some
specifying colors is to mixture of spectrum colors
use CIE chromaticity • Any point on the boundary of chart is fully saturated.
diagram which shows • A straight line segment joining any two points in the diagram
color composition as a defines all different colors that can be obtained by combining
function of x (red) and y these two colors additively.
(green). • A line drawn from the point of equal energy (white) to any
• Various spectrum colors point on the boundary will define all the shades on that color
are indicated around the • To determine colors that can be obtained from any three given
boundary of tongue- colors, we draw connecting lines to each of the three color
points
shaped diagram (pure
colors). • Any color inside the triangle can be produced by various
combinations of the three initial colors
11 12
2
Color Models (color space or color system) Color image processing
• Color models: used to specify colors in a standard way
• Color model is a coordinate system where each color is • Each model is oriented toward a hardware or application.
represented by a single point • RGB: color monitors, cameras, color image processing
• RGB (red, green, blue) • CMY: color monitor
• CMY (cyan, magenta, yellow) • HIS: color image processing
• HIS (hue, saturation, intensity) – HIS has the advantage that it decouples color and gray level
information in an image making it suitable for many gray scale
techniques discussed before
13 14
RGB RGB
• Each color appears in its primary spectral components of red, • A subset of colors that are likely to be reproduced reasonably
green and blue independent of viewer hardware is called safe RGB color
• Different colors in this model are points on or inside the cube • 216 colors have become the de facto standard for safe colors
• Number of bits used to represent each pixel in RGB space is • Each of 216 safe color is formed from three RGB values but
called the pixel depth
each value can only be 0, 51, 102, 153, 204 or 255.
• If 8 bit is used to represent each color, 24-bit RGB color
image is obtained
• Total number of colors: (28)3
15 16
CMY HSI
• Most devices that deposit colored pigments on paper (color • RGB and CMY color models are not well suited for
printers and copiers) require CMY data input describing colors in terms that are practical for human
• Equal amounts of pigments primaries, cyan, magenta and interpretation
yellow should produce black • HSI (hue, saturation and intensity) decouples intensity
• In practice combing these colors produces a muddy looking components from the color-carrying information
black • Hue: dominant color
• In order to produce true black a fourth color black is added • Saturation: relative purity or the amount of white mixed with
(CMYK) a hue
• When publishers are talking about four color printing they are
referring to CMY plus black
⎡C ⎤ ⎡1⎤ ⎡ R ⎤
⎢ M ⎥ = ⎢1⎥ − ⎢G ⎥
⎢ ⎥ ⎢⎥ ⎢ ⎥
⎣⎢Y ⎦⎥ ⎣⎢1⎦⎥ ⎣⎢ B ⎦⎥
17 18
3
HSI HSI
0 ≤ H < 120
B = I (1 − S )
I = ( R + G + B) / 3 ⎡ S cos H ⎤
R = I ⎢1 + ⎥
3 ⎣ cos(60 − H ) ⎦
S = 1− [min( R, G, B)] G = 1 − ( R + B)
( R + G + B)
120 ≤ H < 240
⎧ θ if B≤G
H =⎨ H = H − 120
⎩360 − θ if B>G R = I (1 − S )
⎡ S cos H ⎤
G = I ⎢1 +
⎧ [( R − G ) + ( R − B)] / 2 ⎫ ⎥
⎣ cos(60 − H ) ⎦
θ = cos −1 ⎨ 1/ 2 ⎬ B = 1 − (R + G)
⎩ [( R − G ) 2
+ ( R − B )( G − B )] ⎭
240 ≤ H < 360
H = H − 240
G = I (1 − S )
⎡ S cos H ⎤
B = I ⎢1 + ⎥
⎣ cos(60 − H ) ⎦
R = 1 − (R + G)
19 20
21 22
Color 2
Color 1
Gray-level
23 24
4
Pseudo-color image processing Pseudo-color image processing
Gray-level to color transformations:
• Three different transformations are performed on the gray-
level image
• The results are fed into red, green, and blue guns of a color
display
25 26
27 28
29 30