Sensors 2019, 19, 2672 4 of 16
background.
B
(
x
i
)
is initialized by the N pixel values that are firstly observed by the algorithm. N is a
fixed constant in the PBAS method. B
j
(
x
i
)
consists the pixel’s value v
j
(
x
i
)
, gradient value m
j
(
x
i
)
:
B
j
(
x
i
)
=
n
v
j
(
x
i
)
, m
j
(
x
i
)
o
, j = 1, 2, . . . , N (2)
The foreground segmentation mask is calculated as:
F
(
x
i
)
=
(
1, #
dist
(
x
i
, B
k
(
x
i
))
< R
(
x
i
)
< #
min
0, else
(3)
where F = 1 means foreground, otherwise background.
B
k
(
x
i
)
denotes the k-th sample in the background
model. #{...} denotes the number of the background samples which satisfy the condition in the brackets.
dist
(
x
i
, B
k
(
x
i
))
for each channel is calculated as follows:
dist
(
x
i
, B
k
(
x
i
))
= |v
(
x
i
)
− v
j
(
x
i
)
| + (c/I
m
) ∗ |m
(
x
i
)
− m
j
(
x
i
)
| (4)
where c is a fixed parameter. I
m
is the mean of the gradient values of all pixels in the previous frame.
Sensors 2019, 19, x FOR PEER REVIEW 4 of 16
(2)
Figure 1. Overview of the pixel-based adaptive segmenter (PBAS) method.
The foreground segmentation mask is calculated as:
(3)
where F = 1 means foreground, otherwise background. 𝐵
(𝑥
) denotes the k-th sample in the
background model. #{...} denotes the number of the background samples which satisfy the condition
in the brackets. dist(𝑥
, B
(
𝑥
)
) for each channel is calculated as follows:
(4)
where c is a fixed parameter. 𝐼
is the mean of the gradient values of all pixels in the previous frame.
In Equation (3), 𝑅(𝑥
) denotes 𝑥
’s distance threshold. 𝑅(𝑥
) needs to automatically adjust as
follows:
(5)
where 𝑅
/
and 𝑅
are fixed parameters in PBAS. R_lower is the lower bound of R
(
𝑥
)
. In
PBAS, R_lower is a fixed parameter which is set to 18. The other parameter is learning rate 𝑇(𝑥
). The
PBAS method defines the updating rules of 𝑇(𝑥
) as follows:
(6)
where 𝑇
and 𝑇
are fixed parameters. The update speed of the background model is inversely
related with 𝑇
(
𝑥
)
. The range of 𝑇
(
𝑥
)
’s variation is specified by the PBAS method to prevent the
background model from being updated too quickly or too slowly.
2.2 The Proposed Method
The process diagram of the proposed method is shown in Figure 2. In this section, we explain in
detail the similarities and differences between our WePBAS algorithm and PBAS algorithm. The
segmentation decision, background model update mechanism, preprocessing, and reinitialization
part of the WePBAS are introduced in this section.
Input image
Background/foreground
Output image
Update background
model
Compute 𝑑
Update distance threshold
Figure 1. Overview of the pixel-based adaptive segmenter (PBAS) method.
In Equation (3),
R
(
x
i
)
denotes
x
i
’s distance threshold.
R
(
x
i
)
needs to automatically adjust as follows:
(
x
i
)
=
(
R
(
x
i
)
∗
(
1 − R
inc/dec
)
, if R
(
x
i
)
> d
min
∗ R
scale
R
(
x
i
)
∗
(
1 + R
inc/dec
)
, else
(5)
where
R
inc/dec
and
R
scale
are fixed parameters in PBAS. R_lower is the lower bound of
R
(
x
i
)
. In PBAS,
R_lower is a fixed parameter which is set to 18. The other parameter is learning rate
T
(
x
i
)
. The PBAS
method defines the updating rules of T
(
x
i
)
as follows:
T
(
x
i
)
=
T
(
x
i
)
+ T
inc
/d
min
(
x
i
)
, if F
(
x
i
)
= 1
T
(
x
i
)
− T
dec
/d
min
(
x
i
)
, if F
(
x
i
)
= 0
(6)
where
T
inc
and
T
dec
are fixed parameters. The update speed of the background model is inversely
related with
T
(
x
i
)
. The range of
T
(
x
i
)
’s variation is specified by the PBAS method to prevent the
background model from being updated too quickly or too slowly.