Unersty of Wollongong Research Onlne Faculty of Informatcs - Papers (Arche) Faculty of Engneerng and Informaton Scences 006 A fast algorthm for color mage segmentaton L. Dong Unersty of Wollongong, lju@uow.edu.au P. Ogunbona Unersty of Wollongong, phlpo@uow.edu.au Wanqng L Unersty of Wollongong, wanqng@uow.edu.au G. Yu ortheastern Unersty, Chna L. Fan Shenyang Unersty, Chna See next page for addtonal authors Publcaton Detals Ths artcle was orgnally publshed as: Dong, L, Ogunboba, P, L, W, et al, A Fast Algorthm for Color Image Segmentaton, Frst Internatonal Conference on Innoate Computng, Informaton and Control 006 (ICICIC '06), 0 August- September 006,, 685-688. Copyrght IEEE 006. Research Onlne s the open access nsttutonal repostory for the Unersty of Wollongong. For further nformaton contact the UOW Lbrary: research-pubs@uow.edu.au
A fast algorthm for color mage segmentaton Abstract Based on -means and a two-layer pyramd structure, a fast algorthm s proposed for color mage segmentaton. The algorthm employs two strateges. Frstly, a two-layer structure of a color mage s establshed. Then, an mproed -means wth nteger based lookup table mplementaton s appled to each layer. The clusterng result on the upper layer (lower resoluton) s used to gude the clusterng n the lower layer (hgher resoluton). Experments hae shown that the proposed algorthm s sgnfcantly faster than the orgnal -means algorthm whle producng comparable segmentaton results. Dscplnes Physcal Scences and Mathematcs Publcaton Detals Ths artcle was orgnally publshed as: Dong, L, Ogunboba, P, L, W, et al, A Fast Algorthm for Color Image Segmentaton, Frst Internatonal Conference on Innoate Computng, Informaton and Control 006 (ICICIC '06), 0 August- September 006,, 685-688. Copyrght IEEE 006. Authors L. Dong, P. Ogunbona, Wanqng L, G. Yu, L. Fan, and G. Zheng Ths conference paper s aalable at Research Onlne: http://ro.uow.edu.au/nfopapers/446
A fast algorthm for color mage segmentaton Lju Dong,, Phlp Ogunbona Wanqng L Ge Yu Lnan Fan Gang Zheng Unersty of Wollongong, Australa Shenyang Unersty ortheastern Unersty, Chna E-mal lju@uow.edu.au Abstract Based on -means and a two-layer pyramd structure, a fast algorthm s proposed for color mage segmentaton. The algorthm employs two strateges. Frstly, a two-layer structure of a color mage s establshed. Then, an mproed -means wth nteger based lookup table mplementaton s appled to each layer. The clusterng result on the upper layer (lower resoluton) s used to gude the clusterng n the lower layer (hgher resoluton). Experments hae shown that the proposed algorthm s sgnfcantly faster than the orgnal -means algorthm whle producng comparable segmentaton results.. Introducton The -means algorthm has been wdely used n the segmentaton of color mages for many applcatons, such as color blood corpuscle accountng [], natural mage segmentaton [], face detecton of frut accountng [], detecton of ol oerflow [4], and bology mcrograph processng [5]. For large mages, howeer, the algorthm takes a consderably large amount of computaton tme. Ths paper proposes a fast algorthm by combnng effectely a two-layer pyramd structure of an mage wth an mproed - means wth nteger look up table mplementaton. Experments hae shown that the new method s substantally more effcent compared wth the orgnal -means algorthm, whereas both produced comparable segmentaton results. The rest of ths paper s organzed as follows. A bref descrpton of the -means algorthm s gen n Secton. The proposed method s presented n Secton. The expermental results are shown n Secton 4. Fnally, Secton 5 concludes ths paper.. The -Means algorthm[6] p Let X { x, x, x } R be a fnte data set p where s the number of data tems and R s the p- dmensonal Eucldean space. Let V be the set of matrces wth,, beng the number of clusters. A partton of X s defned as M { U V uk {0,},, k; () u, k; 0 u, } k k where uk denotes xk belongs to cluster and u jk 0 denotes xk s not n cluster j The objecte functon s defned as J ( U, V ) u d () k where V {,,, }, R p,, denotes the set of the cluster centers and dk xk represents the dstance between x k and. The mnmzaton of J ( U, V ) produces an optmal partton of X. The terate optmzaton algorthm s gen as follows.. Set the number of clusters,. Intalze U ( 0) M, and 0,.. Set ntal teraton step b 0. ( b). Calculate cluster centers, wth U and: 4. Update k k k ukxk k. () u k ( b) U to U by, dk mn d jk j uk, k. (4) 0, otherwse, ( b ) ( b) 5. If, stop; otherwse, set b b, and go to step. For color mage segmentaton, we hae p k Proceedngs of the Frst Internatonal Conference on Innoate Computng, Informaton and Control (ICICIC'06) 0-7695-66-0/06 $0.00 006
representng the three components of a color space, e.g. RGB space, n whch the colors of pxels are specfed. The segmentaton result can be obtaned from uk drectly. For example, u k denotes that the k pxel belongs to cluster.. The Proposed method The algorthm employs two strateges. Frstly, a two-layer structure of a color mage s establshed. Then, an mproed -means wth nteger based lookup table mplementaton s appled to each layer. A typcal sze of the upper layer s /6 of the sze of ts lower layer. Therefore, the clusterng n the upper layer can be completed quckly, and the approxmate cluster centers can be obtaned. These approxmate centers sere as the ntal centers for the clusterng n the lower layer, reducng the number of teratons of the clusterng sgnfcantly... Two-layer pyramd data structure Fg. shows the two-layer pyramd data structure of a color mage. The alue of a pxel n the upper layer s the aerage alue of a block of connected pxels n the lower layer. The lower layer has a hgher resoluton than the upper layer. Let x R (,, x G (,, and x B (, be the three RGB components of a pxel R G B x(, ( x (,, x (,, x (, ) n the lower layer. ' Also let x R ' (,, x G ' (,, and x B (, be the three RGB components of a pxel n the upper layer, the sze of the lower layer be M M, and the sze of the upper layer be M '. Wthout loss of generalty, ' M suppose M 4M ' and M 4M ', then R' R x (, x (4 m, 4 j n), 6 x G' x (, B' (, m0 n0 0 M ', 0 j M ', (5) 6 m0 n0 G x (4 m, 4 j n), 0 M ', 0 j M ', (6) 6 m0 n0 B x (4 m, 4 j n), 0 M ', 0 j M '. (7) R R' G Fg.. Two-layer pyramd data structure. We apply an mproed erson of -means (as descrbed below) to the upper layer. Because the number of pxels at ths layer s only a small proporton of the pxels n the orgnal mages the algorthm wll conerge quckly. The obtaned cluster centers are then used to gude the further clusterng n the lower layer n an attenton to reduce sgnfcantly the number of teratons... An mproed -means wth nteger lookup tables The conentonal -means algorthm descrbed n Secton, usually has many repette operatons n computng the dstances, d jk, for the pxels wth the same color or RGB alues. The repetton becomes promnent for large sze mages, Here, we desgn an nteger lookup table, LUT, to elmnate the repetton. LUT s three-dmensonal and defned as follows: LUT[ ][ p][ x] Round(00.0 ( x p ) ), (8) where, p, and 0 x 55. Establshng such a lookup table takes 56 tmes of computaton. If 4, then 56 07, whch s much less than the number of pxels n a large mage. The maxmum alue of LUT s 00 (55 0) 650500,whch s wthn the range of a 4-byte nteger. In (8), the real number ( x p ) s multpled by 00.0 and rounded, whch s equalent to usng the real number p for the computaton wth a precson of one decmal place... The new algorthm Wth the two-layer pyramd structure and the mproed -means, the proposed algorthm for segmentng a color mage s descrbed as follows.. Set the number of clusters M ' M '. Intalze U ( 0) M, and 0,.. Set ntal teraton step b 0. ( b). Calculate cluster centers,, wth U and (). ( b 4. Establsh lookup table wth ),, and (8). G' B B' Proceedngs of the Frst Internatonal Conference on Innoate Computng, Informaton and Control (ICICIC'06) 0-7695-66-0/06 $0.00 006
( b) 5. Update U to U : from k to R a. Dk LUT[ ][][ xk ] G B LUT[ ][][ xk ] LUT[ ][][ xk ] (9), Dk mnd jk j b. uk 0, otherwse, k k. ( b ) ( b) 6. If, go to step 7; otherwse, set b b, and go to step. 7. Let M M. Denote the centers obtaned from the clusterng n the upper layer by,. Set ntal teraton step b 0. ( b 8. Establsh lookup table wth ),, and (8). ( b) 9. Update U to U : from k to a. Calculate D k wth the lookup table as n (9). b. Update uk as n. k k ( b) 0. Calculate centers,, wth ( b) U and (). ( b ) ( b). If, go to step ; otherwse, set b b, and go to step 8.. Segment the orgnal mage by u k of the matrx U,, k M M. In the aboe algorthm, steps 6 are performed upon the upper layer and the rest steps are performed on the lower layer. In steps 5(a) and 9(a) the relate dstances from a pxel to the cluster centers are obtaned drectly from the lookup tables, therefore, elmnatng the repette operatons. By relate dstance t s meant that the ntegral part of the scaled real dstance. Steps 5 and 9 are also smplfed due to the use of the ntegers. In the algorthm, cluster centers obtaned from the upper layer clusterng sere as the ntal centers,, n the lower layer clusterng. Ths allows an effcent reducton n the number of teratons n the lower layer clusterng where there are a large number of pxels noled. In steps 6, the xk denotes the pxels n the upper layer, and n steps 7, the x k denotes the pxels n the lower layer. 4. Expermental results In the experments, oer 0 large color mages obtaned from two web stes [7,8] were used to compare the proposed algorthm and the conentonal -means algorthm. The algorthms are mplemented wth Vsual C++ runnng on a Pentum 4 PC. The termnatng condton was set to 0. for both algorthms. Due to the lmtaton of space, here we only ge two representate examples. Fg. (a) s a 000 000 color mage, n whch the whte, blue and other regons represent cloud, water, and mountan, respectely. Fg. ges the dentcal segmentaton results obtaned by the two algorthms. (a) Fg.. (a) A color remote sensng mage. Threecluster segmentaton result by the -means algorthm or the proposed algorthm. The three clusters are represented wth three gray leels 0, 7, and 55. Table summarzes the results of the two algorthms on the clusterng of the mage shown n Fg. (a), where, b, t, and denote the cluster centers, number of teratons, tme used (n second), and rate of the same classfed pxels, respectely. Here s defned by M M M 00% () M M Table. Summary of the results on the mage shown n Fg. (a) -means (5.05,48.4,57.58) (44.0,78.78,.9) (.99,6.86,5.7) b 9 Ours Upper layer: (50.6,47.96,57.6) (4.69,78.06,.69) (0.47,5.46,4.5) Lower layer: (5.04,48.,57.57) (44.09,78.78,.9) (.95,6.8,5.67) Upper layer: 0 Lower layer: t 58s 5s 00% Proceedngs of the Frst Internatonal Conference on Innoate Computng, Informaton and Control (ICICIC'06) 0-7695-66-0/06 $0.00 006
where M M s the number of pxels of the orgnal mage, and M s the number of the pxels classfed dfferently by the two algorthms. Fg. shows another example. Fg. (a) s the orgnal color mage of sze 4000 600. The segmentatons obtaned by the two algorthms are gen n Fgs. and (c). Table summarzes the results. In ths example, although s not 00% (but ery close to 00%), there s no perceptual dfference between the two segmented mages shown n Fgs. and (c). From all our experments, the new algorthm s sgnfcantly faster than the conentonal -means algorthm, and the two algorthms produce almost dentcal results. 5. Concluson The -means clusterng algorthm has been wdely used n the segmentaton of color mages. There s an ncreasng desre for a fast erson of the -means algorthm for newly deeloped magng deces wth hgh resoluton. In ths paper, a fast algorthm s proposed by effectely combnng a two-layer pyramd structure and an mproed mplementaton of the -means algorthm. The proposed algorthm performs sgnfcantly faster wthout notceable degradaton of the results n comparson to conentonal the -means algorthm. 6. References []. Snha and A.G. Ramakrshnan, Automaton of dfferental blood count, Proc. of Internatonal Conference on Conergent Technologes for the Asa Pacfc Regon, 00, pp. 547-55. [] J. Xu and P.F.Sh, atural color mage segmentaton, Proc. of Internatonal Conference on Image Processng, 00, pp.4-7. [] A.R. Weeks, A. Gallagher, and J. Erksson, Detecton of oranges from a color mage of an orange tree, Proc. of Internatonal Socety for Optcal Engneerng, 999, pp. 808: 46-57. [4] O. Demrors, E. Demrors, Y. Ozturk, and H. Abut, Applcaton of mage segmentaton and classfcaton, Proc. of Internatonal Symposum on Computer and Informaton Scences, 989, pp. 8-88. [5] P. Lescure, Y. V. Meas, H. Duposot, and G. Stamon, Color segmentaton of bologcal mcroscopc mages, Proc. of Internatonal Socety for Optcal Engneerng, 999, pp. 647:8-9. [6] J. C. Bezdek, Pattern recognton wth fuzzy objecte functon algorthms. Plenum, 98. [7] Robotcs Insttute of Carnege Mellon Unersty. Computer son test mages. http://www-.cs.cmu.edu/~cl/-mages.html. [8] SolorVew Company. http://www.solarews/cap/. (a) (c) Fg.. (a) A olcano erupton mage. Four-cluster segmentaton result by the -means algorthm. (c) Four-cluster segmentaton result by the proposed algorthm. The four clusters are represented wth gray leels 0, 85, 70, and 55. Table. Summary of the results on the mage shown n Fg. (a). -means (49.77,7.85,00.8) (.0,8.90,4.97) (8.,95.6,94.56) (.50,45.9,56.75) Ours Upper layer (50.,7.4,00.78) (.8,8.4,4.4) (8.8,95.98,94.64) (.55,46.04,56.87) Lower layer (49.75,7.8,00.5) (.9,8.90,4.97) (8.48,95.57,94.47) (.5,45.9,56.75) Upper layer: b 6 lower layer: t 44s 7s 99.99% Proceedngs of the Frst Internatonal Conference on Innoate Computng, Informaton and Control (ICICIC'06) 0-7695-66-0/06 $0.00 006