0 ratings 0% found this document useful (0 votes) 19 views 13 pages Digital Image Unit 3
The document discusses color image processing, focusing on multi-spectral and multi-model imaging, highlighting the advantages of color over grayscale images. It covers fundamental concepts such as primary and secondary colors, color models (RGB, CMY, HSI), and various techniques for color transformation and processing. Additionally, it addresses methods for color image smoothing and sharpening, emphasizing the need to treat color components as vectors in processing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
Save Digital Image Unit 3 For Later apmiwv>rin
COLOR IMAGE PROCESSING
5.1_ INTRODUCTION
Till now we have discussed the gray level images where a pixel value at any image point can be
represented by a single-valued function with a range of 0 to 255 in a 8-bit system. Image may
be multivalued also by making more than measurement at a point. These types of images can be
grouped into two major types:
1. Multi-spectral : As the name suggests, measurement corresponds to different spectral bands
of frequencies (‘or’ wavelength) of electromagnetic wave. For example, color imaging.
2. Multi Model : The measurement of different physical properties of any single object ‘or’ its
parts are concept of multi-model imaging. Different sensors are employed to extract multi-
model characteristics. For example, X-ray, CT-Scan, MRI, ete.
Now here we will study multi-spectral-color imaging in detail.
5.2_ ADVANTAGES OF COLOR IMAGE PROCESSING
() By color image processing we can identify object easily.
(i) Human can discern thousands of colors shades and intensities, compared to only two dozen
shades of gray.
5:3 CATEGORIES OF COLOR IMAGE PROCESSING
(@) Full color processing : In this method, we acquire color image directly by TV Cameras, ‘or’
colorscanner. Cea. sl
(6) Pseudo-color processing : In this category, we assign a color to a particular monochrome
intensity ‘or’ range of intensities.
$4 COLOR FUNDAMENTALS
Three basic quantities are used to describe the quality of a chromatic light source:
6364 Digital Image Processing
(@) Radiance : Radiance is the total amount of energy that flows from light source. Itis measur
Due to this sensitivity of human eyes with respect to colors. Red, green and blue are the primary
colors.
in watts.
(©) Luminance: Luminance gives the measure of energy that a observer perceives from the sour,
Itis measured in lumens.
(0 Brightness : Itis a subjective descriptor that is practically impossible to measure.
5.5 PRIMARY COLORS
Experimentally it has been seen that 6-7 million cones in human eyes can be divided into three basic
sensing categories, corresoponding roughly to red, green and blue.
65% cons — sensitive for red.
33% cons — sensitive for green and
2% cons — sensitive for blue.
|
Absorption
Fig. 5.1. Primary color spectrum.
5.6 SECONDARY COLOR
Primary colors can be added to get secondary colors of light.
Magenta — Red + Blue
Cyan— Green + Blue
Yellow — Red + Green
Magenta
Red YZ,
Mp2
White
cyan q
Yellow
Fig. 5.2. Primary and secondary color.Color Image Processing 65
7 PRIMARY AND SECONDARY COLORS FOR PIGMENTS
5.
Justopposte to thesimple technique.
lust oppos
_s Primary color— Magenta, cyan, yellow
“5 secondary color—Red, blue and green,
58 CHARACTERISTICS THAT ARE USED FOR DIFFERENTIATING DIFFERENT
3.
COLORS
(@) Brightness : It is notation for intensity. It cannot be practically measured.
() Hue: Dominant wavelength in a mixture of light waves
(©) Saturation :It gives the measurement of degree to which pure light is diluted by white light.
1
White light added
Pure color has high saturation and pink color means mixed color has less saturation.
Saturation «
Hue + saturation = called chromaticity.
5.9 COLOR MODELS
The purpose of color model is to facilitate the specification of colors in some standard, generally
accepted way.
Thusin color model, we use coordinate system so that each color can be represented by a point.
These are different types of color models we can choose any one according to our requirement.
(®) RGB Model : Used for color model and broad class of color models corners.
() CMY ‘or’ CMYK Model : Used for color printing
(9 HSI Model : Used for human description and interpretation of colors. It decouples the colors
and gray scales in an image. iron (Site
$9.1 AY 3
The RGB-Color Model
Inthis model, we use cartesian coordinate system for presentation of color.
| RGB are at three points at comers and atbasic scale.
) Magenta, yel
© Blackis situ
White shows
ANlother col
ftom origin,
low and cyan are at three remaining points at corner.
‘ated at origin and White is situated at the farest point. The line joining black and
'S gray scale,
lors are inside the cube in the form of points and are defined by vectors extending
(0 Pixel depth: Number Of pixels used to represent a pixel is called pixel depth.
The tal application, we require 8 bits for presenting.a color.
's, for RGB, weneeds = 8 x3 = 24 Bits
So total number of colors = 224
= 16, 777, 216.66 Digital Image Processing
Magenta
}—> Gray scale
Black
R Yellow
Fig. 5.3 The RGB model in co-ordinate system.
(P) But this large number of colors are practically not usable that why we use only 256 colors.
“The set of colors that can be used in stead of whole colors is called subset of colors. Thatés also calle
safe RGB colors”.
5.9.2. The CMY and CMYK Color Model
Alternatively colors can be represented by secondary colors (‘or’ primary colors of pigment).
By RGB, we can get CMY by
1] [R
CMY = }1/-|G
i B}
This is generally used for color printing, But the output color black is muddy black that’s why W®
add black in this model, so called CMYK color model.
5.9.3 HSI Color Model
“HSI model decouples the color and gray levels. It is the model that will provide information about image tit
is easily described and interpreted”.
Black
Fig. 5.4 HSI color model.
mcecy eae abe od [es pane ett black and white points called intensity 2x!
e nsity of any color ; we wil i intens!
axis and containing that color point. : Regeaes ce ConenclsColor Image Processing 67
= In this plane, the saturation will increase, if the distance f ity axi
; from th
ea ie intensity axis has been
— This plane will contain same hue at every
plane at verticle axis. Point. To get different hue, we have to rotate the
Now tocalculate the hue at any point just se the different representation of color model as given
below
Green Yellow
ys white
eg
cyan oe Red yan Red
Green Yellow
Blue Magenta Blue Magenta
Fig. 5.5 Hue color model and calculation of Hand S.
By this figure, it should be clear that angle between primary colors is 120° and also the angle
between secondary colors is 120°. Now we have taken red color as reference and hue increases
counter clock wise from there.
Saturation is calculated by the distance from reference point.
5.10 CONVERSIONS BETWEEN COLOR MODELS
5.10.1 Converting Colors from RGB to HSI
Given an image in RGB color formate, the H components of each RGB pixel is obtained by equations:
6 if BsG
- (Gal)
He (ee if eee
1
+[(R-G)+(R-B)]
With @= cos) —2 | 7 aoe.
[Ro +(R-B)(G-B)]
The saturation components given by
3 i 63)
=1-—3_— [min ®,G,B)]
S=1-Rrese |
Finally, the intensity components given by
64
1-1 (R+G+8) Ca
o en meas-
It is assumed that RGB values have been normalized to range [0, 1] and angle @ has bet
ured w.r.t. red axis of HSI space.=
68 Digital Image Processing
5.10.2 Converting colors from HSI to RGB
RG sector (0° < H < 120°): When His in this sector, the RGB components are given by equation
B=1(1-S)
Rett ScosH
~ [cos (60° H) (3)
1-(R+B).
GB Sector (120° < H < 240°) : For this sector,
H=H-120°
Now, R=1(1-S)
S.cos H
Sea |r ooe :
iy fe otal 69
B=1-(R+G)
BR Sector (240° < H< 360°):
H=H - 240°
Now, G=1(1-S)
S.cos H a
BL aoe (5.7)
[ ses 6.
R=1-(G+B)
5.11__PSEUDO COLOR IMAGE PROCESSING
“In this process, we simply assign a color to a gray level that’s why called false coloring ‘or’ Pseudo-colot
image processing”
5.11.1 Intensity Slicing
One of the most popular technique is intensity slicing and then color coding.
Now take image a 3-D function. Now place a parallel plain to the coordinate plane of image
£ (xy) > (aray - level axis)
Fig. 5.6 Intensity slicing.Color Image Processing 69
Now we may assign two different colors; if the gray levels are above then plane, we will assign
one olor. If gray level below then plane, we will assign second color. The gray level atthe plane
‘teelf, that can be assigned arbitrary any color out of these two colors
[fwe want to take more than one color, we can move parallel plane up and down parallely.
Wecan represent the slicing technique by the following figure:
Colors
Fig. 5.7 _ Representation of intensity slicing.
5.11.2 Grey Level to Color Transformation
One possible and easy method of color transformation is that gray levels of an image are fed sepa-
rately to red, green and blue transformations and then fed these three colors to different channels of
color television monitor. Now by these channels of color television, we used to generate composite
(aad Red fy (xa
a ee |e
oa en
fer en
image.
Blue =» fa (xy)
transformation
Fig. 5.8 Color transformation of an image.
“Note that this transformation is a function of gray levels only, not the positions of gray levels".
3 . , or
1g lot slicing is a special case ofthis transformation but this technique provides smooth, n
‘near flexible functions of transformation. ie
Th i F e i ' i i e time itis req
technique discussed just till now is applied to single image, but some MN stor.
: ,
eee anumber ofimages ina single composite signal. Then we follow the
ion :70 Digital Image Processing
fen > a)
(x.y)
[> he (xy)
fy)
Additional
ee Processing
ax{osy)
fy) [>> hey)
Fig. 5.9 Color transformation of images.
5.12 COLOR TRANSFORMATION
“In this transformation, we will discuss the process of all the components of color image within single colo
model”. (till now we have discussed in the form of RGB, HSI and CMYK).
5.12.1 Formulation
We know for transformation of an image
suy=TKeY)
Now f(x,y) = color image
and g(t, y) = output processed color image.
and T= transformation operator onf.
-» (68)
Now (2,y) isnota single value but triplet ‘or’ quartets value for color image.
We again know that
p= Ty ye Pay eeey My) FED, 2y ere 64)
Here n denotes the number of components to present a image.
For RGB, n= 1,2,3,as RGB
for CMYK, n= 1,2,3,4.as CMYK G10)
i= denotes the transformation function to produce aS,
Ingeneral if we wantto
(@ modify the intensity ofimage
g(uW=kf(x,y) O3)o ‘
5;=
| h 5 otherwise
where w= width of window (cube) of RGB.
This natural color is middle gray ‘r’ (0.5, 0.5, 0.5).
(6.15)
5.13 COLOR IMAGE SMOOTHING AND SHARPENING
‘As we know that full-color images have at least three components so color pixels are vectors.
For example, in the RGB system, each color point can be interpreted as a vector extending from
origin to that point in RGB co-ordinate system.
Let ‘C’ represents an arbitrary vector in RGB color space.
Ce] [R
c=|C,|=|6 6:18)
cy] [B
This equation indicates that the components of Care simply the RGB components of color ima8*
ata point. We take into account the fact that the color components are a function of co-ordinates
(x, y) by using the notation :
Ce(xy)] [RY
C(x, y)=| Co (x, y)|=| G(x, y) wa (617)
Coley} (Bley) |
Foran image of size MXN, there are MN such vectors, C (x, y), for x=0, 1,2,
=0,
1,2, N-1L .,M=Land |Color Image Processing 73
$0 now you can easily understand the figure given below. So “
“awe can apply gray scale ima;
processing here also. But now this technique has to be applie “tly ns
'd to each component separately’.
Mask
Gray - scale Image RGB Color Image
Fig. 5.12 Mask applied on color image
Now after clearing these facts, now we can apply spatial filtering for color image smoothing and
sharpening.
5.13.1 Color Image Smoothing
Gray level smoothing can be viewed as a spatial filtering operation in which the coefficients of
filtering mask are all 1’s. As the mask is slide across the image, each pixel is replaced by the average
of the pixels in the neighbourhood. Thus image is smoothed. As discussed at the beginning, this
concept can be extended to the full color image also means same process has to be done on each color
component of color image separately. “One basic difference between gray scale image processing and color
image processing is that now we have to work with vectors”.
Lets,, denotes the set of co-ordinates defining a neighbourhood centered at (x, ) inan RGB color
image. The average of the RGB component vectors in that neighbourhood is
= 1
eae a Yew) ~+- (5.18)
(yey
Again in the form of vector:
YR
WE Sey
Sc (a) w+ (5.19)
(eWesy
b YB)
(eyesy
C(x, y) =
5.3
13.2 Color-Image Sharpening ;
is done by Laplacian. For
whose components are
he RGB colorsystem,
‘calling the sharpening of gray-scale images the color image sharpening
quot analysis, we know that the Laplacian of a vector is defined as vector
Walto Laplacian of individual scalar components of the input vectors. In74 Digital Image Processing
VIC(x WI=]V? G(x ¥) (6.20)
Vv? B(x, y)
So the compute the Laplacian of a full color image, we have to compute the Laplacian of each
component of image individually.
5.14 COLOR SEGMENTATION
We will study segmentation in detail in a complete chapter. But here to continue the color image
processing, we will study color segmentation. So for general understanding purpose, let us define
segmentation. Segmentation means to divide an image in the segments. All the segments are totally
separated means. One segment will not have any property that any other segmenthas. But ina single
segment all the pixels will have same qualities. Segmentation of an image can be done by two methods
1. By finding similarities between pixels and arranging them ina single segment (with all simi-
larities).
2. By finding differences between pixels and arranging them in different segments according to
their differences.
Now we will study segmentation in color images.
5.14.1 Segmentation in RGB Images
‘Suppose that, our objective is to segment objects of a specific color range in a RGB image. We have
givena setof sample color points that represents the colors of our interested color range. By thatset
of colors, we simply estimate the ‘average’ color that we want to segment. Let this average colorbe
denoted by RGB vector ‘a’.
Now our purpose is to compare the each RGB pixel of our image with this average value.
One of the simplest way to find the similarities between both is Euclidean distance. Let z denote
an arbitrary point in RGB space.
The Euclidean distance between ‘z’ and ‘a’ is given by
D(z,a)= 11 z-all
= [(@-a)"(2—a)}"?
= [@n—a9)* + Zq—Ac)? + (2e-49)"]
where the subscripts R, G and B, denote the RGB components of vectors a and z. We say that zis
similar to a if the distance between them is less than specified threshold Do.
1/2
Y summary
1. Ingray level images, image is a single valued function ;but there are other methods of imagins
in which image are multi-valued function such as multispectral and multimodel.
2. Example of multispectral is color imaging.
3. By color imaging, human being easily can identify the objects.S
no
10,
Color Image Processing 75
Color imaging is categorized in two categories : Full color ima;
with color images. In second category,
converted into color images.
ging where we directly deals
called pseudo-color imaging, gray-level images are
To describe the chromatic (color) light source ; we describe thr
ee factors called radiance, lumi-
nance and brightness.
To differentiate different color ; we describe brightness, hue and saturation.
Binary colors are red, green and blue. Secondary colors are made u
ip of combining primary
colors. Secondary colors are magenta, gyan and yellow.
. For eyes pigment, primary colors are magenta, cyan and yellow and secondary colors are red,
blueand green.
. RGB, CMY (CMYK) and HSI model are some standard models for color imaging.
As in case of gray-level images ; we can smooth “or’ shar;
p the color images. But now same
process has to be done on three planes.
a Review Questions
Whatare primary colors and secondary color in color imaging ? How are they defined ?
» Describe the RGB color model ? How are these color can be converted to HSI color model ?
. Describe HSI color model. How will you calculate hue and saturation from this model ?
- What is pseudo-color-image processing ? How does a gray image convert into colorimage?
What do you understand by color slicing ?
. Describe
@) color imaging smoothing
( color imaging sharpening.
~ Describe color image segmentation.
oi