Improvement of the Gaussian Mixture Model Based on EmguCV Motion Target Detection Design Qingyu Guo 1, a * and Zheng Zhang 1, b

Size: px
Start display at page:

Download "Improvement of the Gaussian Mixture Model Based on EmguCV Motion Target Detection Design Qingyu Guo 1, a * and Zheng Zhang 1, b"

Transcription

1 6h Inernaonal Conference on Managemen, Educaon, Informaon and Conrol MEICI 06) Improvemen of he Gaussan Mxure Model Based on EmguCV Moon Targe Deecon Desgn Qngyu Guo, a * and Zheng Zhang, b Zhongyuan Unversy of Technology, Zhengzhou, , Chna a guo_qng_yu@yahoo.com, b zhang_zhengfly@63.com eywords: -means; Improved frame dfference; Movng arges deecon; EmguCV; The Gaussan mxure model Absrac. Inroduces a knd of vdeo movng objec deecon based on mxure Gaussan model desgn, manly combned wh frame dfference mehod and he Gaussan mxure model, hen use -means cluserng algorhm, for complex scenaros dfferen updae rae s realzed by usng dfferen background regon, o complee he movng arge deecon, respecvely, compared o radonal Gaussan mxure model Gaussan mxure model, GMM) and he radonal frame dfference deecon mehod, n order o beer solve he problem of moon arge deecon n complex scene, and manly analyze based on frame dfference and EmguCV framework, and fnally usng C# and EmguCV framework for movng arges deecon. Applcaon hrough he expermen show ha he desgn s easy o use, and he performance s beer. Inroducon Vdeo moon objec deecon echnology s o spl from he mage of he vdeo sequence whch obaned from he monorng equpmen, dvded no background and movng objec and exrac he movng objec nformaon, on he bass of general neres n movng objecs segmened from he background []. Ths echnology s wdely appled n vdeo monorng, arfcal nellgence, aerospace, urban raffc, and oher felds. Classcal deecon mehods are manly frame dfference mehod[], [3-4], background subracon, dvson and opcal flow mehod[5], ec., among hem, he background subracon dvson prncple s o he curren frame and background mage dfference, he moon arge area, has smple operaon, he characerscs of hgh precson become he commonly used algorhm s wdely used. Bu he background subracon dvson are grealy nfluenced by lgh, weaher and oher exernal condons, how o esablsh he background mage, becomes he key o background subracon dvson effec s good or bad. EmguCV [6] s he.ne verson of he OpenCV package lbrary, n he.ne compable programmng language such as C#, VB, VC++ and IornPyhon can drecly call he mage processng mehod, can encapsulae lbrary on Wndows, Lnux, Phone, Androd, and many oher plaforms, no only nhered he OpenCV all performance and characerscs, and n supporng he cross-plaform operaon, and conans mage class based on color and deph; Can auomac memory managemen and garbage collecon; XML sequence mages; The XML documen and nellgen suppor; Choose o use he mage class or drec call OpenCV funcon; The basc operaon of mage pxels[7], ec. Background Acquson The Tradonal Gaussan Mxure Model Defnon. In order o oban deal background, s more commonly used by C.sauffer modelng[8], he Gaussan mxure model proposed by usng mulple Gaussan funcon a each pxel locaon modelng, usng he pxel eraon parameers updae, adap o he background, llumnaon changes, and so on and so forh. Tradonal Gaussan mxure model Gaussan mxure model, GMM) of each pxel n he mage s prncple o se up ndependen Gaussan models generally beween 3 and 5), for he 06. The auhors Publshed by Alans Press 03

2 6h Inernaonal Conference on Managemen, Educaon, Informaon and Conrol MEICI 06) momen pxels of sample values x, y I, s probably densy funcon of he muldmensonal Gaussan dsrbuon funcon by a weghed and o represen he probably densy funcon: P I x, y, I x, y,, ) Among hem, s he number of Gaussan componen, s he wegh of a Gaussan componens, he summaon wegh of should be ); s a Gaussan wegh average of he ; s he Gaussan componen of covarance, I x, y,,,, me Gaussan probably densy funcon, Gaussan dsrbuon s defned as: I x, y,, n e T I x, y I x y Among hem, n s he dmenson of sample values x, y, s he I. Parameer Updang and Background Machng. Modelng s he Gaussan mxure model n every place, n urn, machng he curren frame mulple pxels of each Gaussan componen, selec one or several modelng as a background model, oher are he prospecs of he model. If he currenly seleced value mee he condons, he mach s successful, he decson ha pon as he background, or for he fuure. General suaon, he choce of background modelng mehod s as follows: ) To all for he Gaussan componen n he Eq. accordng o he wegh and he rao of he / k square of he sandard devaon ) from bg o small arrangemen; ) Selec he frs B as he background model, and sasfy he relaonshp: B arg mn b T w Among hem, T w s for he seleced background, he probables of pxel values reman he same as Gaussan componen weghs seleced hreshold. When a new frame for needs and has been ranked Gaussan componen machng, he machng condon s: x x,, 4) Mee he condons of Eq. 4 of a Gaussan componen, classfed as he background model, and wll conform o he exsng Gaussan dsrbuon pon o parameer updang background, and he parameers accordng o he followng updae:, - x - - x, ) Oher Gaussan componens reman he same. Updae weghs updaed accordng o he followng formula: r 06. The auhors Publshed by Alans Press 03 ) 3) 5) 6) 8)

3 6h Inernaonal Conference on Managemen, Educaon, Informaon and Conrol MEICI 06),, r are all s updaed coeffcen, and when does no mach., he pxel values machng wh Gaussan dsrbuon, 0 When he Gaussan dsrbuon are no machng wh he curren pxel, argues ha pxel pons for fuure, needed o recreae a Gaussan model nsead of he prory of mnmum gauss dsrbuon, a Gaussan dsrbuon for he new se up he larger nal varance value, he average for he curren pxel values. The new model has a wegh of:, - r Fnally, he normalzaon of all he wegh coeffcen of: 0) For each frame of vdeo sequence mages, afer modelng he Gaussan mxure model s used o collec he arge background, hen usng background subracon dvson for movng arges. Tradonal Algorhm and Improved Three Frame Dfference Algorhm. In he process of mage processng, he frame dfference mehod s by calculang he dfference n value beween wo adjacen frames o ge movng arge. Two frames dfference mehod can smply and quckly oban he arge movemen area, bu he dfference only keep relave changes of nformaon, when he arges movemen speed oo fas, s easy o have a double and cavaon. Three frame dfference mehod s based on wo frames dfference mehod, an mproved wo frame dfference mehod can effecvely overcome he phenomenon of double. Ths arcle adops he mehod of hree consecuve frames dfference, he adjusmen of dynamc hreshold, he exracng an oulne of he clear objecves, and shall no affec he processng speed, s prncple s as follows: 9) d k 0 P x, P P x, P x, T T x, T T ) d k 0 P P P P T T T T ) M N T P x,y ) P 3) M N x0 y0 M N T P P M N x0 y0 4) Among hem, d k and d k are for he dfference mage, s resran coeffcen, can underake adjusmen accordng o acual needs, hs algorhm use he value of ; The resoluon of he mages for each frame, and s value of pxels deecon area; T as he beween-cluser varance mehod o deermne he effec of he arge and he background; T and T are he dynamc hreshold, he changes reflec he lgh n he process of arge deecon, he lgh changes, he more obvous, he greaer s value. Fnally, he mage and he logc operaon, ge he oulne of movng arges, so as o deermne he goals of he movemen. d d d D 0 d d The auhors Publshed by Alans Press 033 5) 6)

4 6h Inernaonal Conference on Managemen, Educaon, Informaon and Conrol MEICI 06) Among hem, D = sad prospecs, D = 0 sad background pons. Improve Algorhm. Through he sudy found ha he radonal Gaussan mxure model s no very good full of movng arges deecon area, especally n complex scenes, hgh sensvy o nose, whch nfluence he accurae deecon of arge; In addon, when movng arges by sac muae no movemen, llumnaon, and branches swayng complex scenaro, he radonal Gaussan mxure model can good o remove he nerference of nose. In hs paper, he radonal Gaussan mxure model was mproved, o solve he above problems. In order o elmnae nerference facors, when he exraced pxel does no conform o he background, can be recorded by mehod of counng pxels s no n conformy wh he background of The Tmes, when he pxel does no belong o esablsh he background mage and pxel values change slowly, judgmen ha pon o he nose, and makes he couner plus one, oherwse he rese. coun I x, B x, I x, I x, ) T coun oher 0 Among hem, he coun for he couner, background values of pxels, he background. T I and B x, y ) 7) a a ceran momen, respecvely and as he hreshold. When he coun reaches he hreshold se, o updae Desgn Implemenaon Algorhm n hs paper he hardware es plaform for.5 GHz CPU, 4 g RAM, Wndows 7 3-b operang sysem, he PC sofware plaform for Vsual Sudo 00, usng C# and EmguCV framework developmen. In esng, n he process of arge n mage sequence s preprocessed frs, by modelng he Gaussan mxure model for arge background, usng background subracon dvson for movng arges. Reuse -means cluserng algorhm, for complex scenes usng dfferen background regon o realze dfferen updae rae, complee he movng arge deecon, ge complee movng arges. The algorhm flow char s shown n Fg.. Image sequence Prereamen Three frame dfference Improved Gaussan mxure Background updae means algorhm Tes resuls Fgure. Algorhm flow char Fg. s under he condon of he radonal algorhm, he deecon of 39 frames n vdeo sequences and he 40h frame of moon arge deecon resul. Fg. c) s he second frame dfference mehod wh he Gaussan model of movng arge deecon s bnarzaon mage. Fg. 3 s he resul of he algorhm n hs paper o ge by he expermenal resuls can be seen ha n he hgh-speed movng arge movemen, he radonal algorhm can deec movng arges; however, he deecon of he arge has a lo of nerference facors. In hs paper, usng hree frame dfference and mprove he operaon of he Gaussan mxure model and objec n hgh speed movemen, can deec he movng arges. 06. The auhors Publshed by Alans Press 034

5 6h Inernaonal Conference on Managemen, Educaon, Informaon and Conrol MEICI 06) The 39 Frame a) The 40 Frame b) Tes resuls c) Fgure. Tradonal mehods Concluson The 39 Frame a) The 40 Frame b) The 4 Frame c) Tes resuls d) Fgure 3. Algorhm o deal wh he resuls n hs paper Desgned n hs paper, based on EmguCV mprovemen of movng arge deecon sysem, he Gaussan mxure model han regular moon arge deecon sysem has sronger ably of mage processng and nellgen processng, realzed he deecon of movng arges. Innovaon pon of hs arcle s a combnaon of Gaussan mxure model s pu forward and he algorhm of hree frame dfference mehod boh advanages, can be adaped o he changng scenes, and overcome he ner-frame dfference o exrac he arge s no accurae, easy o generae "double" and he nfluence of he hole, and easer o mplemen by a shadow suppresson algorhm, effecvely suppresses he exsence of he shadow, a las, by usng -means cluserng algorhm, for complex scenaros dfferen updae rae s realzed by usng dfferen background regon, o exrac he movng objec effecvely. The expermenal resuls show ha he algorhm s no sensve o he lgh background dsurbance, have ceran robusness and real-me, algorhm s fas and easy o mplemen, n he smar secury, raffc real-me monorng has exensve applcably, and have good economc benef. References [] X.F. We X. Lu: Laser echnology, Vol. 4 03) No.4, p.59 [] L.X. Xue, Y.L. Luo and Z.C. Wang: Applcaon Research of Compuers, Vol. 8 0) No.4, p.55 [3] N.N. He, J.P. Du: Journal of Bejng Technology and Busness Unversy Naural Scence Edon), Vol ) No.4, p.34 [4] Y. Wang, Y.J. Cao, F.F. Lang, H. Huang and P.P Yu: Journal of Elecronc Scence and echnology, Vol. 4 0) No.4, p.3 [5] W. We and Q. Wu: Compuer Engneerng and Desgn, Vol ) No.3, p.949 [6] Y.L. Hua and W.J. Lu: Journal of Compuer Applcaons, Vol ) No., p.580 [7] N. Xu: Journal of elecronc echnology n ShanX 05), p.4 [8] B. Lu, L.L. Wang and D. Pe: Laser & Infrared, 06) No., p.40 [9] M. Zhu: Compuer nowledge and Technology, Vol. 05) No.8, p.4 [0] W. Guo, X.Y. Lu and Z.J. Xao: Compuer Engneerng and Applcaons, 05) No.8, p The auhors Publshed by Alans Press 035