ADAPTIVE FUZZY COLOUR SEGMENTATION ON RGB RATIO
SPACE FOR ROAD DETECTION
Chieh-Li Chen and Chung-Li Tai
Department of Aeronautics and Astronautics
National Chen Kung University, Tainan, Taiwan
Keywords: RGB ratio, Adaptive fuzzy, Colour segmentation, Road detection.
Abstract: In this paper, the RGB ratio is defined according to a reference colour such that the image can be
transformed from a conventional colour space to the RGB ratio space. Different to distance measurement, a
road colour segment is determined by an area in RGB ratio space enclosed by the estimated boundaries.
Adaptive fuzzy logic, which fuzzy membership functions are defined according to estimated boundaries, is
introduced to implement clustering rules. Low computation cost of the proposed segmentation method
shows the feasibility to real time application. Experimental results for road detection demonstrate the
robustness to intensity variation of the proposed approach.
1 INTRODUCTION
Colour segmentation is an essential issue to vision
applications, such as object detection and vision
navigation etc (Bosch et al., 2007; Lin, 2007). The
process of colour segmentation consists of colour
representation, colour feature extraction, similarity
measurement and classification. In colour
representation, the RGB (Red, Green and Blue)
model, which expresses colour as a mixture of red,
green and blue three colour components, is often
used to depict colour information of an image
(Weng et al., 2007; Bascle et al., 2007). By a
transformation, the secondary colours, which are
CMY (Cyan, Magenta and Yellow) or RG-GB-BR,
can be obtained and used as an alternative colour
model (Wang et al., 2007). The HSI model, which
transforms RGB into Hue, Saturation and Intensity,
is also a popular colour model at present, and good
performance are shown in many works (Kim et al.,
2008; Kim et al., 2007; Wangenheim et al., 2007).
HSV (Value) and HSL (Luminance) are very similar
to the HSI model due to the applied transformation
formulas. Using the HSI colour model, a specific
colour is able to be recognized regardless of
variation of saturation and intensity. CIE Luv, CIE
Lab and YCbCr (Wang and Huang, 2006; He et al.,
2007) are colour spaces which represent colour by
its intensity (L and Y) and chromaticity (uv, ab and
CbCr). In this paper, we propose a novel colour
model called the RGB ratio model, which is based
on a fact that a change of intensity of a reference
colour will lead to a change of RGB colour
components, but their ratio to the reference colour
will be linear to the intensity change (Benedek and
Sziranyi, 2007; Mikic et al., 2000). With this
property, a specific colour can be recognized despite
an intensity variation. Moreover, information of
three colour components (RGB) is reserved to
describe the chromaticity by the proposed RGB ratio
space. Therefore, inheriting the characteristics of
HSI and RGB models, the RGB ratio has advantages
on object recognition under intensity variations.
There exist many state-of-art and complex
techniques for colour segmentation which are
excellent at partitioning an input image. For
example, the global colour statistics can be
represented by a set of overlapping regions and
modeled by a mixture of Gaussians (GMM), and a
local mixture model is described by Markov
Random Fields (MRFs) (Kato, 2008). By optimizing
parameters of the global and local model, maximum
likelihood is estimated and then a pixel can be
classified. Although marvelous segmented results
are revealed, a large number of iterations are
necessary to determine optimal parameters. As a
result, the computation time of an image with
256×256 resolution costs 16 seconds (Tai et al.,
2007).
31
Chen C. and Tai C. (2009).
ADAPTIVE FUZZY COLOUR SEGMENTATION ON RGB RATIO SPACE FOR ROAD DETECTION.
In Proceedings of the First International Conference on Computer Imaging Theory and Applications, pages 31-36
DOI: 10.5220/0001746300310036
Copyright
c
SciTePress
Hill manipulation of colour histogram is another
commonly used approach to achieve colour
segmentation. A three dimensional histogram can be
obtained by accumulating three colour components
of pixels. Then dominant hill detection and minor
hill dismantling are used to estimate clustering index
(Aghbari and Al-Haj, 2006). The idea of ‘Histon' ,
which is an encrustation of histogram such that the
elements in the histon are the set of all the pixels that
can be classified as possibly belonging to the same
segment, was introduced for colour segmentation by
Murshrif and Ray (2008). The total computation
time of a 179×122 image requires 2.41 seconds.
Neural networks (Bascle et al., 2007) are used
as clustering kernel for colour segmentation
recently, where components of the RGB space and
the intensity are used as inputs and three calibrated
colour components are considered as outputs of the
modified multi-layer perceptron (MLP). After the
training procedure, a good segmentation
performance is achieved. Furthermore, the look-up
tables (LUT) of the modified MLP can be applied
for real-time applications such that the execution
time for a 320×240 image is 0.00375 second.
However, a huge amount of database is required to
be created. If an input image is very different from
database, the network should be re-trained to
improve the result. The fuzzy C-means theory is
applied as the clustering method (Kuo et al., 2008),
and similarity measurement is based on Euclidean
distance (Luis-Garcia et al., 2008). Bosch et al.
(2007) recognize grass, sky, snow and road using
fuzzy logic with predefined classes, where the
average processing time for image size of 180×120
to 250×250 requires 60 seconds.
The use of template image is another fast
segmentation method. For instance, image database
of eye is established beforehand. Skin colour is
obtained from a colour conversion matrix with
colour of the sclera. Consequently, fixed thresholds
of HSV space are introduced to detect skin area in
an input image (Do et al. 2007). However, the use of
template image is restricted to specific object, and
may require a large image database.
In this paper, we propose an adaptive fuzzy
decision kernel to achieve a quality segmented
result. Firstly, the linearity between RGB ratio and
intensity is estimated by linear progressive method
and parameter estimation. Secondly, an upper and a
lower boundary are obtained statistically for each
colour ratio. These boundaries are used to define
fuzzy membership functions of colour ratio clusters,
which dynamically vary corresponding to intensity
changes. It makes the fuzzy decision more adaptive
and more effective.
This paper is organized as follows: The proposed
RGB ratio space to represent colour characteristic is
defined in Section 2. Linear progressive method and
parameter estimation, which are adopted to estimate
linearity between RGB ratios and intensity, are
described in Section 3. Upper and lower boundaries
are also obtained in Section 3 to describe fuzzy
membership functions, which can be used to achieve
segmentation of an input image. The proposed
segmentation method is applied for road detection in
Section 4. The results and comparisons are
demonstrated to show its feasibility. Conclusions are
given in Section 5.
2 RGB RATIO SPACE
Road detection is a typical application of colour
segmentation. In this study, the central bottom area
of an image defined by
)12()12( +×+ NN
pixels
should belong to the road. From projective
geometry, this area is closest to the camera system.
If this area is not part of the road, the navigation
system should give a stop or turning command
instead of evaluating the reference road colour
value. By calculating average values of RGB
components of the
)12()12( +×
+
NN
pixels, the
reference road colour is defined as
2
(,())
2
(2 1)
NN
j
mNnN
j
w
f
mh N n
Ref
N
=− =−
+
−+
=
+
∑∑
(1)
where
,,
j
RGB
=
,
(, )
j
f
xy
is the colour
component of a pixel which coordinates is
(, )
x
y
in
the initial image, and
hw
×
is the image resolution.
Based on the existence of the linear relation
between RGB ratio
RGB
r
f
and intensity
f
, we
define the linear relation as the following.
BGRj QfPf
jIjr
j
,,, =
+
×
=
(2)
Parameters
j
P
and
j
Q
in equation (2) is not
available straightforwardly because the pixel set of
the road is under determined. Therefore, a sample
set of the road
(
)
(
)()
{
}
11 2 2
,, ,,, ,
HSI HSI HSI k k
f
x
y
f
x
yf
x
y
=C "
IMAGAPP 2009 - International Conference on Imaging Theory and Applications
32
defined in the HSI space as described in (3) is
introduced to estimate
j
P
and
j
Q
.
{
}
(, ) (, )
iiiHSI
f x y Ref f x y
λ
=−C
(3)
where
,,iHSI=
,
°= 20
H
λ
,
1.0=
S
λ
and
1.0=
I
λ
are the appropriate thresholds defined in
the HSI space (Gonzalez and Woods, 2002).
Therefore, the RGB ratio value of the sample set
C
can be obtained as
BGRj
Ref
yxf
yxf
j
kkj
kkr
j
,,,
),(
),( ==
(4)
3 SEGMENTATION METHOD
3.1 Road Model Construction
With the sample set
C
, parameters
j
P
and
j
Q
can
be determined using linear estimation (Yates and
Goodman, 2005) as follows.
()
()
()()
()
()
2
1
1
,
, ,
=
=
=
k
i
riir
IiiI
k
i
riir
j
jj
jj
yxf
yxfyxf
P
μ
μμ
(5)
Ijrj
PQ
j
μ
μ
×=
(6)
where
BGRj ,,=
,
j
r
μ
is the mean colour ratio
value and
I
μ
is the mean intensity of
C
. Although
j
P
and
j
Q
are obtained based on the sample set
C
,
the maximum/minimum intensity value (
max
L
/
min
L
)
of the actual road set are required to fully describe
the road model. A searching procedure is applied as
follows.
Step 1 : Let
max max
zl=
and
min min
zl=
where
max
l
and
min
l
are the maximum and minimum
intensity values of the sample set
C
,
respectively.
Step 2 : Let searching range
[]
δ
+
maxmax1
, z zz
and
[]
mi
n
mi
n
2
, z zz
δ
Step 3 : With
condition 1 :
(
)
(
)
1
,
j
rjj
fxy PzQ
ε
−×+
condition 2 :
(
)
(
)
2
,
j
rjj
fxy PzQ
ε
−×+
If the number of pixels which
satisfy condition 1 / condition 2
is zero
max max
L=z
/
min min
L=z
and stop.
else
set
max max
z=z+δ
/
min min
z=z-δ
if
max
z1
/
min
z0
set
max
L=1
/
min
L=0
and stop.
else
redo step 3.
(, )
RGB
r
f
xy
is the image represented by RGB
ratio,
05.0
=
δ
and
05.0
=
ε
.
With
max
L
and
min
L
, the boundary of the road
colour set can be described as follows. The line
A
B
in Fig. 1 is estimated from the sample set
C
in one
of the colour ratio planes.
min
(,)
jA
A
Lr
and
max
(,)
j
B
B
Lr
are the extreme points on
A
B
, which
is obtained from the searching procedure. The arc
q
AEB
, which represents the upper boundary of the
road colour set, can be defined by a circle center
(, )
OjO
OI r
and radius
R
determined as follows .
22
2
D
K
R
D
+
=
(7)
()
22
2
1
OM
j
OjM MO
RK
II
S
rrSII
+
=−
(8)
Where
KAMBM
=
=
,
min max
jB jA
LL
S
rr
=
and
D
EM e
α
=
.
e
is the mean squared colour
ratio error of the sample set
C
, and
α
is a gain
corresponding to model strictness,
α
= 2 in this
study.
From (7) and (8), equations of the upper
boundary
q
AEB
and the lower boundary
q
AFB
,as
shown in Fig. 2, can be represented as (9) and (10) .
q
()
2
2
22
2
:
1
jjO O
OM
rr R II
AEB
RK
II
S
=+
=+
+
(9)
ADAPTIVE FUZZY COLOUR SEGMENTATION ON RGB RATIO SPACE FOR ROAD DETECTION
33
q
()
2
2
22
2
:
1
jjO O
OM
rr R II
AFB
RK
II
S
=−
=−
+
(10)
(
)
I
Intensity
(
)
j
rRatio j
max
(,)
jB
B
Lr
m
i
n
(
,
)
j
A
A
L
r
(, )
MjM
M
Ir
(, )
OjO
OI r
Figure 1: Determination of the upper road colour set
boundary.
(
)
I
Intensity
(
)
j
r Ratio j
max
(,)
jB
BL r
min
(,)
jA
AL r
Figure 2: The upper and the lower boundary of the road
colour set.
3.2 Adaptive Fuzzy Road Detection
For robustness and flexibility, fuzzy logic is used as
the decision maker of the proposed segmentation
method, where the membership functions are
adaptively defined according to the road set obtained
in section 3.1. In this paper, three RGB ratios and
the corresponding intensity are four inputs of the
fuzzy decision system. Fig. 3(a-c) show three
membership functions for input ratios, where the
Lower/Upper represent the sets which colour ratio is
smaller/greater than the lower/upper boundary of the
road colour set. The upper boundary (UB) and the
lower boundary (LB) are obtained by (9) and (10),
respectively.
de
β
and
β
is a gain for the
sensitivity of the fuzzy system. In this way,
membership functions for each input are adaptively
defined according to the intensity value. The
membership functions of the two outputs, Dissimilar
and Similar, are shown in Fig. 3(d). Fuzzy decision
table is shown in Table 1, and max-min-composition
method (Zimmermann, 1991) is used as the
defuzzification method. Quality road detection
results using the proposed adaptive fuzzy decision
are demonstrated in the next section.
(a) (b)
(c) (d)
Figure 3: Fuzzy membership functions.
Table 1: Fuzzy decision table.
R ratio G ratio B ratio Segmentation
NR NG NB Dissimilar
NR NG B Dissimilar
NR G NB Dissimilar
NR G B Dissimilar
R NG NB Dissimilar
R NG B Dissimilar
R G NB Dissimilar
R G B Similar
4 EXPERIMENTAL RESULTS
AND DISCUSSIONS
For road detection studies, experimental images on
brick pavement are taken by the SONY EVI-D70
camera. Original image size is 640×480 and is
resized to 128×128 for real-time performance. All
algorithms are applied in VC++ with Pentium-4
3.0GHz CPU and 1GB memory. To evaluate the
performance of the road detection using the
proposed colour segmentation method, the detection
IMAGAPP 2009 - International Conference on Imaging Theory and Applications
34
rate, TPR, FPR and FNR, introduced by Do et al.
(2007) is applied as follows.
Table 2: Comparison of segmented results of brick
pavement.
Result
TPR
(%)
FPR
(%)
FNR
(%)
RGB with optimal
Euclidean distance 0.5
84.09 18.29 15.91
HSI with optima
Euclidean distance 0.7
64.56 10.57 35.21
RGB ratio with
2
β
=
adaptive fuzzy
98.14 3.65 1.86
First of all, we define the exact road region as
true ground (TG), while all pixels are classified as
road by the proposed method are defined as detected
ground (DG). True positives (TP) are correctly
detected road pixels, false negatives (FN) are
incorrectly dropped road pixels, and false positives
(FP) are false road pixels outside the exact road
region. The true positive rate (TPR), which is
TP/TG, is the proportion of true positives to true
ground, the false negative rate (FNR), which is
FN/TG, is the proportion of false negatives to true
ground, and the false positive rate (FPR), which is
FP/DG, is the proportion of false positives to
detected ground.
Road detected results using the proposed
method on brick pavement are shown in Table 2.
Detected results using the RGB model and the HSI
model with Euclidean distance measurement are
compared with the proposed approach. From Table 2,
the TPR of the proposed method is much higher than
the other two methods and the FPR is less than 5%.
It was revealed that the colour is difficult to be
recognized for its intensity close to 0 or 1
(Plataniotis and Venestsanopoulos, 2000).
Therefore, an intensity adjustment is applied to
avoid the achromatic case and to improve detected
results, as shown in Table 3. From the detection rate
listed in Table 2 and 3, the TPR of adjusted images
using the proposed method is increased by 0.8% and
the FPR is dramatically decreased by 2.65%.
Segmented results demonstrated in Table 2 and 3
show the superiority and the successfulness of the
proposed method.
Table 3: Comparison of segmented results with intensity
adjustment of brick pavement.
Result
TPR
(%)
FPR
(%)
FNR
(%)
RGB with optimal
Euclidean distance 0.4
90.25 18.85 9.75
HSI with optima
Euclidean distance 0.7
64.52 11.00 35.14
RGB ratio with
2
β
=
adaptive fuzzy
98.94 1.00 1.06
5 CONCLUSIONS
This paper proposes the RGB ratio space to
construct the road model. The linear relation for the
road model between colour ratios and the intensity is
estimated by a detected road reference value.
Adaptive fuzzy decision is also introduced as the
clustering method to detect the road in a more robust
and effective manner. The use of adaptive
membership functions according to the intensity for
each colour ratio achieves satisfactory performance
for the road detection. Experimental results
demonstrate the feasibility of the proposed approach.
ADAPTIVE FUZZY COLOUR SEGMENTATION ON RGB RATIO SPACE FOR ROAD DETECTION
35
ACKNOWLEDGEMENTS
Part of the work was supported by the National
Science Council under the grant No. NSC96-2221-
E006-052.
REFERENCES
Al Aghbari, Z., Al-Haj, R., 2006. Hill-Manipulation: An
Effective Algorithm for Colour Image Segmentation.
Image Vis. Comput., Vol. 24, No. 8 pp. 894-903.
Bascle, B., Bernier, O., Lemaire, V., 2007. Learning
Invariants to Illumination Changes Typical of Indoor
Environments: Application to Image Colour
Correction. Int. J. Imaging Syst. Technol., Vol. 17,
No. 3 pp. 132-142.
Benedek, C., Sziranyi, T., 2007. Study on Colour Space
Selection for Detecting Cast Shadows in Video
Surveillance.
Int. J. Imaging Syst. Technol., Vol. 17,
No. 3 pp. 190-201.
Bosch, A., Munoz, X., Freixenet, J., 2007. Segmentation
and Description of Natural Outdoor Scenes.
Image
Vis. Comput.
, Vol. 25, No. 5 pp. 727-740.
Do, H. C., You, J. Y., Chien, S. I., 2007. Skin Colour
Detection through Estimation and Conversion of
Illuminant Colour under Various Illuminations.
IEEE
Trans. Consum. Electron
, Vol. 53, No. 3 pp. 1103-
1108.
Gonzalez, R.C., Woods, R.E., 2002. Digital Image
Processing
, Prentice-Hall. New Jersey, 2
nd
edition.
He, Y., Luo, Y. P., Hu, D. C., 2007. Automatic Seeded
Region Growing Based on Gradient Vector Flow for
Colour Image Segmentation.
Opt. Eng., Vol. 46, No. 4
pp. 047003.
Kato, Z., 2008. Segmentation of Colour Images via
Reversible Jump MCMC Sampling.
Image Vis.
Comput.
, Vol. 26, No. 3 pp. 361-371.
Kim, H. S., Sakamoto, R., Kitahara, I., Toriyama, T., 2007.
Robust Foreground Extraction Technique Using
Background Subtraction with Multiple Thresholds.
Opt. Eng., Vol. 46, No. 9 pp. 097004.
Kim, C., You, B. J., Jeong, M. H., Kim, H., 2008. Colour
Segmentation Robust to Brightness Variations by
Using B-Spline Curve Modeling.
Pattern Recognit.,
Vol. 41, No. 1 pp. 22-37.
Kuo, C. F. J., Shin, C. Y., Lee, J. Y., 2008. Separating
Colour and Identifying Repeat Pattern through The
Automatic Computerized Analysis System for Printed
Fabrics.
J. Inf. Sci. Eng., Vol. 24, No. 2 pp. 453-467.
Lin, C., 2007. Face Detection in Complicated
Backgrounds and Different Illumination Conditions
by Using YCbCr Colour Space and Neural Network.
Pattern Recognit. Lett., Vol. 28, No. 16 pp. 2190-2200.
Luis-Garcia, R. de, Deriche, R., Alberola-Lopez, C., 2008.
Texture and Colour Segmentation Based on The
Combined Use of The Structure Tensor and The
Image Components. Signal Process., Vol. 88, No. 4
pp. 776-795.
Mikic, I., Cosman, P. C., Kogut, G. T., Trivedi, M. M.,
2000. Moving Shadow and Object Detection in Traffic
Scenes.
Proceedings of the 15
th
international
conference on pattern recognition
, Barcelona, Spain
pp. 321-324.
Murshrif, M. M., Ray, A. K., 2008. Colour Image
Segmentation: Rough-Set Theoretic Approach.
Pattern Recognit. Lett., Vol. 29, No. 4 pp.483-493.
Plataniotis, K. N., Venestsanopoulos, A. N., 2000.
Colour
Image Processing and Applications,
Springer. Berlin.
Tai, Y. H., Jia J. Y., Tang, C. K., 2007. Soft Colour
Segmentation and Its Applications. IEEE Trans.
Pattern Anal. Mach. Intell.
, Vol. 29, No. 9 pp. 1520-
1537.
Wang, C. M., Huang, Y. H., 2006. A Novel Automatic
Colour Transfer Algorithm between Images.
J. Chin.
Inst. Eng.
, Vol. 29, No. 6 pp. 1051-1060.
Wang, Y. G., Yang, J., Zhou, Y., Wang Y. Z., 2007.
Region Partition and Feature Matching Based Colour
Recognition of Tongue Image.
Pattern Recognit. Lett.,
Vol. 28, No. 1 pp. 11-19.
Wangenheim, A. V., Bertoldi, R. F., Abdala, D. D.,
Richter, M. M., 2007. Colour Image Segmentation
Guided by A Colour Gradient Network.
Pattern
Recognit. Lett.
, Vol. 28, No. 13 pp. 1795-1803.
Weng, S. K., Kuo, C. M., Kang, W. C., 2007. Colour
Texture Segmentation Using Colour Transform and
Feature Distributions.
IEICE Trans. Inf. Syst., Vol.
E90D, No. 4 pp. 787-790.
Yates, R. D., Goodman, D. J., 2005.
Probability and
Stochastic Processes,
John Wiley & Sons. New
Jersey.
Zimmermann, H.J., 1991,
Fuzzy Set Theory and Its
Applications
, Kluwer Academic Publishers. Boston,
2
nd
edition.
IMAGAPP 2009 - International Conference on Imaging Theory and Applications
36