Вы находитесь на странице: 1из 43

Chapter 6 : Color Image

Processing

CCU, Taiwan
Wen-Nung Lie

Color Fundamentals

Spectrum that covers visible colors : 400 ~ 700 nm


Three basic quantities

CCU, Taiwan
Wen-Nung Lie

Radiance : energy that flows from the light source (measured in


Watts)
Luminance : a measure of energy an observer perceives from a
light source (in lumens)
Brightness : a subjective descriptor difficult to measure

6-1

About human eyes

Primary colors for standardization

Not all visible colors can be


produced by mixing these three
primaries in various intensity
proportions
Cones in human eyes are divided
into three sensing categories

CCU, Taiwan
Wen-Nung Lie

blue : 435.8 nm, green : 546.1 nm, red : 700


nm

65% are sensitive to red light, 33%


sensitive to green light, 2% sensitive to
blue (but most sensitive)
The R, G, and B colors perceived by
human eyes cover a range of spectrum

6-2

Primary and secondary colors


of light and pigments

Secondary colors of light

Primary colors of pigments

CCU, Taiwan
Wen-Nung Lie

magenta (R+B), cyan (G+B),


yellow (R+G)
R+G+B=white
magenta, cyan, and yellow
M+C+Y=black

6-3

Chromaticity

Hue + saturation = chromaticity

hue : an attribute associated with the dominant wavelength or


dominant colors perceived by an observer
saturation : relative purity or the amount of white light mixed with
a hue (the degree of saturation is inversely proportional to the
amount of added white light)

Color = brightness + chromaticity


Tristimulus values (the amount of R, G, and B needed to
form any particular color : X, Y, Z

trichromatic coefficients :
x = X /( X + Y + Z )

CCU, Taiwan
Wen-Nung Lie

y = Y /( X + Y + Z )

z = Z /( X + Y + Z )
6-4

Chromaticity diagram

CCU, Taiwan
Wen-Nung Lie

Show color composition as a


function of x, y, and z
Spectrum colors are indicated
around the boundary of the
tongue-shaped chromaticity
diagram
Point of equal energy : equal
fractions of three primary colors
CIE defined white light
Points located on the boundary of
chromaticity diagram are fully
saturated -- the saturation at the
center point is zero
6-5

Chromaticity diagram (cont.)

CCU, Taiwan
Wen-Nung Lie

A straight line segment joining


any two points defines all color
variations of the combination of
them
No three colors in the diagram
can span the whole color space
-- not all colors can be obtained
with three single and fixed
primaries
The color gamut produced by
RGB monitors
The color printing gamut is
irregularly-shaped
6-6

Color models, Color space

A color model is a specification of a coordinate


system within which each color is represented by a
single point
Hardware-oriented color models

Application-oriented color model

CCU, Taiwan
Wen-Nung Lie

e.g., color monitors and printers


RGB, CMY (cyan, magenta, yellow), CMYK (+black)
HSI (hue, saturation, intensity)

6-7

RGB color model

CCU, Taiwan
Wen-Nung Lie

Each color appears in its primary spectral


components of R, G, and B
Based on a Cartesian coordinate system (cube)

6-8

CMY and CMYK color models

Useful in color printers and copiers


Conversion between RGB and CMY
C 1 R
M = 1 G

Y 1 B

CCU, Taiwan
Wen-Nung Lie

In practice, combining CMY colors produces a


muddy-looking black. To produce true black, a
forth color, black, is added CMYK color model
6-9

HSI color model

RGB, CMY, and similar others are not practical for


human interpretation
Hue : a color attribute that describes a pure color
Saturation : a measure of the degree to which a pure
color is diluted by white light
Derivation of HSI from RGB color cube

CCU, Taiwan
Wen-Nung Lie

All points contained in the plane segment defined by the


intensity axis (i.e., from black to white) and one color point
on the boundaries of the cube have the same hue

6-10

HSI color model (cont)

CCU, Taiwan
Wen-Nung Lie

The HSI space is represented


by a vertical intensity axis,
the length (saturation) of a
vector from the axis to a
color point, and the angle
(hue) this vector makes with
the red axis
The power of HSI color
model is to allow
independent control over hue,
saturation, and intensity

6-11

Conversion between RGB and


HSI

From RGB to HSI

H =
360

if B G

2 [( R G ) + ( R B )]

=
cos

2
1/ 2
if B > G
[( R G ) + ( R B)(G B)]
3
1
[min( R, G, B)]
s = 1
I = ( R + G + B)
( R + G + B)
3

From HSI to RGB

RG sector (0<H<120)
B = I (1 S )
G = 3I ( R + B )

CCU, Taiwan
Wen-Nung Lie

S cos H
R = I [1 +
]
o
cos(60 H )
6-12

Conversion between RGB and


HSI (cont)

GB sector (120<H<240)
R = I (1 S )
H = H 120o
S cos H
G = I [1 +
] B = 3I ( R + G )
o
cos(60 H )

BR sector (240<H<360)
H = H 240o

G = I (1 S )

S cos H
B = I [1 +
] R = 3 I (G + B )
o
cos(60 H )

CCU, Taiwan
Wen-Nung Lie

6-13

HSI RGB
RGB

HSI

CCU, Taiwan
Wen-Nung Lie

6-14

YUV color model

YUV color model has been used in PAL TV systems.


The luminance Y can be determined from RGB model
as Y = 0.299 R + 0.587G + 0.114 B
The other two chrominance components, U and V, are
defined as color difference as

U = 0.493( B Y )

CCU, Taiwan
Wen-Nung Lie

V = 0.877( R Y )

For Completeness, an expression of YUV in terms of


RGB is listed below
0.587
0.114 R
Y 0.299
U = 0.147 0.289 0.436 G


V 0.615 0.515 0.100 B

6-15

YCbCr color model

It is noted that U and V may be negative as well.


In order to make chrominance components nonnegative, the Y,
U and V are shifted to produce the YCbCr model, which is
used in the international coding standards JPEG and MPEG
0.504
0.098 R 16
Y 0.257
Cr = 0.439 0.368 0.071 G + 128


Cb 0.148 0.291 0.439 B 128

The inverse operation


R ' = 1.164(Y 16) + 1.596(Cr 128)
G ' = 1.164(Y 16) 0.813(Cr 128) 0.392(Cb 128)
B ' = 1.164(Y 16) + 2.017(Cb 128)

CCU, Taiwan
Wen-Nung Lie

Reference:
B.G. Haskell, A. Puri, A.N. Netravali, Digital Video: An introduction to MPEG-2, Chapman & Hail, 1997
Y.Q. Shi, H. Sun, Image and Video compression for multimedia engineering, CRC press, 1999

6-16

Conversion between YUV and


YCbCr

From YUV to YCbCr


0
0 Y 16
Y 0.860
U + 128
Cb = 0
1
.
007
0


Cr 0
0
0.714 V 128

CCU, Taiwan
Wen-Nung Lie

6-17

Gray level to color


transformation -- pseudocolor

CCU, Taiwan
Wen-Nung Lie

Three independent transformation on


the graylevels, i.e., establish a color
mapping system for graylevels
Some standardized CMSs exist, e.g.,
ironball for infrared image display
If all three transforms are the same -->
monchrome

6-18

Effect of different gray to color


transformations

CCU, Taiwan
Wen-Nung Lie

6-19

Color composition for multispectral images

Often used in display of


multi-spectral satellite
images
Map three bands out of
multi-spectra into RGB for
color display

RGB = (red, green, blue)


RGB = (near IR, green, blue)
CCU, Taiwan
Wen-Nung Lie

6-20

Full-color image processing

Full-color and interpretations of its various colorspace components


Method 1

Method 2

CCU, Taiwan
Wen-Nung Lie

Process each component image individually and form a


composite processed color image from the individually
processed components
Work with color pixels directly

6-21

There is a discontinuity in
HSI model where 0 and 360
of hue meet
Hue is undefined for 0
saturation

CCU, Taiwan
Wen-Nung Lie

6-22

Color transformation

Transform a vector in color space to another


vector -- color mapping function
si = Ti ( r1 , r2 ,..., rn ),

Transformation on a per-color-component basis


si = Ti (ri ),

i = 1,2,..., n

Some operations are better suited to specific


models

CCU, Taiwan
Wen-Nung Lie

i = 1,2,..., n

Modify pixel intensity HSI is suitable (but the cost


for conversion from RGB or CMY to HSI is costly)
6-23

Color complements

Saturation should be
altered to implement
complement

Color circle
CCU, Taiwan
Wen-Nung Lie

Approximation only

6-24

Color slicing

Highlighting a specific range of colors in an image

0.5,
si =

if rj a j >
2 any 1 j n

ri
otherwise

0.5, if
si =

ri

(r
j=1

a j ) 2 > R02

i = 1,2,...n

otherwise

(a1, a2, ,an) is the prototype


or average color
CCU, Taiwan
Wen-Nung Lie

6-25

Device-independent color
model (CIE L*a*b* model)

Unlike RGB and CMY which are specific for certain


devices (monitors and printers)
Characteristics of L*a*b* color model

CCU, Taiwan
Wen-Nung Lie

The choice for many color management system (CMS)


Being colorimetric
Perceptually uniform (color differences are perceived uniformly)
Device-independent
Encompass the entire visible spectrum and can represent accurately
the colors of any display, print, or input device
An excellent decoupler of intensity (L*) and color (a* : red minus
green, b* : green minus blue), making it useful in both image
manipulation and image compression applications
6-26

CIE L*a*b* model


Y
YW

L = 116 h

16

X Y
h
a* = 500 h
X W YW
Y Z
*

b = 200 h h
YW ZW

3 q ,
q > 0.008856
h( q ) =
7.787 q + 16 / 116 q 0.008856

( X W , YW , ZW ) are reference white tristimulas values and X,


Y, and Z are tristimulas values of any color

The degree to which the luminance is separated from the


color in L*a*b* is greater than in other color models

CCU, Taiwan
Wen-Nung Lie

6-27

Color image tonal correction

Tonal correction to provide a proper key (tone) of


an image (just like to correct the brightness of a
graytone image)

CCU, Taiwan
Wen-Nung Lie

Hue of color is not changed


For RGB and CMYK -- map all color components with
the same transformation function
For HSI only the intensity component is modified

6-28

CCU, Taiwan
Wen-Nung Lie

Tonal correction

6-29

Color image histogram


equalization

Modify brightness and contrast without


influencing the hue and saturation

CCU, Taiwan
Wen-Nung Lie

Operation on intensity component only (e.g., HSI


model)

Adjustment of hue or saturation is common when


working with the intensity component in HSI
space since change in intensity usually affect the
relative appearance of colors in an image

6-30

CCU, Taiwan
Wen-Nung Lie

Histogram equalization

6-31

Color balancing
correction

CCU, Taiwan
Wen-Nung Lie

To reduce magenta
remove both red and
blue or add green
The color ring is useful
as a reference tool for
identifying color
printing problem

6-32

Color image smoothing


B = I (1 S )

Smoothing on independent R, G, and B planes


S cos H
]
[
1
R
=
I
+
Smoothing on intensity plane of HSI model
cos(60o H )
The above two results are different
G = 3I ( R + B )
When I increases with B, R, and G

CCU, Taiwan
Wen-Nung Lie

6-33

Color image sharpening

CCU, Taiwan
Wen-Nung Lie

Sharpening on independent R, G, and B planes


Sharpening on intensity plane of HSI model
The above two results are different

6-34

Color segmentation -- in HSI


space

To extract image regions that


have desired range of colors

processing on hue image


saturation image is used as
masking to isolate ROI
less frequently used for
intensity image
Binary saturation
mask

Grayscale histogramming of (f)


CCU, Taiwan
Wen-Nung Lie

6-35

Color segmentation -- in RGB


space

Measure color similarity in terms of


Euclidean distance

within spherical, elliptical, or bounded box


region
1

D ( z, a) = z a or [( z a) C ( z a)]
T

1
2

C : covariance matrix

Get much more accurate result than in HSI


space

result

CCU, Taiwan
Wen-Nung Lie

6-36

Color edge detection

Gradient operation defined on color vectors


R
G
B
R
G
B
r+
g+
b
v=
r+
g+
b
x
x
x
y
y
y
2
2
2
2
2
2
R
G
B
R
G
B
g
=
v

v
=
+
+
+
g xx = u u =
+
yy
y
y
y
x
x
x

u=

R R G G B B
+
+
x y x y x y
r,g,b : Unit vectors along R, G, and B axes
2 g xy
1
1
= tan

(
g
g
)
2
: direction of maximum change
xx
yy

g xy = u v =

F ( ) = ( g xx + g yy ) + ( g xx g yy ) cos 2 + 2 g xy sin 2
2

CCU, Taiwan
Wen-Nung Lie

1
2

F() : Rate of change (gradient)

6-37

CCU, Taiwan
Wen-Nung Lie

Computing the gradients on individual images and


then adding them to form a composite gradient
image will lead to different results from those
obtained by gradient operation on color vectors
Edge detail of the vector gradient image is more
complete
More computational burden for vector gradient
operation

6-38

Vector gradient

Individual gradients

CCU, Taiwan
Wen-Nung Lie

difference

6-39

Noise in color images

How noise carries over when converting from one


color model to another

CCU, Taiwan
Wen-Nung Lie

Fine grain noise tends to be less visually noticeable in a


color image than it is in a monochrome image
Significantly degrade the hue and saturation
components of the noisy images, but slightly smooth
out the intensity image (since I=(R+G+B)/3)

6-40

Less visually
noticeable

HSI model

CCU, Taiwan
Wen-Nung Lie

6-41

When only one RGB channel is affected by noise,


conversion to HSI spreads the noise to all HSI component
images

Noise on green
channel

CCU, Taiwan
Wen-Nung Lie

6-42

Вам также может понравиться