Color Image Processing
Color Image Processing
PROCESSING
April 10, 2024
HUMAN VISUAL SYSTEM
2
STRUCTURE OF THE HUMAN EYE
▪ Iris contains the pigment that gives our eyes their colour
▪ The lens focuses light from objects onto the retina
4
STRUCTURE OF THE HUMAN EYE
2 types of Receptors:
Cones (for details) and
Rods (for general vision)
▪ Muscles controlling the eye rotate the eyeball until the image
falls on the fovea
▪ Pattern vision is possible through the distribution of discrete
light receptors over the surface of the retina 5
STRUCTURE OF THE HUMAN EYE
• Cones (Cone vision: photopic or bright-light vision)
▪ 6-7 million, located primarily in the central portion of the
retina (the fovea)
▪ Highly sensitive to color; each is connected to its own
nerve end thus human can resolve fine details
• Rods (Rod vision: scotopic or dim-light vision)
▪ 75-150 million, distributed over the retina surface
▪ Several rods are connected to a single nerve end reduce
the amount of detail discernible
▪ Give a general, overall picture of the field of view
▪ Sensitive to low levels of illumination
6
STRUCTURE OF THE HUMAN EYE
8
HUMAN VISUAL SYSTEM
9
PHYSICAL NATURE OF COLOR
380 780
18
COLOR FUNDAMENTALS
▪ Color in the eye
o Varying sensitivity of different cells
in the retina (cones) to light of
different wavelengths:
• S-cones: short-wavelength (blue);
• M-cones: middle-wavelength (green);
• L-cones: long-wavelength (red).
22
COLOR FUNDAMENTALS
▪ Primary, Secondary and Complementary colors
o Due to different absorption curves of the cones,
colors are seen as variable combinations of the so-
called primary colors: red, green and blue.
o Primary colors added to produce the secondary
colors : magenta (R+B), cyan (G+B), yellow (R+G).
Mixture of lights
(Additive primaries)o Subtractive primaries: used mainly in color
printing, where light is absorbed by dyes
o For pigments and colorants, a primary color is the
one that subtracts (absorbs) a primary color of
light and reflects the other two.
o This provides an
international standard
definition for all colors
26
COLOR FUNDAMENTALS
▪ From tristimulus values to chromaticity coordinates
o The amounts of R, G, and B needed to form any particular
color are called the tristimulus values and denoted by X, Y,
and Z (imaginary colors)
o A color is specified as a vector in 3D space by its
trichromatic coefficients: Cλ = XX+YY+ZZ
(X,Y and Z: amount of standard primaries needed to match Cλ)
yellow 600 nm
cyan white 700 nm
490 nm red
blue
600
variations that can be 490 700
obtained by
R
combining these two 400 G
colors additively
Three primaries can
o A line drawn from the only generate colors
point of equal energy inside or on the
to any point on the
The CIE 1931 bounding edges of
boundary of the chart:
chromaticity diagram the triangle
all shades of that
particular spectrum 30
color
COLOR FUNDAMENTALS
• Chromaticity Diagram: useful for color mixing
printing device
o Color gamuts for video monitors
color gamut
and hard copy devices are
conveniently compared on the
chromaticity diagram
o The Color Gamuts of different
Typical gamuts of a displays and printers are not
monitor and of a likely to match. Printers usually
printing device have smaller gamuts. 31
COLOR MODELS
▪ The color of an object depends not only on the object itself,
but also on
▪ Light source illuminating it;
▪ Color of the surrounding area; and
▪ The human visual system
32
COLOR MODELS
• Provides a coordinate system and a subspace in it
where each color is represented by a single point.
• No single color model can explain all aspects of color
• Different models are used to help describe the
different perceived characteristics of color
• Common Color Models:
− RGB (monitors, video cameras),
− CMY/CMYK (printers), h/w oriented
models
− HSI/HSV/HSL/HSB (image processing),
− CIE Lab (image processing). Device independent model
33
COLOR MODELS
The main diagonal of the RGB cube represents all shades of gray. 34
COLOR MODELS
37
COLOR MODELS
▪ CMY color model
Y o The Cyan, Magenta and Yellow primaries are the
G complements of Red, Green and Blue respectively
W R o When used as filters to subtract color from white
C B light, they are called subtractive primaries
M o When a surface is coated with cyan ink, no red
light is reflected from the surface
39
COLOR MODELS
40
COLOR MODELS
• HSI color space V
green yellow
120˚
H
black S
0.0
41
COLOR MODELS
▪ HSI color space
o Human eye can distinguish about
128 different hues and about 130
saturation levels
o For each of these, a number of
value settings can be detected,
depending on the hue selected
o 23 shades with yellow color
o 16 shades with blue color
o For most graphics applications,
128 hues, 8 saturation levels and
15 value settings are sufficient
Graphical depiction of HSV
(cylinder and cone) o 16384 available colors, 14 bits of
color storage per pixel
42
COLOR MODELS
▪ Conversion from RGB to HSI
Given an image in RGB color format, the H component of each
RGB pixel is:
𝜃 𝑖𝑓 𝐵 ≤ 𝐺
𝐻=ቊ
360 − 𝜃 𝑖𝑓 𝐵 ≤ 𝐺
1
𝑅−𝐺 + 𝑅−𝐵
with 𝜃 = cos −1 2
1ൗ
𝑅−𝐺 2 + 𝑅−𝐵 𝐺−𝐵 2
3
𝑆 =1− min 𝑅, 𝐺, 𝐵
𝑅+𝐺+𝐵
1
𝐼 = 𝑅+𝐺+𝐵
3
Assumption: RGB values normalized in the range [0,1]
Angle θ is measured wrt the red axis
Hue can be normalized to the range [0,1] by dividing by 3600
44
COLOR MODELS
▪ Conversion from HSI to RGB
Given values of HIS in the interval [0, 1]
Applicable equations depend on the value of H
(multiply H by 3600, gives hue to original range of [00,
3600])
RG sector (00 ≤ H< 1200):
When H is in this sector, the RGB components are given by
𝐵 =𝐼 1−𝑆
𝑆 cos 𝐻
𝑅 =𝐼 1+
cos 600 − 𝐻
𝐺 = 3𝐼 − (𝑅 + 𝐵)
45
COLOR MODELS
▪ Conversion from HSI to RGB
RG sector (1200 ≤ H< 2400):
𝐻 = 𝐻 − 1200
𝑅 =𝐼 1−𝑆
𝑆 cos 𝐻
𝐺 =𝐼 1+
cos 600 − 𝐻
𝐵 = 3𝐼 − (𝑅 + 𝐺)
RG sector (2400 ≤ H< 3600):
𝐻 = 𝐻 − 2400
𝐺 =𝐼 1−𝑆
𝑆 cos 𝐻
𝐵 =𝐼 1+
cos 600 − 𝐻
𝑅 = 3𝐼 − (𝐺 + 𝐵) 46
COLOR IMAGE PROCESSING
▪ Basics
o Full-color images have at least three components,
therefore color pixels are vectors
o Two approaches:
1. Process each component image individually and
then form a composite processed color image from
the individually processed components
2. Work with color pixels directly
o The results of individual color component processing are not
always equivalent to direct processing in color vector space,
in which case we must formulate new approaches 47
COLOR IMAGE PROCESSING
▪ Basics
o Neighborhood spatial processing of gray-scale
and full-color images:
Averaging done on
a per-color-
component basis
and then the vector
is formed 48
COLOR IMAGE PROCESSING
▪ Color Transformations - intensity transformation
o 𝑔 𝑥, 𝑦 = 𝑇 𝑓 𝑥, 𝑦
o The pixel values here are triplets or quartets from the color
space chosen to represent the images
o Basic intensity transformation:
𝑠𝑖 = 𝑇𝑖 𝑟1 , 𝑟2 , … . , 𝑟𝑛 , 𝑖 = 1, 2, … , 𝑛
where 𝑠𝑖 and 𝑟𝑖 denote the color components of 𝑓 𝑥, 𝑦 and
𝑔 𝑥, 𝑦 at any point 𝑥, 𝑦 ;
n is the no. of color components; and
𝑇1 , 𝑇2 , … 𝑇𝑛 is a set of transformation or color mapping
functions that operate on 𝑟𝑖 to produce 𝑠𝑖
value of 𝑛 comes from the color space chosen to describe 49
images
COLOR IMAGE PROCESSING
▪ Color Transformations - intensity transformation
50
COLOR IMAGE PROCESSING
▪ Color Transformations - intensity transformation
o Modifying the intensity of the full-color image using
𝑔 𝑥, 𝑦 = 𝑘𝑓 𝑥, 𝑦 where 0 < k < 1.
o This transformation in HSI color space:
𝑠3 = 𝑘𝑟3 ; 𝑠1 = 𝑟1 ; 𝑠2 = 𝑟2 (only intensity component is modified)
o This transformation in RGB color space:
𝑠𝑖 = 𝑘𝑟𝑖 ; i=1,2, 3
o This transformation in CMY color space:
𝑠𝑖 = 𝑘𝑟𝑖 + 1 − 𝑘 ; i=1,2, 3
o HIS transformation involves the fewest no. of operations, the
computations required to convert an RGB or CMY(K) image to the HIS
space more than offsets the advantages of the simpler transformation
51
COLOR IMAGE PROCESSING
• Color Transformations - intensity transformation
o Result of applying intensity transformation discussed to
the full color image
52
COLOR IMAGE PROCESSING
▪ Color Complements: useful for enhancing detail that is
embedded in dark regions of a color image
L*= 25
L*= 75
64
64
COLOR IMAGE PROCESSING
▪ Histogram Processing
o Usually histogram
equalization of the
components of a
color image
independently results
in erroneous color
o More logical: spread
the color intensities
uniformly , leaving
the colors unchanged
o HIS color space
ideally suited for this
65
COLOR IMAGE PROCESSING
▪ Color Image Smoothing
o The concept of spatial filtering operation is easily
extended to the processing of full-color images – deal
with the component vectors
66
COLOR IMAGE PROCESSING
▪ Color Image Sharpening using the Laplacian
o The Laplacian of a vector is defined as a vector whose
components are equal to the Laplacian of the
individual scale components of the input vector
67
REFERENCES
o Gonzalez R, Woods R. Digital Image Processing, published by Pearson
Education, Inc, 2002
68