Chapter Seven
Color Image Processing
Agenda
7.1 Color Fundamentals
7.2 Color Models (color space or color system)
7.3 Basics of Full-Color Image Processing
7.4 Morphological image processing
7.5 Color Transformations
2
7.1 Color fundamentals
In automated image analysis, color is a powerful descriptor, which simplifies object
identification and extraction.
The human eye can distinguish between thousands of color shades and intensities but only
about 20-30 shades of gray. Hence, use of color in human image processing would be very
effective.
Color image processing consists of two parts: Pseudo-color processing and Full color
processing.
In pseudo-color processing, (false) colors are assigned to a monochrome image. For example,
objects with different intensity values maybe assigned different colors, which would enable
easy identification/recognition by humans.
In full-color processing, images are acquired with full color sensors/cameras. This has become
common in the last decade or so, due to the easy and cheap availability of color sensors and
hardware.
3
7.1 Color fundamentals
When a beam of sunlight is passed through a glass prism, the emerging beam
of light is not white but consists of a continuous spectrum of colors (Sir Isaac
Newton, 1666).
The color spectrum can be divided into six broad regions: violet, blue, green,
yellow, orange, and red.
4
7.1 Color fundamentals
The different colors in the spectrum do not end abruptly but each color blends smoothly into the next.
Color perceived by the human eye depends on the nature of light reflected by an object. Light that is
relatively balanced in all visible wavelengths is perceived as white. Objects that appear green reflect more
light in the 500-570 nm range (absorbing other wavelengths of light).
5
7.1 Color fundamentals
Characterization of light is important for the understanding of color.
If the light is achromatic (devoid of color), its only attribute is its intensity (amount
of light). This is what we have been dealing with so far. The term graylevel refers to
the scalar measure of the intensity of light --- black to grays to white.
Chromatic light spans the electromagnetic (EM) spectrum from approximately 400
nm to 700 nm.
Three basic quantities are used to describe the quality of a chromatic source of light:
Radiance is the total amount of light that flows from a light source (measured in
Watts).
Luminance gives a measure of the amount of energy an observer perceives from a
light source (measured in lumens).
Brightness is a subjective descriptor that is impossible to measure.
6
7.1 Color fundamentals
Cones in the retina are responsible for
color perception in the human eye.
Six to seven million cones in the human
eye can be divided into three categories:
red light sensitive cones (65%), green
light sensitive cones (33%) and blue light
sensitive cones (2%). The latter cones are
the most sensitive ones.
Absorption of light by the three types of
cones is illustrated in the right side figure:
7
7.1 Color fundamentals
Due to the absorption characteristics of the human eye, all colors perceived by
the human can be considered as a variable combination of the so called three
primary colors:
Red (R) (700 nm)
Green (G) (546.1 nm)
Blue (B) (435.8 nm)
The wavelengths for the three primary colors are established by standardization
by the CIE (International Commission on Illumination). They correspond to the
experimental curve only approximately.
Note that the specific color wavelengths are used mainly for standardization. It is
not possible to produce all colors purely by combining these specific
wavelengths. 8
7.1 Color fundamentals
Primary colors when added
produce secondary colors:
Magenta (red + blue)
Cyan (green + blue)
Yellow (red + green)
9
7.1 Color fundamentals
The characteristics used to distinguish one color from
another are:
Brightness (or value) embodies the chromatic notion
of intensity.
Hue is an attribute associated with the dominant
wavelength in a mixture of light waves. It represents
the dominant color as perceived by an observer (ex.
orange, red, violet).
Saturation refers to the relative purity or the amount
of white light mixed with a hue. Pure colors are fully
saturated. Colors such as pink (red + white) and
lavendar (violet + white) are less saturated, with the
saturation being inversely proportional to the amount
of white light added.
Hue and saturation together are called chromaticity. A
color can be described in terms of its brightness and
10
chromaticity.
7.1 Color fundamentals
11
Chromaticity diagram
Another approach to specifying colors is via the CIE
chromaticity diagram, which represents color composition
by means of x (red) and y (green) values.
For any value of x (red) and y (green), the corresponding
value of z(blue) is given by z = 1 - (x +y) .
12
Color Models
The purpose of a color model (or color space or color system) is to facilitate the specification of
color in some standard fashion.
A color model is a specification of a 3-D coordinate system and a subspace within that system
where each color is represented by a single point.
Most color models in use today are either based on hardware (color camera, printer) or on
applications involving color manipulation (computer graphics, animation).
In image processing, the hardware based color models mainly used are: RGB, CMYK, and HSI.
The RGB (red, green, blue) color system is used mainly in color monitors and video cameras.
The CMYK (cyan, magenta, yellow, black) color system is used in printing devices.
The HSI (hue, saturation, intensity) is based on the way humans describe and interpret color. It
also helps in separating the color and grayscale information in an image.
13
RGB Color Model(Additive)
Each color appears in its primary spectral components of red (R),
green (G), and blue (B).
Mainly used for hardware such as color monitors and color video camera.
It is based on a Cartesian coordinate system. All color values are
normalized so that the values of R, G, and B are in the range [0,1]. Thus,
the color subspace of interest is the unit cube.
The primary colors red, green, and blue correspond to three corners of the
cube, whereas the secondary colors cyan, magenta, and yellow
correspond to three other corners. Origin (0,0,0) represents black and
(1,1,1) represents white.
Grayscale (monochrome) is represented by the diagonal joining blak to
white.
14
RGB Color Model
Different points on or inside the cube correspond to different colors and can
be represents as a vector or three values or coordinates. Each coordinate
represents the amount of that primary color present in the given color.
Images in the RGB model consist of three independent component images,
one for each primary color.
When fed to into an RGB monitor, these three images combine on the
phosphor screen to produce a composite color image.
The number of bits used to represent each pixel in RGB space is called
pixel depth.
For example, if eight bits are used to represent each of the primary
components, each RGB color pixel would have a depth of 24 bits. This
is usually referred to as a full color image.
There are 224 = 16,777,216
15
CMY/CMYK Color Models(Subtractive)
16
HSI Color Models(Subtractive)
17
HSI Color Models(Subtractive)
18
7.3 Basics of Full Color Image Processing
1. Image Representation-color image represented as 2D Matrix of Pixels
2. Image Acquisition-color image obtained by electronic device(camera, scanners, smartphone)
3. Preprocessing-applied color image-to correct imperfection and enhance the quality.
4. Color Space Conversion-RGB to LAB and RGB to YUV
5. Color Enhancement- To improve the visual quality of color image(brightness, contrast)
6. Color Filtering-Filters, convolution-For edge detection, blurring, sharpening.
7. Color Histogram Analysis-Distribution of colors in each channel
8. Segmentation-clustering similar color
9. Color Image Compression-JPEG used for full color image
10. Object Recognition and Tracking-based on color the object can be identified and tracked
11. Image Analysis and Pattern Recognition- color feature
12. Display and Visualization-monitor, projectors, printer
13. Color Correction and Grading-Adjust the color and mood of images and videos.
19
7.5 Color Transformation
Color transformation, in the context of digital image processing, refers to the process of converting an image
from one color space or color model to another.
RGB to Grayscale:
Converting an RGB (Red, Green, Blue) image to grayscale results in a single-channel image where pixel values
represent intensity. This is achieved using various methods, such as averaging the RGB channels or applying
different weightings to each channel, depending on the intended perception of luminance.
RGB to CMY/CMYK:
Converting from RGB to CMY (Cyan, Magenta, Yellow) is useful for color separation in printing. In CMYK,
black (K) is often added to create a four-color separation suitable for color printing.
RGB to HSL/HSV:
Transforming an RGB image to the HSL (Hue, Saturation, Lightness) or HSV (Hue, Saturation, Value) color
spaces can be useful for adjusting color balance, enhancing specific colors, or isolating regions with specific
hues.
RGB to LAB:
Converting to the LAB color space is common for color correction and color analysis. LAB is designed to be
perceptually uniform, meaning that equal distances in LAB space correspond to roughly equal perceptual 20
differences.
Thank you