
ViBe: A Disruptive Method for Background Subtraction 7-11
Algorithm 7.2 - Updating Algorithm of ViBe
1 i n t width ; // w i d t h o f t he image
2 i n t h e i gh t ; // h e i g h t o f t h e image
3 byte image [ width ∗ he i g ht ] ; // c u rr e nt image
4 byte updatingMask [ ∗ h ei gh t ] ; // upd a t i n g mask (1==u p d a ti n g al l o w ed )
5
6 i n t sub sa mp li ngFact or = 16 ; // amount o f random subs a m p l i ng
7
8 i n t numberOfSamples = 20 ; // number o f samp les per p i x e l
9 byte s am ples [ width ∗ he ig h t ] [ numberOfSamples ] ; // backg round model
10
11 f o r ( i nt p = 0 ; p < width ∗ he i g ht ; p++)
12 i f ( updatingMask [ p