DIP Unit 4
DIP Unit 4
Chapter 6:
Color Image Processing
3
Primary
y Colors
Primary colors of light are additive
Primary
y colors are red, green,
g and blue
Combining red + green + blue yields white
RGB vs CMY
RGB color cube
10
RGB and CMY Color Cubes
11
RGB Example
p
12
RGB Example
p
Original
g No Red No Green No Blue
13
RGB Example
Color receptors and color
deficiency
In color normal people
people, there are three types of color
receptors, called cones, which vary in their sensitivity to
g at different wavelengths.
light g
Deficiency by optical problems in the eye, or by absent
receptor types
Usually a result of absent genes.
Some people
l have
h fewer
f than
h three
h types off receptor; most
common deficiency is red-green color blindness in men.
Color deficiency is less common in women; red and green
receptor genes are carried on the X chromosome, and these
are the ones that typically go wrong. Women need two bad X
chromosomes to have a deficiency, and this is less likely.
Light
g Intensity
y
Note that intensity is a weighted function of the r,
r gg, b
values.
intensity = 0.299*Red
0 299*Red + 0.587*Green
0 587*Green + 0.144*Blue
0 144*Blue
S
Saturation
i
Relative purity of the color. Mixing more “white” with a
color
l reduces
d iits saturation.
i
Pink has the same hue as red but less saturation
Intensity
The brightness or darkness of an object
17
S
purity
% white
I
Intensity
18
HSI Color Model
Hue is defined as an angle
0 degrees is RED
120 degrees
d iis GREEN
240 degrees is BLUE
20
HSI Color
Model
22
Conversion Between RGB and
HSI
Color Distance
Quantifying
Q tif i ththe diff
difference ((or simil
similarity)
it )
between two colors
L1 metric is the taxi-cab distance
L2 metric
t i iis th
the straight-line
t i ht li di distance
t
Distances are often normalized to the
interval [0-1]
Compute the distance in normalized color space
Divide by maximum possible distance in that
space 25
Color Distance
26
Color and Images
g
Structure of a digital image
p
pixel – the color of an image
g at a specific
p
point
sample – one dimension of a pixel
band – all samples on the same layer
27
I
Image “T s”
“Types”
((categorized
g by
y “color”))
Binary Image
has exactly two colors
Grayscale
has no chromatic content
Color
contains some pixels with color
more than two colors exist
28
Color Depth
p
Describes the ability of an image to accurately
reproduce colors
Given as the “number
number of bits consumed by a single
pixel”
Otherwise
Other ise known
kn n ass “bits per pixel” (bpp)
A B
C D
A: 1 bpp
pp
B: 2 bpp
C: 5 bpp
D: 24 bpp
30
Tristimulus Values
Tristimulus value
The amounts of red, green, and blue needed to form
any particular
ti l color
l are called
ll d th
the tristimulus
t i ti l values,
l
denoted by X, Y, and Z.
T i h
Trichromatic
i coefficients
ffi i
X Y Z
x= , y= , z=
X +Y + Z X +Y + Z X +Y + Z
Only two chromaticity coefficients are necessary to
specify the chrominance of a light.
X +Y + Z =1
The blobby
region
represents
p
visible colors.
There are sets
off (x,
( y))
coordinates
that don
don’tt
represent real
colors because
colors,
the primaries
are not real
lights
Gamut
Printable Colors
(CMYK mode)
Color Models
Specify three primary or secondary colors
Red, Green, Blue.
Cyan Magenta
Cyan, Magenta, Yellow.
Yellow
Specify the luminance and chrominance
– HSB, HSI or HSV (Hue, saturation, and
brightness, intensity or value)
YIQ (used
( d in
i NTSC colorl TV)
YCbCr (used in digital color TV)
Amplitude specification:
8 bits p
per color component,
p , or 24 bits p
per pixel
p
Total of 16 million colors
YIQ Color Coordinate System
YIQ is defined by the National Television
System
y Committee (NTSC)
Y describes the luminance, I and Q
describes the chrominance.
chrominance
A more compact representation of the
color.
YUV plays similar role in PAL and SECAM.
YUV/YCbCr Coordinate
YUV is the color coordinate used in color
TV in PAL system,
y somewhat different
from YIQ.
Comparison
p of Different Color Spaces
p
Much details
than other
bands (can be
used for
processing
color images)
Color image processing
How can we process a colored image?
By
y processing
p g each RGB component
p
By processing the intensity component of
the HSI image and then converting it to
RGB.
Original /
Corrected
Color Balancing
Color Balancing Corrections for CMYK color images
Original /
Corrected
Example
Another Example
p
Example
(a) Pseudocolor
rendition
diti of f
Jupiter
p Moon.
(b) A close-
up.(Courtesy
(C t off
N
NASA.) .)
Color Quantization
In low end monitors,
monitors the monitor cannot display
all possible colors.