WATER LEVEL TRACKING WITH CONDENSATION ALGORITHM Shinsuke KOBAYASHI, Shogo MURAMATSU, Hisakazu KIKUCHI, Masahiro IWAHASHI Dep. of Elecrical and Elecronic Eng., Niigaa Universiy, 8050 2-no-cho Igarashi, Niigaa, 950-2181 Japan Dep. of Elecrical Eng., Nagaoka Universiy of Technology, 1603-1 Kamiomioka, Nagaoka, Niigaa, 940-2188 Japan E-mail: shinsuke@elecom0.eng.niigaa-u.ac.jp ABSTRACT In his repor, we propose a racking mehod ha racks a waer level as a line from a video sequence. This mehod arges he use in a river surveillance and alarm sysem. In our proposed mehod, a line racking problem is ransformed o a poin racking problem by using Hough ransformaion and he poin is racked wih Condensaion algorihm. Our proposed mehod is examined by comparing wih he Kalman filering approach. 1. INTRODUCTION In his repor, we propose a river surface racking mehod ha arges he use in a river surveillance and alarm sysem. As growing he ineres of disaser prevenion, i is desired o apply he informaion echnology o problems in his area. River waer level measuremen is very imporan for river overflow predicion. Generally, i is performed wih waer level elemeers [1, 2]. To place he waer level elemeers is, however, expensive and here are some difficulies in is legal placemen in Japan. Thus, here is an increasing demand for measuring he waer level by reasonable video cameras and by analyzing he images capured from hose cameras. Therefore, in his repor, we propose a mehod ha racks river surface line in a video sequence from a surveillance camera. Our proposed mehod adops he Hough ransformaion o deec dominan lines [5]. Nex hese lines are inpu ino he Condensaion (condiional densiy propagaion algorihm, which is a saisical racking mehod and yields a esimaed line [6]. By using he Hough ransformaion, a line racking problem is reduced o a poin racking problem on 2-dimensional plane. Since he Condensaion algorihm has sufficien serviliy o dynamics and robusness o errors, i can provide seady racking. Alhough he Condensaion algorihm requires relaively high compuaional cos, our proposed mehod reduces he compuaional cos by holding he dimension of sae vecor o wo and by droping he dimension of observaion reducing o 1-dimensional. Our proposed mehod enables us o esimae he waer level from a surveillance video sequence. In nex secion, we inroduce o he Hough ransformaion. In Secion 3, we explan he overview of he Condensaion algorihm. We propose a line racking mehod in Secion 4. The significance of our proposed mehod is examined by comparing wih he Kalman filering approach in Secion 5 and he conclusions follow. 2. HOUGH TRANSFORMATION The Hough ransformaion of lines is used in our proposed mehod a he and of preprocess. The Hough ransformaion is a mehod ha ransforms a normal image expressed in recangular coordinaes o one expressed in polar coordinaes and deec dominan lines from he polar-coordinae-image [5]. A line on he x-y plane is wrien by y = ax + b. By using θ and ρ illusraed in Fig. 1(a, he funcion of a line is expressed as ρ = xcosθ + ysinθ. (1 The Hough ransformaion is performed by his equaion. A line on x-y plane is ransformed o a poin on θ-ρ plane and a poin on x-y plane is ransformed o a sin curve on θ-ρ plane by equaion (1. Ranges of θ and ρ are 0 θ < π and w < ρ < w 2 + h 2 respecively, where w is widh and h is heigh of he inpu image. As shown in Fig. 1, when wo poins p and q on x-y plane are given, we can obain each curves on θ-ρ plane by using Eq. (1 and we can find he cross poin l. The coordinaes (θ l, ρ l of he cross poin l wih Eq. (1 give us he funcion ρ l = xcosθ l + ysinθ l. This is he funcion of he line passing wo poins p and q. By using he Hough ransformaion, i seem ha a line on x-y plane can be expressed as a poin on θ-ρ plane. Fig. 1. Hough ransformaion 750
3. CONDENSATION ALGORITHM p( x Z poserior probabiliy The Condensaion algorihm gives us an framework in order o obain he poserior disribusion p (x Z of random variable x from a se Z = {z 1, z 2,..., z which is a se of daas observed unil he ime [6, 7]. 3.1. Assumpions for he Condensaion Algorihm The Condensaion algorihm assumes he followings. x The dynamics of he random variable x is Markov chain. Namely, p (x X 1 = p (x x 1, (2 where X = {x 1, x 2,, x. weighed samples Fig. 2. Inernal represenaion of he Condensaion algorihm The observaion daa z depends only on he random variable x and is independen for each ime. Tha is p (Z X = p (z i x i. (3 i=1 Under hese wo assumpion, he propagaion of probabiliy densiy is derived. 0100 0100 01 01 selecion 3.2. Propagaion of Probabiliy Densiy From Bayes s rule p (x Z = k p (z x p (x Z 1, (4 0100 01 0100 01 01 0 111 01 0 111 predicion measuremen where p (x Z 1 = p (x x 1 p (x 1 Z 1 dx 1, (5 and k is a normalisaion consan ha does no depend on x. By Eq. (5, he prior p (x Z 1 is evaluaed from he poserior p (x 1 Z 1 which is calculaed a previous ime sep. By he equaion (4, he new poserior p (x Z is decided from he prior p (x Z 1 and he observaion densiy p (z x, which depend on he new observaion daa z. In he Condensaion algorihm, he inegral of Eq. (5 is no calculaed direcly, bu evaluaed approximaely by using a sampling mehod. 3.3. Condensaion Algorihm The Condensaion algorihm is one of sampling mehods for esimaing disribuion. The inernal represenaion of he Condensaion algorihm is shown in Fig. 2. We have a se {( of N weighed samples ; n = 1,, N and s (n, π (n his se approximaely represens he poserior p (x Z, where s (n is a sample of he random variable x and π (n is is weigh. As a new observaion daa come in, we can updae he weighed sample se hrough he following hree seps and obain he new poserior. This algorihm is illusraed in Fig. 3. weighed sample sample Fig. 3. Condensaion algorihm { Sep 1: Selecion Sample N imes from he se s (n 1 by choosing probabiliy π (n. In his sep, some elemens ha have especially high weigh may be chosen several imes and may have idenical copy in he new sample se. On he oher hand, some elemens ha have low weigh may no{ be choosen a all. The new sample se is denoed as. s (n Sep 2: Predicion Predic by drawing samples from { o generae ( p x x 1 = s (n s (n (6. In our proposed mehod, we assume ha he dynamical model is a firs-order auoregressive process, consequenly prediced sample can 751
be obained by s (n = As (n + Bw, (7 where w is a vecor of independen sandard normal random variables. Marices A and B represen he deerminisic and sochasic componens of he dynamical model, respecively. { In his sep, he disribuion of hese samples approximae he prior p (x Z 1. s (n Sep 3: Measuremen For each new sample s (n, evaluae he new weigh from and normalize o saisfy π (n p (z x = s n, (8 N n=1 π (n = 1. (9 In he case ha he sae vecor x is one dimensional, 1 { p (z x 1 + exp v2 m 2πσα 2σ 2, (10 where m is he number of observaion daa, v m = z (m x, σ and α are consans decided from observaion accuracy and error rae. {( Here we obain he new weighed sample se s (n, π (n. The expecaional value is calculaed from ɛ [x ] = N n=1 m π (n s (n. (11 Fig. 4. Srucure of our proposed mehod (a Inpu frame (b Binary image Fig. 5. Binarizaion of inpu frame 4. PROPOSED WATER LEVEL TRACKING The srucure of our proposed mehod is shown in Fig.4. The size in hese parenhesises is he image size used in he experimen. Each process is explained in he followings. 4.1. Preprocess A he preprocess, a binary image I (bin is generaed from inpu frame I. Nex, he Hough ransformaion is applied o I (bin and dominan lines are exraced. A firs, he difference image I (d is calculaed from inpu frame I and a base image I (b The base image I (b I (d I (b, = I I (b. (12 is updaed by +1 = I + I (b. (13 2 Nex, he binary image I (bin is generaed from he difference image I (d. A hreshold value T is used hrough his process. If he absolue value of each pixel in I (d is over he hreshold T, corresponding pixel of binary image will be whie, oherwise black. Figure 5 show one inpu frame and is binarized image. Our proposed mehod does no employ he simple frame difference mehod and he base image is weighed average image of inpu frames, because i is desired o exclude he influence of noise. Since he base image can forge he old inpu frame informaion by using Eq. (13 and updae he base image, our proposed mehod possesses adapabiliy for inensiy change. For all whie pixels of binary image I (bin, he Hough ransformaion is performed hen Hough image I (h is obained. In he following experimen, I (h is quanized o he same size of he inpu image for compuaional convenience. From he Hough image I h, poins corresponding o dominan lines are exraced and he following coordinaes se is formed. z = { z (m = ( θ (m, ρ (m ; m = 1,, M. (14 752
(a Hough image (b Exraced lines (a Sequence 1 (b Sequence 2 Fig. 6. Hough ransformaion and exraced lines Fig. 7. Snapshos of video sequences In our experimen, coordinaes quanized ono he Hough image (no parameers of Eq. (1 are used as (θ (m, ρ (m. The Hough ransformaion can be performed for grayscale image, bu we use he binary image as inpu for reducing he compuaional cos. The Hough image of he binary image in Fig.5(b and exraced lines are shown in Fig. 6. Number of dominan lines is no always one. In fac, wo lines are exraced in Fig.6. By noise, he Hough ransformaion may exrac wrong lines. Therefore i is necessary o use saisical approach in order o remove his influence. In our proposed mehod, we use he Condensaion algorihm. 4.2. Updae of Condensaion Sample Se By he coordinaes se z, he Condensaion sample se is updaed and he expecaional value ɛ [x ] is evaluaed. Because we assume ha he dynamical model is a firsorder auo-regressive process, we use Eq. (7 in he Condensaion predicion sep. To reduce he dimension of observaion densiy o one dimension, we use he following in he measuremen sep. ( 2 1 d z (m p (z x 1 + exp 2πσα, x 2σ 2, (15 where m d (x 1, x 2 = (θ 2 θ 1 2 + (ρ 2 ρ 1 2, (16 and x 1 = (θ 1, ρ 1, x 2 = (θ 2, ρ 2. 5. PERFORMANCE EVALUATION We use wo video sequences for performance evaluaion. Snapshos of hese sequences are shown in Fig. 7. Table 1 shows some pariculariies of hese video sequences. Sequence 1 is a video sequence of a river in fair weaher and he waer surface is calm. Sequence 2 is a video of he same river in bad weaher. I rains and he waer surface is rough. Table 1. Video Sequences sequence frame size frame rae number of frames Seq.1 320x240 30 fps 464 Seq.2 320x240 30 fps 458 As consans of Eq. (7 and (10, we use ( A =, ( 5 0 B =, 0 5 σ = 1, α = 0.01, he binarize hreshold T = 127 and we experimen on waer level racking wih our proposed mehod for he number of samples N = 1000. To verify he significance, we compare i wih he experimenal resul of he Kalman filering approach [8]. In he Kalman filer, he sae equaion and he observaion equaion are given by x = Fx 1 + Gw, (17 z = Hx + v, (18 respecively, and consans are se o ( F =, ( 5 0 G =, 0 5 ( H =, ( Σ w =, ( 10 2 0 Σ v = 0 2, where w and v are vecors of independen sandard normal random variables, Σ w and Σ v are covariance marices, respecively. 753
(a frame 40 of Seq.2 (a frame 40 of Seq.2 (b frame 41 of Seq.2 (b frame 41 of Seq.2 Fig. 8. Simulaion resul (proposed mehod Fig. 9. Simulaion resul (Kalman filering approach These resuls wih Seq.2 are shown in Figs. 8 and 9. The doed lines denoe he observaion daa from he Hough ransformaion and he solid lines denoe he esimaed lines a he end. Boh of Figs. 8 and 9 show successive wo frames in video sequence 2. From he firs frame, almos correc observaion is obained, bu wrong observaion come in from he oher frame due o he rain. In he Kalman filering approach, he observaion error effec he esimaion immediaely, alhough, in our proposed mehod using he Condensaion algorihm, he influence is almos no seen. This resul from ha he Condensaion algorihm is designed wih considering he observaion error. Through he video sequence, boh wo approaches show almos he same sensiiviy in he low observaion error par, bu in he high error par, our proposed mehod can obain more seady racking han he Kalman filering approach. MSE evaluaions of proposed mehod and he Kalman filering approach is shown in Table 2. Each value in Table 2 shows he mean square error beween rue waer surface lines and esimaed lines. True waer surface lines are decided manually. Equaion (16 is used o calculae errors beween rue lines and esimaed lines. From Table 2, i is seen ha proposed mehod give us error less racking for boh sequences han he Kalman filering approach. 6. CONCLUSIONS In his repor, we proposed he waer level racking mehod in river surveillance video by using he Hough ransformaion and he Condensaion algorihm. From several experimenal resuls, he significance of our proposed mehod is evaluaed wih he comparison of our proposed mehod wih 754
Table 2. Evaluaion by MSE Condensaion Kalman Filer Seq. 1 22.46 51.75 Seq. 2 55.24 2925.85 he Kalman filering approach. There are some assignmen for he fuure such as improvemen of preprocess, reducion of he observaion error rae and resricion of racking area. Acknowledgemen This research is financially suppored by Foundaion of River and Waershed Environmen Managemen, Japan as river and waershed mainenance projec. 7. REFERENCES [1] Minisry of inernaional affairs and communicaions, Japan, hp://www.soumu.go.jp/english/index.hml [2] hp://www.river.go.jp/ [3] Asushi Saio, Masahiro Iwahashi: River waer level deec algorihm wih frame synchronous adding and filering, The 19h Workshop on Circuis and Sysems in Karuizawa, pp.525-530, Apr. 2006 [4] Yuji Imai, Masahiro Iwahashi: River waer level deec algorihm using he Wavele ransformaion in JPEG2000, The 19h Workshop on Circuis and Sysems in Karuizawa, pp.531-534, Apr. 2006 [5] Rafael C. Gonzalez, Richard E. Woods: Digial Image Processing, Prenice-Hall, Inc., 2002 [6] Michael Isard, Andrew Blake: Condensaion - condiional densiy propagaion for visual racking, In. J. Compuer Vision, 1998 [7] M. Sanjeev Arulampalam, Simon Maskell, Neil Gordon, and Tim Clapp: A Tuorial on Paricle Filers for Online Nonlinear/Non-Gaussian Bayesian Tracking, ieee ransacions of signal processing, vol. 50, no. 2, february 2002. [8] R. E. Kalman: A new approach o linear filering and predicion problem, Journal of Basic Engineering, 82, pp.35-45, 1960 755