Image Processing Reference
In-Depth Information
Fig. D.3 Triangles used to derive the conversion from HSI to RGB. Note that ( b ) is one of the tri-
angles in Fig. D.1 (b), i.e., H
H =
60°. Note also that the two triangles have the same hypotenuse
(except for the length) and that the triangles are perpendicular
+
D.2
Conversion from HSI to RGB
The conversion from HSI to RGB depends on in which of the following triangles the
point is located: WR G , WG B ,or WB R . Let us start with the situation where
120°, i.e., the triangle WR G .
We first convert from HSI to rgb and then from rgb to RGB. In the triangle
WR G
H
we know from Eq. D.3 that P b =
( 1
S)/ 3. Furthermore, we know that
P r + P g + P b =
1 and hence only need to find one of the unknowns. To this end
we define the triangle in Fig. D.3 (a). The base of the triangle is the line spanned by
( 0 , 0 , 0 ) , denoted O , and R . The hypotenuse of the triangle is the line spanned by
R and the middle point of the line spanned by B and G . This point is denoted X R ,
see Fig. D.1 . Note that the line spanned by R and X R passes through the gray point
W . The point Z is the intersection between the line spanned by R and X R , and the
plane containing P and perpendicular to the red-axis (the line spanned by R
and
O ), see Fig. D.3 . This plane is denoted Γ 1 .
From the law of similar triangles follows that
−−−→
= −− R Z
R X R
−−→
(D.13)
−−→
R O
R K
−−→
−−→
−− KO
R O
R K
We know that
=
1 and that
=
P r . From this follows that
=
−− R Z
= −−−→
−− ZW
+ −−−→
R X R
1
P r . We can see that
(
WX R
) and can therefore
rewrite Eq. D.13 to
−−−→
P r · −−−→
R X R = −−−→
R X R −− ZW
−−−→
R X R
WX R
(D.14)
P r = −− ZW
+ −−−→
−− ZW
+ −−−→
WX R
−−−→
−−−→
WX R
−−−→
=
(D.15)
R X R
R X R
R X R
−−−→
−−→
−−−→
R X R = YO
= YO
R O
=
1 / 3. The first term is a bit more tricky to rewrite and we need to introduce yet
another triangle to this end. First have a look at Fig. D.3 (a) and recall that Γ 1 is
WX R
Using the law of similar triangles:
/
/
Search WWH ::

Custom Search