EE 583 Lecture08
EE 583 Lecture08
=
>
| |
1
1/ 2
2
1
( ) ( )
2
cos
( ) ( )( )
R G R B
R G R B G B
u
+
=
`
( +
)
3
1 [min( , , )]
( )
S R G B
R G B
=
+ +
1
( )
3
I R G B = + +
The RGB values are normalized to the
range [0,1].
The SI values are in [0,1] and the H
value can be divided by 360
o
to be in the
same range.
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Color Models
Converting from HSI to RGB : Given the HSI values in the interval of [0,1].
Multiply the H by 360
o
so that it is in the range of [0, 360
o
].
I f (0 H < 120
o
), then color is in RG Sector and then:
) 1 ( S I B =
(
+ =
) 60 cos(
cos
1
H
H S
I R
o
) ( 1 B R G + =
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Color Models
Converting from HSI to RGB : Given the HSI values in the interval of[0,1].
Multiply the H by 360
o
so that it is in the range of [0, 360
o
].
I f (120
o
H < 240
o
), then color is in GB Sector and then. Firstly H in this sector
is:
) 1 ( S I R =
(
+ =
) 60 cos(
cos
1
H
H S
I G
o
) ( 1 G R B + =
o
H H 120 =
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Color Models
Converting from HSI to RGB : Given the HSI values in the interval of[0,1].
Multiply the H by 360
o
so that it in the range of [0, 360
o
].
I f (240
o
H < 360
o
), then color is in BR Sector and then. Firstly H in this sector
is:
) 1 ( S I G =
(
+ =
) 60 cos(
cos
1
H
H S
I B
o
) ( 1 B G R + =
o
H H 240 =
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Color Models
Converting from HSI to RGB :
RGB Image
H Image
S Image
I Image
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Pseudocolor Image Processing
This technique is based on assigning color (false/pseudo) values to different
gray levels. By converting monochrome images to color images human
visualization and interpretation of the gray level images can be improved.
I ntensity/density Slicing: The image is interpreted as 3D function (intensity
versus spatial coordinates), where, planes which are parallel to the coordinate
planes called slices are considered to slice the image function into two color
levels.
Intensity slicing
Let [0,L-1] represent the gray level image, and
l
o
represents black [f(x,y)=0] ,
l
L-1
represents white [f(x,y)=L-1] ,
Consider P planes defined at l
1
, l
2
,, l
P
intensity levels. Then P planes partition the gray
scale into P+1 intervals, V
1
, V
2
,, V
P+1
. Each
interval is assigned to a different color and hence:
k k
V y x f if c y x f e = ) , ( , ) , (
c
k
is the color with k
th
intensity interval V
k
.
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Pseudocolor Image Processing
I ntensity/density Slicing:
Monochrome Image Intensity slicing into 8 colors
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Pseudocolor Image Processing
I ntensity/density Slicing:
Monochrome
Image
After intensity
slicing applied
Tropical regions
Zoom of south
America region
intensity slicing into 256 colors
Intensity values from 0 to 255
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Pseudocolor Image Processing
Gray Level to Color Transformations : I n this method, a given gray level image
is processed by 3 different transformation functions producing 3 enhanced
images in Red, Green and Blue channels respectively.
By combining the 3 channel images we get a colored image.
f
R
, f
G
and F
B
are used to be inputs to an RGB monitor, producing a colored image.
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Pseudocolor Image Processing
Gray Level to Color Transformations :
input image.
Transformation functions for R, G and B
channels.
Output Pseudocolor image.
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Full-Color Image Processing
There two main methods in using full color images.
I n the first method each color component is processed separately to form a
composite color image.
I n the second approach we consider each pixel as a vector of 3 values and
process each pixel.
Each component is processed
like a gray-level image
Each pixel is considered as a
vector of RGB components.
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Full-Color Image Processing
Various Color space components: Consider each color component as a gray
level image.
Full color image
C,M,Y components.
R,G,B components.
H,S,I components.
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Full-Color Image Processing
Color Complements (inverse colors). Color complementing a color image is
identical to gray scale negatives in monochrome images.
Color complement transformations are performed according to the following
color circle.
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Full-Color Image Processing
Color Complements (inverse colors). I f you apply respective color complement
transformation to each color component, you can obtain the complement of a
given color image.
Complementing RGB components Complementing HSI components
Transformation functions for RGB
Transformation functions for HSI
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Full-Color Image Processing
Color I mage Smoothing and Sharpening : The idea of gray-scale image
smoothing can be extended into processing of full color images.
Let S
xy
denote the set of coordinates defining a neighborhood centered at (x,y) in
RGB color image. Averaging (smoothing) and Sharpening using Laplacian
operator of the RGB component vectors in this neighborhood is:
e
=
xy
S y x
y x
K
y x
) , (
) , (
1
) , ( c c
(
(
(
(
(
(
(
e
e
e
xy
xy
xy
S y x
S y x
S y x
y x B
K
y x G
K
y x R
K
y x
) , (
) , (
) , (
) , (
1
) , (
1
) , (
1
) , ( c
K is the number of pixels
within the neighborhood
of the averaging mask.
| |
(
(
(
V
V
V
= V
) , (
) , (
) , (
) , (
2
2
2
2
y x B
y x G
y x R
y x c
Smoothing using Averaging Sharpening using Laplacian
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Full-Color Image Processing
Color I mage Smoothing: Given a full color image with the following color
components,
Full color RGB image R Image G Image B Image
Hue image Saturation Image Intensity Image
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Full-Color Image Processing
Color I mage Smoothing & Sharpening:
Each RGB component filtered Only I of the HSI filtered Difference of the 2 images
Each RGB component filtered Only I of the HSI filtered Difference of the 2 images
Smoothing by
5x5 averaging mask
Sharpened by
3x3 Laplacian mask
* Original Hue and Saturation
are maintained. Working with
HSI image is a better idea.
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Full-Color Image Processing
Segmentation in RGB vector space : Although working with HSI space is more
intuitive in most applications, in segmentation working with RGB color vectors is
generally more advantages.
Suppose that an object within a specified RGB color range is to be segmented.
Assume that a is the average RGB vector. Each RGB pixel is classified to have
color in the specified range/distance from the average color vector.
Let z denote an arbitrary point in RGB space. Then the Euclidean Distance
between z and a is given by:
1/ 2
1/ 2
2 2 2
( , ) ( ) ( )
( ) ( ) ( )
T
R R G G B B
D z a
z a z a z a
( = =
( = + +
z a z a z a
o
D D s a) z, (
The segmented pixels fall into the solid sphere of radius D
o
where,
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Full-Color Image Processing
Segmentation in RGB vector space :
o o
D radius D D = s , ( a) z,
EE-583: Digital Image Processing
Prepared By: Dr. Hasan Demirel, PhD
Color Image Processing
Full-Color Image Processing
Segmentation in RGB vector space :
Area of interest
Segmentation Procedure:
1. Sample data is taken from the area of interest.
2.Mean RGB components and their standard deviation values
are calculated.
3. D
o
is determined by using the standard deviation o .
For example in this example:
D
oR
=1.25 o
R
D
oG
=1.25 o
G
D
oB
=1.25 o
B
4. Any pixel within D
o
distance from the mean is set to white
color and all the other pixels are set to black color.
Segmented region
Input image
Segmented Output image