Image Processing Reference

In-Depth Information

{

}

where min

means the smallest of the R, G, and B values, see Appendix B.

Saturation is defined to be zero when
(R,G,B)

R,G,B

(
0
,
0
,
0
)
and hue is undefined for

gray-values, i.e., when
R
=
G
=
B
. The conversion from HSI to RGB is given as

=

⎧

⎨

0
,

if 0°

≤

H

≤

120°;

H
n
=

H

−

120°
,

if 120°
<H

≤

240°;

(3.11)

⎩

H

−

240°
,

if 240°
<H <
360°

⎧

⎨

⎩

·
1

cos
(
60
°
−
H
n
)
,

S
·

cos
(H
n
)

I

+

if 0°

≤

H

≤

120°;

R

=

(3.12)

I

−

I

·

S,

if 120°
<H

≤

240°;

3
I

−

G

−

B,

if 240°
<H <
360°

⎧

⎨

3
I

−

R

−

B,

if 0°

≤

H

≤

120°;

·
1

cos
(
60
°
−
H
n
)
,

S
·

cos
(H
n
)

G

=

I

+

if 120°
<H

≤

240°;

(3.13)

⎩

I

−

I

·

S,

if 240°
<H <
360°

⎧

⎨

I

−

I

·

S,

if 0°

≤

H

≤

120°;

3
I

−

R

−

G,

if 120°
<H

≤

240°;

B

=

(3.14)

·
1

cos
(
60
°
−
H
n
)
,

⎩

S
·

cos
(H
n
)

I

+

if 240°
<H <
360°

In Table
3.3
the HSI values of some RGB pixels are shown.
5

3.3.2 The HSV Color Representation

The HSV color representation is short for
hue
,
saturation
and
value
. One can think

of HSV as an approximation of HSI, but much simpler to calculate. This is true,

but it is important to notice that HSV is not defined to be an approximation of HSI.

It is rather defined from an artist's point of view. Consider the situation when an

artist mixes paint. She would choose a pure color and lighten it by adding white

or darkening it by adding black. In the HSV representation the actions of the artist

are modeled in the following way. The pure color obviously corresponds to hue.

Increasing the whiteness (by adding white) corresponds to lowing the saturation.

Finally, increasing the amount of black corresponds to lowering the intensity of R,

G, and B. Concretely, this is modeled by the intensity of the maximum color and

denoted
value
, i.e., value = max

.

Following these definitions, a very elegant geometric argument can be made lead-

ing to a computationally simpler representation of hue, saturation, and value, than

HSI. The conversion from RGB to HSV is given as (see Appendix E for details):

{
R,G,B
}

5
Note that sometimes all parameters are normalized to the interval
[
0
,
1
]
. For example for
H
this

is done as
H
normalized

H

360
.

=