KEMBAR78
Color Image Processing | PDF | Color | Rgb Color Model
0% found this document useful (0 votes)
4 views68 pages

Color Image Processing

Chapter 6 of the document discusses color image processing, emphasizing its importance in object identification and extraction. It covers color fundamentals, various color models (RGB, CMY, HSI), and techniques like pseudo-color image processing and intensity slicing. The chapter highlights how colors are perceived and manipulated in digital image processing, providing a comprehensive overview of the subject.

Uploaded by

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

Color Image Processing

Chapter 6 of the document discusses color image processing, emphasizing its importance in object identification and extraction. It covers color fundamentals, various color models (RGB, CMY, HSI), and techniques like pseudo-color image processing and intensity slicing. The chapter highlights how colors are perceived and manipulated in digital image processing, providing a comprehensive overview of the subject.

Uploaded by

Hajer Alatewish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODP, PDF, TXT or read online on Scribd
You are on page 1/ 68

Digital Image Processing

Chapter 6 :
Color Image Processing
Contents

 Color Image Processing

 Color Fundamentals

 Color Models

 Pseudo-color Image Processing

 Full-color Image Processing


Color Image Processing

• The use of colors is important in image processing because:


 Color is a powerful descriptor that simplify object identification and
extraction.
 The human eye can discern thousands of color shades and
intensities, compared to about two-dozen shades of gray.

• Color image processing is divided into two major areas:


 Full color processing: Images are acquired with full color sensor (TV
camera or color scanner).
 Pseudo-color processing: Assigning a color to a particular
monochrome intensity or range of intensities.
Color Fundamentals
• Color spectrum:
 In 1666, Sir Isaac Newton discovered that When a beam of sunlight
is passed through a glass prism, the emerging beam of light is split
into spectrum of colors ranging from violet to red.

• Divided into six broad regions:


 Violet, blue, green, yellow, orange, and
red.
 Each color blends smoothly into the
next.
Color Fundamentals

• Chromatic light span the electromagnetic spectrum EM from 400 to


700 nm.
Color Fundamentals

• The color that human perceive in an object = the light reflected from
the object.
• When white light hits an object, it selectively blocks some colors and
reflects others.
• Only the reflected colors contribute to the viewer's perception of
color.
Human Perception
• 6 to 7 million cones in the human eye :

 65% sensitive to Red light.


 33% sensitive to Green light.
 2 % sensitive to Blue light.

• Due to these absorption characteristic of Human Eye colors are seen


as variable combinations of the so-called Primary colors (Defined CIE
in 1931) :

 Red = 700 nm.


 Green = 546.1nm.
 Blue = 435.8 nm.
Primary Colors of Light
• Colors are seen as variable combinations of the
primary colors of light:
 Red (R) , green (G) , blue (B).
• The primary colors can be mixed to produce the
secondary colors:
 Magenta: R+B, cyan: G+B, yellow: R+G.
 Mixing the three primaries, or a secondary
with its opposite primary color, in the right
intensities produces white light.
 Additive (e.g. TV monitor).
Primary Colors of Pigments
• Primary colors of pigments :
 cyan, magenta, yellow.
 C = W - R, M = W - G, and Y = W - B
 A primary color of pigments is defined as
one that subtracts or absorbs a primary
color of light and reflects or transmits the
other two.
• Secondary colors of pigments:
 Red: M+Y, green: C+Y, blue: C+M.
 Combination of the three pigment
primaries, or a secondary with its opposite
primary, produces black.
 Subtractive (e.g. printer).
Characteristics of Colors
• The Characteristics used to distinguish between one color from another:
 Brightness
• The amount of intensity.
 Hue
• Represents the dominant color (dominant wavelength) as
perceived by an observer (e.g. red, orange, yellow, etc.).
 Saturation
• Refers to the amount of white light mixed with a hue (inversely
proportional to the amount of white light).
• Pure Spectrum colors are fully saturated.
• Distinguish red from pink, marine blue from royal blue, etc.
Characteristics of Colors
Characteristics of Colors
Characteristics of Colors
• Hue and saturation taken together are called chromaticity.
Hue
Chromaticity

Saturation

• A color may be characterized by its brightness and chromaticity.


• The amounts of red, green, and blue needed to form any particular color
are called the Tristimulus values.
 Denoted X(red), Y(green), and Z(blue).
Chromaticity Diagram

• Shows color composition as a function of x(R) and y(G). For any


value of x and y, z(B) = 1 – (x + y).
• The positions of the various spectrum colors are indicated around
the boundary of the tongue-shaped.
• Any point not actually on the boundary but within the diagram
represents some mixture of spectrum colors.
• The point of equal energy = equal fractions of the three primary
colors = CIE standard for white light.
• Boundary : completely saturated.
• The Chromaticity Diagram is useful for color mixing.
Chromaticity Diagram
• Straight-line joining any two points
defines all the different color
variations that can be obtained by
combining these two colors
additively.

• A line drawn from the point of


equal energy to any point on the
boundary of the chart will define all
the shades of that particular
spectrum color.
Chromaticity Diagram
• To determine the range of colors
that can be obtained from any Color gamut of monitors
three given colors we simply draw
Color gamut of
connecting line to each of the printing devices
three color points.
• Any color inside the triangle can
be produced by various
combinations of the three initial
colors.
• A triangle with vertices at any
three fixed colors cannot enclose
the entire color region.
Color Models
• The purpose of a color model is to facilitate the specification of colors in
some standard.
• A color model is a specification of a coordinate system and a subspace
within that system where each color is represented by a single point.
• Color models are oriented either toward hardware or applications:
 Hardware-oriented:
• Color monitor or Video camera : RGB.
• Color printer : CMY, CMYK.
 Application-oriented:
• Color image manipulation : HSI.
The RGB Color Model
• RGB model is an additive model which each color appears in its
primary spectral components of red, green, and blue.
• Based on a Cartesian coordinate system.
• The color subspace of interest is usually represented by a solid cube.
• RGB primary values are at three corners; the secondary colors cyan,
magenta, and yellow are at the other corners.

• black is at the origin, and white is at the corner farthest from the
origin.

• The gray scale (points of equal RGB values) extends from black to
white along the line joining these two points.

• The different colors in this model are points on or inside the cube, and
are defined by vectors extending from the origin.
The RGB Color Model
• Images represented in the RGB color model
consist of three independent image planes, one
for each primary color.
 When fed into an RGB monitor, these three
images combine on the screen to produce a
composite color image.
• Pixel depth
 The number of bits used to represent each
pixel in RGB space.
 full-color image is a 24-bit RGB color image.
 (R, G, B) = (8 bit, 8 bit, 8 bit).
 Total colors in 24-bit image is = 16,777,216.
The RGB Color Model

• RGB components of an image.


Safe RGB Colors

• A subset of colors that are likely to be reproduced faithfully,


reasonably independently of viewer hardware capabilities.
• They are also called the set of all-system-safe colors, safe Web colors,
safe browser colors.
• 256 colors is the minimum number of colors that can be reproduced
faithfully by any system.
• The RGB Cube is divided into 6 intervals on each axis to achieve the
total = 216 common colors.
 40 colors are left to OS.
Safe RGB Colors

FFFFFF
The CMY and CMYK Color
Models
• CMY are the secondary colors of light, or,
alternatively, the primary colors of pigments.
• General purpose of CMY color model is to
generate hardcopy output.
• The primary colors of pigments:
 Cyan, magenta, and yellow.
• Most devices that deposit colored pigments on
paper require CMY data input or perform RGB
to CMY conversion internally (shown in the  C  1  R
 M  1   G
figure ).      
 The inverse operation from CMY to RGB is  Y  1  B 
generally of no practical interest.
The CMY and CMYK Color Models

• CMY is a subtractive color model.


• Equal amounts of the pigment primaries, cyan, magenta, and yellow
should produce black.
• In practice, combining these colors for printing produces a muddy-
looking black.
• So, in order to produce true black, a fourth color, black, is added,
giving rise to the CMYK color model.
The HSI Color Model
• RGB, CMY models are not good for human interpreting.
• In HSI The intensity is decoupled from the color information.
• HSI color model:

Hue : dominant color


Chromaticity
Saturation: relative purity

Intensity : brightness or dullness of a color

• HSI model is ideal tool for developing image processing algorithms


based on color descriptions that are natural and intuitive to humans.
Relationship between RGB and HSI

• The intensity component of any color can be determined by passing a


plane perpendicular to the intensity axis and containing the color
point .

• The intersection of the plane with the intensity axis gives us the
intensity component of the color.

Intensity line
Relationship between RGB and HSI

Colors on this triangle


• The hue can be extracted from the RGB
have the same hue
color cube.

• Consider a plane defined by the three saturation


points cyan, black and white.

• All points contained in this plane must


have the same hue (cyan) as black and
white cannot contribute hue information
to a color.
Relationship between RGB and HSI

• If we look straight down at the RGB cube we would see a hexagonal


shape.
• Primary color separated by 120°.
• Secondary colors at 60° from the primaries.
• HSI model is composed of a vertical intensity axis and the locus of
color points that lie on planes perpendicular to that axis.
Relationship between RGB and HSI

• The hue is determined by an angle from a reference point, usually red.

• The saturation is the distance from the origin to the point.


• The intensity is determined by how far up the vertical intensity axis this
hexagonal plane sits (not apparent from this diagram).
Relationship between RGB and HSI

• The plane is also often represented as a circle or a triangle.


• The angle from the red axis gives the hue, and the length of the vector
is the saturation.
• The intensity of all colors in any of these planes is given by the position
of the plane on the vertical intensity axis.
The HSI Color Model

• The HSI color model based on triangular and circular color planes:
Converting Colors From RGB to HSI

• Hue component:
−1
𝐻={
𝜃 if 𝐵 ≤ 𝐺
360 − 𝜃 if 𝐵 > 𝐺
with
𝜃 =cos ¿¿
• Saturation component:
3
𝑆 =1 − ¿
( 𝑅 + 𝐺+ 𝐵 )
• Intensity component:
1
𝐼 = (𝑅 + 𝐺+ 𝐵)
3
Converting From HSI to RGB

• Three sectors of interest, corresponding to the 1200 intervals in the


separation of primaries.

• R-G sector

𝐵=𝐼 (1−𝑆)
Converting from HSI to RGB (cont.)

• G-B sector • B-R sector

𝐻= 𝐻− 120 𝑜 𝐻= 𝐻− 24 0
𝑜

𝑅=𝐼 (1−𝑆) 𝐺=𝐼 (1−𝑆)


Manipulating Images in the HSI
Model

• In order to manipulate an image under the HSI model we:


 First convert it from RGB to HSI.
 Perform manipulations under HSI.
 Finally convert the image back from HSI to RGB.

RGB
RGB RGB
RGB
HSI
HSI Image
Image
Image
Image Image
Image

Manipulations
HSI Components of RGB Image

• RGB -> HSI


Manipulating HSI

• We can manipulate H, S and I


independently.
 Changing the blue and green
regions to 0 in hue image.
 Reduce by half the saturation of
the cyan region.
 Reduce by half the intensity of
central white region.
• And then convert them back to RGB
to see the effects.
 HSI -> RGB
Pseudo-color Image Processing

• Pseudo color = false color.

• Pseudo-color image processing consists of assigning colors to gray values


based on a specified criterion.

• The principle use of pseudo-color image processing :


 For human visualization.
 Interpretation of gray-scale events.
o Humans cannot distinguish more than 50 gray levels in an image.
o Subtle details can easily be lost in looking at gray scale images.
Pseudo-coloring Using LUT

• Each gray value is mapped through a


LUT (lookup table) to a color shown
on a display device.

• Example :
 In a gray scale image with levels
0, 1, 2, 3, and 4, pseudo-coloring
is a color lookup table that maps
0 to black, 1 to red, 2 to green, 3
to blue, and 4 to white.
Intensity Slicing
• Also called density slicing.
• If an image is interpreted as a 3-D function, the method can be viewed
as one of placing planes parallel to the coordinate plane of the image;
each plane then “slices” of the function in the area of intersection.

{
𝑔 ( 𝑥 , 𝑦 )= 𝐶 1
𝐶 2 if
if 𝑓 ( 𝑥 , 𝑦 ) ≤ 𝑇
𝑓 (𝑥 , 𝑦 )≥ 𝑇
Intensity Slicing

Assigning a yellow color to pixels with value 255


and a blue color to all other pixels.
Multi Level Intensity Slicing

• The gray scale [0, L-1] is divided into L


levels; where l0 represents black and l L-1
represents white.
• Suppose that P planes perpendicular to
the intensity axis defined at levels l1, l2,
……, lp.
• Then assuming that 0 < P < l-1 the P
planes partition the gray scale into P + 1
intervals V1, V2, …… V p+1.

• Where ck is the color associated with the


kth intensity interval vk .
Multi Level Intensity Slicing

Density slicing into 8


colors.
Multi Level Intensity Slicing

A unique color is assigned to each intensity


value.

Color map
Gray Level to Color Transformations

• Three different transformations are performed on the gray level im-


age.

• The results are fed into red, green, and blue channels of a TV monitor.
• This produces a composite image whose color content is modulated
by the nature of the transformation functions.
Gray Level to Color Transformations
Gray Level to Color Transformations
Gray Level to Color Transformations

• Used in the case where there are many


monochrome images such as multispectral
satellite images.
Gray Level to Color Transformations

Pseudo-color rendition of Jupiter moon Io.

Yellow areas = older sulfur


deposits. Red areas = material
ejected from active volcanoes.
Basics of Full-Color Image Processing

• Two methods:
 Per-color-component processing: process each component
separately.
 Vector processing: treat each pixel as a vector to be processed.
• Example of per-color-component processing: smoothing an image By
smoothing each RGB component separately.

[ ]
𝑅( 𝑥 , 𝑦 )
𝐜 ( 𝑥 , 𝑦 )= 𝐺( 𝑥 , 𝑦 )
𝐵(𝑥 , 𝑦 )
Basics of Full-Color Image Processing

Color image

CMYK components

RGB components

HSI components

51
Color Transformations

• Similar to gray scale transformation:


 is a color input image.
 is the transformed or processed.
 is an operator.
• Transformation or color mapping functions:
 n is the number of color components.
 The color components of and at any point.
 is a set of transformation.
Intensity Modifications

• Some operations are better suited to specific models.


𝑔 (𝑥 , 𝑦 )=𝑘 𝑓 (𝑥 , 𝑦 )
• In the HSI color space, this can be done with the simple transformation:

𝑠 3=𝑘 𝑟 3 ,𝑤h𝑒𝑟𝑒 0<𝑘<1


• In the RGB color space, three components must be transformed:
𝑠 𝑖 = 𝑘 𝑟 𝑖 𝑖 =1 ,2 ,3 .
• The CMY space requires a similar set of transformations:

𝑠 𝑖 = 𝑘 𝑟 𝑖 +( 1− 𝑘 ) , 𝑖 =1 ,2,3 .
Intensity Modifications
Color Complements

• Complements: the hues directly opposite one another on the color


circle.
• This operation is analogous to image negative in a gray scale image.
• Color complements are useful for enhancing detail that is embedded in
dark regions of a color image.
Color Complements
Color Slicing

• Highlighting a specific range of colors in an image is useful for


separating objects from their surroundings.
• Display the colors of interest so that they stand out from the
background.
• Gray-level slicing techniques.
Color Slicing

• How to take a region of colors of


interest?

prototype color
prototype color
Color Slicing

• The simplest ways to “slice” is to map the colors outside some range of
interest to a non prominent neutral color.
• If the colors of interest are enclosed by a cube,

{ [ ]
𝑊
𝑠 𝑖 = ¿ 0.5 , 𝑖 𝑓 |𝑟 𝑗 − 𝑎 𝑗 |> 2 , 𝑖 =1 ,2,⋯ , 𝑛
𝑎 𝑛 𝑦 1≤ 𝑗 ≤ 𝑛
¿𝑟 𝑖 , 𝑜 𝑡 h𝑒 𝑟 𝑤 𝑖𝑠 𝑒
• If a sphere is used to specify the colors of interest,

𝑠 𝑖 =¿
Color Slicing
Histogram equalization

• It is not suitable to process each


color plane independently in case
of histogram equalization. This
results in erroneous color.
• Histogram equalization of a color
image can be performed by
adjusting color intensity uniformly
while leaving color unchanged.

• The HSI model is suitable for


histogram equalization where only
Intensity (I) component is
equalized.
Color Image Smoothing

• Two methods:
 Per-color-plane method: for RGB, CMY color models Smooth each
color plane using moving averaging and then combine back to RGB.

 Smooth only Intensity component of a HSI image while leaving H and


S unmodified.
Color Image Smoothing

• Use the smoothing with average filter:


Color Image Sharpening

• We can do in the same manner as color image smoothing:


 Per-color-plane method for RGB,CMY images.
 Sharpening only I component of a HSI image.

• Use the Laplacian:


Noise in Color Images

• The noise models are applicable


to color images.
• Noise can corrupt each color
component independently .
 Noise are removed from the
image by independently
processing each plane.
• Noise reduction by applying
smoothing filters (e.g. average,
median).
Noise in Color Images

• If only one channel of an RGB image


is affected by noise, conversion to
HSI spreads noise to all HSI channels.
• The H, S, and I planes are corrupted
by impulse noise after conversion
from RGB, where only G plane was
contaminated.
Color Image Compression

• Compression is the process of reducing or


elimination redundant and/or irrelevant data.
• The number of bits required to represent
color is typically three to four times greater
than the number employed in the
representation of gray levels.
• Data compression plays A central role in the
storage and transmission of color images.
• Data : the red, green, and blue components
of the pixels in an RGB image.

• The means by the color information is


conveyed.
Thanks
!
Any questions?

You might also like