IFSA-EUSFLAT 009 New Fuzzy Color Clusterig Algorithm Based o hsl Similarity Vasile Ptracu Departmet of Iformatics Techology Tarom Compay Bucharest Romaia Email: patrascu.v@gmail.com Abstract I this paper oe presets a fuzzy color clusterig algorithm that is based o a ew measure of similarity. This ew measure of color similarity is defied o a perceptual color system called hsl. Keywords Color similarity fuzzy color clusterig hsl perceptual color system. 1 Itroductio The color clusterig algorithms play a importat role i image aalysis. The obtaied results are very depedet o the coordiate system ad similarity/dissimilarity fuctios used for color separatio [1] [4] [5] ad [6]. I this paper oe proposes the use of a perceptual system hsl. I the framework of this system a ew measure is proposed for the color similarity. I the followig sectios the paper is thus orgaized: sectio presets the system hsl for color represetatio based o ew measures of lumiosity L ad saturatio S ; sectio 3 presets distaces ad similarities for each compoet of the hsl system; sectio 4 presets the ew color similarity; sectio 5 presets the color clusterig algorithm based o the proposed similarity; sectio 6 presets the experimetal results ad coclusios are i sectio 7. The perceptual color system hsl The most part of the color images are represeted by the RGB color system. Image aalysis is doe i the perceptual coordiate systems. Oe of them is the hsl system h is the hue ad a agular value; S is the saturatio ad lastly L is the lumiosity. I this paper we will use the followig formulae for the defiitio of the hsl compoets: M L 1 M m ( M m S (1 1 M 0.5 m 0.5 B G R B G h ata 6 : M max( R G B m mi( R G B We suppose that R G B [01]. Accordig to the cosidered formulae for the defiitio of the compoets hsl it results that L S [01] ad h ( ]. I order to have a uitary cosideratio for the three color compoets hsl we will scale the lumiosity L ad the saturatio S from [ 01] to 0 by formulae: l L ( s S Thus ay color q from RGB space will have the followig represetatio i the hsl space: M l 1 M m M m s 1 M 0.5 m 0.5 B G R B G h ata 6 3 Distaces ad similarities for the values hsl We kow that for two agular values a good measure for distace is based o the si fuctio amely: (3 d ( si (4 Thus for the hue the distace is give by the fuctio: h1 h d h ( h1 h si (5 Usig the formula (4 for the saturatio s ad lumiosity l we obtai their values i the iterval 1 0 because l s 0. Cosequetly we will multiply the formula (4 with the factor ad thus we will obtai the values i 48
IFSA-EUSFLAT 009 the whole iterval [ 01]. I this way the distaces for lumiosity ad saturatio will be defied by: l1 l d l ( l1 l si (6 s1 s d s ( s1 s si (7 I this paper we will take ito accout that the square of distace is a good measure of dissimilarity ad the egatio of dissimilarity is a good measure of similarity. I other words if d is the distace ad is the similarity the the followig relatio exists betwee them: 1 d (8 Havig the distace defiitios we will the defie the similarity fuctio for lumiosity ad saturatio l ( l1 l 1 dl ( l1 l cos( l1 l s ( s1 s 1 d s ( s1 s cos( s1 s ad ext for the hue: h1 h h ( h1 h 1 d h ( h1 h cos (10 4 The hsl color similarity We will iitially defie the chromaticity c ad the achromaticity a for a color havig as saturatio the value s : c si( s a cos( s (9 (11 The followig relatio betwee these two defied parameters is obvious: a c 1 (1 We will cosider two colors q 1 defied by parameters ( h 1 s1 l1( h s l. We will add to these parameters the chromaticity coefficiets c 1 c ad achromaticity coefficiets a 1 a computed by formulae (11. Now we defie the similarity betwee two colors by formula: ( q1 c1c h ( h1 h a1a l ( l1 l (13 Seeig the formula (13 oe remarks that this ew color similarity measure is a liear ad adaptive combiatio betwee the hues similarity ad lumiosities similarity. Thus for two chromatic colors the mai compoet is give by the hues similarity ad for two achromatic colors the mai compoet is give by the lumiosities similarity. We ca see that whe a color is chromatic ad the other is achromatic the similarity has small values. This is othig else tha the two cosidered colors are quite o-similar. Also we ca see that i formula (13 the saturatios similarity does ot appear directly but it exists some i backgroud. The formula (13 has the followig equivalet form: h1 h ( q1 si( s1 si( s cos cos( s1 cos( s cos( l1 l Takig ito accout that: h1 h cos 1 cos( l1 l 1 it results from (14 this iequality: amely ( q1 si( s1 si( s cos( s1 cos( s ad fially we obtai that: ( q1 cos( s1 s (14 (15 ( q1 s ( s1 s (16 The formula (16 shows that if the saturatios of the two colors have a low similarity the the two colors have a low similarity too ad if the two colors are strogly similar the their saturatios are strogly similar as well. Also from (15 ad (16 it results the followig implicatios: q q 1 ( 1 h ( h1 h 1 l ( l1 l 1 s ( s1 s 1 h1 h l1 l s1 s Usig the formula (8 we ca defie the distace betwee two colors i the hsl space as: d( q1 1 ( q1 (17 We ca state that formula (17 defies a metric because it verifies the followig three metric properties: d ( q1 0 q1 d( q1 d( q1 d( q1 d( q3 d( q1 q3 A detailed proof of these three properties is ot a subject of this paper ad thus ot cosidered here. 49
IFSA-EUSFLAT 009 5 The fuzzy color clusterig algorithm We cosider colors q 1... q that must be separated ito k clusters. Each cluster i is characterized by the membership coefficiets w i1 wi... wi for the cosidered colors ad the cluster ceter defied by the color q i hi si li. For color clusterig we will costruct a algorithm that is similar to the fuzzy c-meas algorithm [1]. We will cosider the followig objective fuctio: k J wij qi q j i1 j1 (18 is a fuzzificatio-defuzzificatio parameter ad also (01. If approaches 1 the the fuzzy algorithm approaches a crisp oe. The objective fuctio J (18 must be maximized. I order to have fuzzy partitios we must add the followig coditios for j 1... : w 1 j w j... wkj 1 (19 I this case cosiderig for the coditio (19 the Lagrage multipliers 1... the objective fuctio (18 becomes: k J wij i1 j1 k qi q j j wij 1 j1 i1 (0 The maximum value of the objective fuctio J (0 results from the followig coditios: i [ 1 k] j [1 ] J 0 (1 w ij 1 ( q 1 i q j w ij ( k 1 1 ( qm q j m1 i [ 1 k] J 0 (3 h i uij si h j uij cos h j j1 j1 hi ata (4 uij uij j1 j1 uij (5 wij c j i [ 1 k] J 0 (6 l i vij si l j vij cos l j j1 j1 li ata (7 vij vij j1 j1 vij wij a j (8 i [ 1 k] J s i 0 s y coss xij si j ij j1 j1 si ata wij wij j1 j1 xij wij h hi h j yij wij l l i l j j 6 Experimetal results (9 (30 (31 The proposed algorithm was applied to the image flower (Fig. 1 ad the clustered image ca be see i Fig.. For compariso the fuzzy c-meas algorithm [1] [3] [8] was applied to image flower i the coordiate systems RGB [3] [9] Lab [7] Luv [3] [9] hsl [9] I1II3 [] [3] ad the results ca be see i Figs. 3 4 5 6 ad 7. Figure 1: The image flower. 50
IFSA-EUSFLAT 009 Figure : The image flower clustered with the proposed algorithm ad hsl. Figure 5: The image flower clustered with FCM algorithm ad Luv. Figure 3: The image flower clustered with FCM algorithm ad RGB. Figure 6: The image flower clustered with FCM algorithm ad hsl. Figure 4: The image flower clustered with FCM algorithm ad Lab. 7 Coclusios I this paper a ew measure for color similarity was defied. This ew measure was defied i a ew perceptual system hsl. Usig this measure a algorithm for color clusterig was costructed. I the sectio dedicated to the experimetal results oe ca see the advatage of usig this ew color similarity measure. Figure 7: The image flower clustered with FCM algorithm ad I1II3. Refereces [1] J.C. Bezdek. Patter Recogitio with Fuzzy Objective Fuctios. New York: Pleum Press 1981. [] Y.I. Ohta T. Kaade ad T. Sakai. Color iformatio for regio segmetatio Computer ad Image Processig vol. 13 pp.-41 1980. [3] Y.W. Lim ad S.U. Lee. O the color image segmetatio algorithm based o the thresholdig ad the fuzzy c-meas techiques Patter Recogitio vol. 3 o.9 pp.935-95 1990. 51
IFSA-EUSFLAT 009 [4] V. Ptracu. A geeralizatio of fuzzy c-meas algorithm usig a ew dissimilarity fuctio The 11 th Iteratioal Fuzzy Systems Associatio World Cogres IFSA 005 Fuzzy Logic Soft Computig ad Computatioal Itelligece Vol II pp. 591-596 Beijig Chia July 8-31005. [5] V. Ptracu. A Geeralizatio of Gustafso-Kessel Algorithm Usig a New Costrait Parameter I Proceedigs of the 4th Coferece of the Europea Society for Fuzzy Logic ad Techology ad 11th Recotres Fracophoes sur la Logique Floue et ses Applicatios EUSFLAT-LFA 005 pp.150-155 Barceloa Spai 7-9 September 005. [6] V. Ptracu. Fuzzy Image Segmetatio Based o Triagular Fuctio ad Its -dimesioal Extesio i the volume Soft Computig i Image Processig. Recet Advaces Series: Studies i Fuzziess ad Soft Computig pp 187-08 Vol. 10 (Eds. M. Nachtegael D. Va der Weke E. E. Kerre W. Philips ISBN: 3-540-383-1 Spriger- Verlag 007. [7] S. Tomiga. A colour classificatio method for color images usig a uiform color space Proc. 10th It. Cof. O Patter Recogitio vol. I Atlatic City ew Jersey pp. 803-807 16-1 Jue 1990. [8] M. Trivedi ad J.C. Bezdek. Low-level segmetatio of aerial images with fuzzy clusterig IEEE Tras. O Systems Ma ad Cyberetics vol. 16 o. 4 pp.589-598 1986. [9] S.E. Umbaugh R.H. Moss W.V. Stoecker ad G.A. Hace. Automatic colour segmetatio algorithms with applicatio to ski tumor feature idetificatio IEEE Egieerig i Medcie ad Biology vol. 1 o. 3 pp. 75-8 1993. 5