0% found this document useful (0 votes)
63 views39 pages

Color Image Processing Basics

This document discusses color image processing and analysis. It covers topics like the electromagnetic spectrum, color fundamentals including hue and saturation, RGB and CMY color models, color image representation using direct coding and lookup tables, and the differences between additive and subtractive color systems. The document is presented by Dr. S K Vipparthi from the Computer Science department of MNIT Jaipur.

Uploaded by

Neeraj Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views39 pages

Color Image Processing Basics

This document discusses color image processing and analysis. It covers topics like the electromagnetic spectrum, color fundamentals including hue and saturation, RGB and CMY color models, color image representation using direct coding and lookup tables, and the differences between additive and subtractive color systems. The document is presented by Dr. S K Vipparthi from the Computer Science department of MNIT Jaipur.

Uploaded by

Neeraj Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Image Analysis

Dr. S K Vipparthi, CSE, MNIT Jaipur

Color Image Processing


Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

The Digital Image


Colour Fundamentals
In 1666 Sir Isaac Newton discovered that when a
beam of sunlight passes through a glass prism,
the emerging beam is split into a spectrum of
colours
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

Fig. The electromagnetic spectrum


Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur
Color Images
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

basic qualities are used to describe the quality of a


chromatic light source:
Radiance: the total amount of energy that flows
from the light source (measured in watts)
Luminance: the amount of energy an observer
perceives from the light source (measured in lumens)
Note we can have high radiance, but low luminance
Brightness: a subjective (practically unmeasurable)
notion that embodies the intensity of light
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

Color
 When the resulting color is created by illuminating an object by white
light and then absorbing some of the wavelengths (colors) we use the
notion of subtractive colors.
 Exactly as when you mix paint to create a color. Say you start with a
white piece of paper, where no light is absorbed. The resulting color will
be white.
 If you then want the paper to become green you add green paint, which
absorbs everything but the green wavelengths.
 If you add yet another color of paint, then more wavelengths will be
absorbed, and hence the resulting light will have a new color.
 Keep doing this and you will in theory end up with a mixture where all
wavelengths are absorbed, that is, black.
 In practice, however, it will probably not be black, but rather dark
gray/brown.
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

Color Image

 This notion applies when you create the wavelengths as opposed to


manipulating white light.
 A good example is a color monitor like a computer screen or a TV screen.
Here each pixel is a combination of emitted red, green and blue light.
 Meaning that a black pixel is generated by not emitting anything at all.
 White (or rather a shade of gray) is generated by emitting the same
amount of red, green, and blue.
 Red will be created by only emitting red light etc.
 All other colors are created by a combination of red, green and blue.
 For example yellow is created by emitting the same amount of red and
green, and no blue.
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

Fig.: A color image


Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

RGB to GRAY

Fig.: A color image and how it can be mapped to different gray-scale images
depending on the weights
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

Normalized RGB
CMY
▪ On other hand there is a complementary color model
called CMY.
▪ CMY color model defines color by subtractive process.
▪ Subtractive models closely works with the working
principles of Printers.
▪ In CMY model we begin with white and take away the
approximate primary components to yield a desired color.
Ex:- If we subtract red from white, what remains consist of
green and blue is called Cyan.
▪ Let’s look at from another perspective –
▪ We can use the amount of cyan (the complementary color
of red), to control the amount of red, which is equal to one
minus the amount of cyan (1-cyan).
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

CMY model (+Black = CMYK)


CMY: secondary colors of light, or primary colors
of pigments
Used to generate hardcopy output

 C  1  R 
 M   1  G 
    
 Y  1  B 
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur
Spatial resolution and color

B
original

Slide credit: Bill Freeman


Blurring the G component

B
original processed

Slide credit: Bill Freeman


Blurring the R component

B
original processed

Slide credit: Bill Freeman


Blurring the B component

B
original processed

Slide credit: Bill Freeman


RGB Color Model
▪ The color is a complex and interdisciplinary
subject spanning from physics to psychology.
▪ A color coordinate system has 3 primary colors –
Red, Green and Blue.
▪ Each color take on an intensity value ranging
from 0 (Off - Lowest) to 1 (On - Highest).
▪ Mixing of these primary colors at different
intensity levels produces a variety of colors.
▪ The collection of all the colors obtained by such a
linear combination of R,G,B form the cube shape
color combination.
RGB Color Model
▪ The corner of the RGB color cube that is at the origin of the
coordinate system corresponds to black.
▪ The corner of the cube that is diagonally opposite to the
origin represents white.
▪ The diagonal line connecting black and white corresponds
to all the gray colors between black and white is called gray
axis.
▪ Color specification using RGB model is an additive process.
▪ We begin with black and add on the approximate primary
component to yeild a desired color.
▪ This closely matches 2 working principles of the display
monitor.
Direct Coding
▪ In direct coding we allocate certain amount of
storage space for each pixel to code its color.
Ex:- If we allocate 3 bits for each pixel where 1 bit
each is the primary color. These 3 bits allow each
primary to vary independently between 2 intensity
levels: 0 or 1.
Each pixel can take on one of the 8 colors that
corresponds to the corners of the RGB color cube.
▪ A widely accepted industry standard uses 3 Bytes (24 bits), with
one Byte for each primary color.
▪ This way we allow each primary color to have 256 different
intensity levels. It corresponds to binary values from 00000000 to
11111111.
▪ Hence a pixel can take one color from 256x256x256 or 16.7 million
possible choices.
▪ This 24-bit format is commonly referred to a true color
representation.
▪ The difference between 2 colors that differs by one intensity level
in one or more of the primaries is virtually undetected under
normal viewing conditions.
▪ Hence more precise representations involving more bits of little
use in terms of perceived color accuracy.
▪ The direct coding method features simplicity and
supports a variety of applications.
▪ We can see relatively high demand for storage space
when it comes to the 24-bit standard.
▪ Ex:- A 1000x1000 true color image would take up 3-
million Bytes.
▪ If every pixel in that image had a different color, there
would be 1-million colors in that image.
▪ Hence the 24-bit representations ability to have 16.7
million different colors appear simultaneously in a
single image seems to be somewhat overkill!
Lookup Table
▪ The lookup table contains 256 entries
▪ The entries have address 0 to 255.
▪ Each entry contain 24-bit RGB color values.
▪ Pixel values are now 8-bit or 1 Byte quantities.
▪ The color of a pixel whose value is i, where 0<i<255, is
determined by the color value in the table entry whose
address is i.
▪ This 24-bit, 256 entry lookup table representation is often
referred as 8-bit format.
▪ It reduces the storage requirement of 1000x1000 image to
1-million Bytes + 768 (256x3) Bytes for the color values in
lookup table.
▪ It allows 256 simultaneous colors which are
chosen from 16.7 million possible colors.
▪ Using lookup table representation, An image
is defined not only by its pixels values but also
by its color values in the corresponding lookup
table.
▪ Those color values form a color map for the
image.
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

Additive vs. Subtractive color system


involves light emitted directly  Subtractive color starts with
from a source an object that reflects light
mixes various amounts of red, and uses colorants to subtract
green and blue light to produce portions of the white light
other colors. illuminating an object to
Combining one of these produce other colors.
additive primary colors with  If an object reflects all the
another produces the additive white light back to the viewer,
secondary colors cyan, magenta, it appears white.
yellow.  If an object absorbs (subtracts)
Combining all three primary all the light illuminating it, it
colors produces white. appears black.
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

Hue and Saturation


 The hue is the dominant wavelength in the perceived light and
represents the pure color, i.e., the colors located on the edges of the
triangle in Fig.
 The saturation is the relative purity of the color and represents
the amount of white light mixed with the pure color (Hue).
 The degree of saturation being inversely propositional to the amount
of white light added.
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

The HSI Color Representation


Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

The HSV Color Representation


Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

HMMD Color Space


HMMD (Hue-Max-Min-Diff)
color space is closer to a White Color
perceptually uniform color Sum

space. Min
Min = min(R,G,B);
Max = max(R,G,B); Diff
Diff = Max – Min;
Sum = (Max + Min)/2; Hue
Max
-Hue the same as in HSV
Black Color
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

Max: indicates how much black color it has, giving a flavor of shade or
blackness.
Min: indicates how much white color it has, giving a flavor of tint or
whiteness.
Diff: indicates how much gray it contains and how close to the pure color,
giving a flavor of tone or colorfulness.
Sum: simulates the brightness of the color.
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

Chromaticity
Chromaticity: hue +
saturation
Tristimulus: the X
x=
amount of R, G, B needed X +Y + Z
Y
to form any color (X, Y, Z) y=
X +Y + Z
Trichromatic z=
Z
coefficients: x, y, z X +Y + Z
x + y + z =1
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

Color Image Laplacian


The Laplacian of an image f(x,y) is defined as

 2 f ( x, y )  2 f ( x, y )
 f ( x, y ) 
2

x 2
y 2

A common approximation to 2 f ( x, y ) is given by

2 f ( x, y )  [ f ( x  1, y )  f ( x  1, y )  f ( x, y  1)  f ( x, y  1)]  4 f ( x, y )

The Laplacian vector is defined as

 2 R ( x , y ) 
 2 
 [c( x, y )]   G ( x, y )
2

 2 
  B ( x , y ) 
Image Analysis
Dr. S K Vipparthi, CSE, MNIT Jaipur

Color Image Edge Detection


R G B R G B
u r g b v r g b
x x x y y y

2 2 2
R G B R G B
2 2 2

I xx  u.u  uT u    I yy  v.v  vT v   
x x x y y y

R R G G B B
I xy  u.v  uT v   
x y x y x y

1/2
1 
F ( x, y )   ( I xx  I yy )  ( I xx  I yy )cos2( x, y )  2 I xy sin 2( x, y )  
2 

1  2 I xy 
( x, y )  tan 1  
2 I I
 xx yy 

You might also like