
Background Subtraction on Embedded Hardware 21-11
21.3.2 Foreground Detection
Extracting the foreground from the current image is straightforward once we have obtained
the background model M. The algorithm performing this task is detailed in Fig. 21.2.
Algorithm 21.2 - Algorithm for Background Subtraction
x
t
= (R, G, B), I ←
√
R
2
+ G
2
+ B
2
For all codewords in M, find the codeword c
m
matching to x
t
based on two conditions:
(a) colordist(x
t
, v
m
) ≤ ǫ
2
(b) brightness
I,
D
ˇ
I
m
,
ˆ
I
m
E
= true
Update matched codeword as in algorithm 1
BGS(x) =
(
foreground if there is no match
background otherwise
21.3.3 Background Model Update
Kim et al. [13] propose a layered modeling and ...