# Moving Object Detection and Shadow Removing under Changing Illumination Condition

Authors: Jinhai Xiang; Heng Fan; Honghong Liao; Jun Xu; Weiping Sun; Shengsheng Yu
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

Moving object detection is a fundamental step in video surveillance system. To eliminate the influence of illumination change and shadow associated with the moving objects, we proposed a local intensity ratio model (LIRM) which is robust    to illumination change. Based on the analysis of the illumination and shadow model, we discussed the distribution of local intensity ratio. And the moving objects are segmented without shadow using normalized local intensity ratio via Gaussian
mixture model (GMM). Then erosion is used to get the moving objects contours and erase the scatter shadow patches and noises.
After that, we get the enhanced moving objects contours by a new contour enhancement method, in which foreground ratio
and spatial relation are considered. At last, a new method is used to fill foreground with holes. Experimental results
demonstrate that the proposed approach can get moving objects without cast shadow and shows excellent performance under
various illumination change conditions.


---

## Body

## 1. Introduction

Moving object detection is a fundamental step in many image analysis applications including automated visual surveillance, video indexing, and human machine interaction. Many researches on moving object detection have been proposed, such as background subtraction, optical flow, and temporal differencing [1]. However, moving object detection techniques are often affected by factors such as shadow, illumination changes, and noise. Generally, different factors cause different consequences. In this paper, we focus on shadow and illumination factors.The shadow causes many problems in object localization, segmentation, object detection, and tracking. Furthermore, the shadow may cause the following problems: objects merge with each other; object shapes may be altered; the background may be misclassified as foreground, and objects are missed [2]. Shadows associated with moving objects can easily be misinterpreted as additional objects. At the same time, if illumination changes, some background pixels may be detected as foreground pixels, which makes it hard to obtain the clean moving objects. Therefore, eliminating shadows and handling illumination changes have a great effect on the performance of subsequent steps such as tracking, recognition, classification, and activity analysis, which need the accurate detection of a moving object and the acquisition of its exact shape.Some reviews about shadow detection have been reported in the literature [2–4], from the views of physical and geometrical to heuristic techniques. Most of the real-time shadow detection techniques work at pixel level and use color information for shadow detection directly or indirectly, wholly or partially. Shadow detection methods can be roughly divided into two categories: based on statistic and based on the video features.The principle of statistic-based methods is to build pixel-based statistical models of detecting cast shadows. In [5], Zivkovic and van der Heijden use Gaussian mixture model (GMM) to detect moving cast shadows. This method consists of building a GMM for moving objects, identifying the distribution of moving objects and shadows and modifying the learning rates of the distributions. Joshi and Papanikolopoulos [6] propose semisupervised learning technique to tackle the static setting with human input for detecting shadows. Jung [7] uses a statistical approach combined with geometrical constraints for detecting shadows, but it is only for gray-scale video sequences. The statistic-based methods identify distribution of shadow pixel value and are robust in different scenes. Although these methods reduce false hits of property descriptions (i.e., color or intensity) of shadow, it cannot eliminate them. Generally, these methods require training video sequences, and shadow must be extracted from training video sequences by hand. Furthermore, it is hard to operate online and in real time because these methods need an additional learning step.The video features-based methods are based on the fact that video features, including geometric, color, gradient, and brightness, and so forth, are different in shadow, background, and moving objects. These methods are more general than those by statistic. The methods based on image features can be further divided into the following four categories [2]: chromaticity-based, light physical characteristics-based, geometric relations-based, and texture-based.The chromaticity-based methods are mostly on the basis of a single pixel and combined with color information to test the shadow. These methods make certain assumptions about the shadow properties: (1) a shadow darkens the background area on which it falls; (2) a shadows falls on the background plane; (3) a shadow changes luminance of an area more significantly than color [8]. If these assumptions are not satisfied, the accuracy of color-based approaches for shadow detection will decrease obviously. For better separation between intensity and chromaticity, several color spaces such as HSV [9], c1c2c3 [10], HSL [11], and RGB [12] have been developed to detect moving cast shadow robustly. Most of these methods are computationally inexpensive and easy to implement. However, they are sensitive to noise and will fail when shadow regions are darker or moving objects have similar color information with background.The light physical characteristics-based methods are based on the linear attenuation model of the light intensity which assumes that illumination source produces pure white light. In outdoor environment, the main light source is sunlight (white) and the reflected light comes from the sky (blue). Generally, other light source is influenced by sunlight. If sunlight is blocked, the effect of reflected light from the sky increases, and the chromaticity of shaded region is shifted toward the blue component. Nadimi and Bhanu [13] presented a dichromatic model which takes into account two light sources to predict the color changes of the shaded region effectively. Further works consider a variety of different light intensity conditions and build a more general nonlinear attenuation model to adapt to the indoor and outdoor scenes [14, 15]. These methods are still using the chromaticity characteristics, and if the foreground color is closer to the cast shadow, there would be some mistakes. The geometric feature-based methods mainly consider that, under certain light source, shape, and size of shadow, position relationship between objects can be ensured and segment shadow from foreground [16–18]. These methods do not need background model; however, they need detailed shape information and other information of foreground targets. These methods are limited to detect specific objects, and furthermore they need position relationship between objects and shadow. In the case of multiple shadows and multiple objects, these methods do not work well.The texture-based methods assume that the texture of shaded region is invariant. These methods generally include the following steps: (1) detect foreground with shadow and (2) classify foreground as either foreground or shadow based on the texture correlation. If texture of candidate area is similar to that of background, it may be misclassified as the shadow. Leone and Distante [19] propose a moving cast shadows method based on Gabor functions and matching pursuit strategy. Zhang et al. [20] employ ratio edge as the ratio between the intensity of one pixel and its neighboring pixels to detect shadows. Confirming the existence of shadows, Xiao et al. [21] reconstruct coarse object shapes and then extract cast shadows by subtracting moving objects from one changed mask. The texture-based methods are effective without colors information and robust to illumination changes. However, texture-based shadow detection methods need to compare adjacent pixels, and their complexity is high.Generally, we must obtain true foreground pixels before shadow detection by using methods above. A background subtraction method such as Gaussian mixture model (GMM) and its modified versions are some representative methods to detect moving pixels with shadow. However, in a dynamic scene, the varying background is detected as a moving object. In order to remove shadow directly and make it robust to illumination variations, we present a local intensity ratio model (LIRM), which shows illumination invariance. First, we use normalized local intensity ratio to replace the pixel to detect moving object without shadow via Gaussian mixture model. Second, erosion is used to get the moving objects contours and erase the scatter shadow patches and noises. After that, we get the enhanced moving object contours by contour enhancement method from erosion image and foreground image. At last, we use the local foreground density, and contour orientation to fill enhanced moving objects with holes. Experimental results demonstrate that the proposed approach can get moving objects without cast shadow and shows excellent performance under various changing illumination conditions.This paper is organized as follows. Section2 introduces illumination change model, presents LIRM, and analyzes its distribution. The process of Gaussian mixture model for foreground detection and corresponding postprocess algorithm are described in Section 3. Section 4 analyzes foreground detection results in four test videos with different light conditions and compares the results with other methods. Finally Section 5 concludes the paper.


## 2. Illumination Change Model

### 2.1. Local Intensity Ratio and Illumination Invariant

Zhang et al. [20] proved that the ratio edge is illumination invariant and use it to classify each moving pixel into foreground object or moving shadow. Inspired by this work, we define the local intensity ratio and analyze its illumination invariance.First, the definition of the local intensity ratio (LIR) is(1)
R
(
x
,
y
)
=
p
(
x
,
y
)
·
|
A
(
x
,
y
)
|
∑
(
i
,
j
)
∈
A
(
x
,
y
)
p
(
i
,
j
)
,
where p
(
x
,
y
) is the intensity of pixel (
x
,
y
); |
A
(
x
,
y
)
| is the number of pixels in a local region; A
(
x
,
y
) is the local region of given pixel (
x
,
y
) (a rectangle region) and defined as follows:
(2)
A
(
i
,
j
)
=
{
(
x
+
i
,
y
+
j
)
∣
-
r
⩽
i
,
j
⩽
r
}
and r is the size of the local region.For the images or videos acquired by a fixed camera, the intensity value of the pixel is(3)
p
(
x
,
y
)
=
ρ
(
x
,
y
)
·
I
(
x
,
y
)
·
θ
(
x
,
y
)
,
where ρ
(
x
,
y
) is the reflectance of object surface in pixel (
x
,
y
), that is, the reflection coefficient; I
(
x
,
y
) is the amount of light power per receiving object surface area in pixel (
x
,
y
); θ
(
x
,
y
) is the sensor sensitivity of the camera. The light in scenes can be divided into direct light of light source and scattered light of environment. We assume that the light source is a distant light source, and the light is parallel light, such as sunlight. Light of environment is scattered light, light direction is random, and its intensity in scenes is assumed to be constant. If objects are occluded, the scene can be divided into three cases: illuminated area, penumbra area, and umbra area [22, 23], and the light intensity of the real target pixel (
x
,
y
) is
(4)
I
(
x
,
y
)
=
{
L
a
+
L
p
·
cos
⁡
ϕ
(
x
,
y
)
,
illuminated
area
,
L
a
+
α
(
x
,
y
)
·
L
p
·
cos
⁡
ϕ
(
x
,
y
)
,
penumbra
area
,
L
a
,
umbra
area
,
where L
a is the intensity of ambient light; L
p is the intensity of light source; α
(
x
,
y
) is the transition inside the penumbra which depends on the light source and scene geometry, and 0
⩽
α
(
x
,
y
)
⩽
1; ϕ
(
x
,
y
) is the angle between light source direction and surface normal.While using RGB model to express light intensity, (4) can be shown as follows
(5)
I
(
x
,
y
)
k
=
{
L
a
k
+
L
p
k
·
cos
⁡
ϕ
(
x
,
y
)
,
illuminated
area
,
L
a
k
+
α
(
x
,
y
)
·
L
p
k
·
cos
⁡
ϕ
(
x
,
y
)
,
penumbra
area
,
L
a
k
,
umbra
area
,wherek is the number of color channels, k
=
1,2, and 3. For simplification, in this paper we consider only one light source and ignore the influence of different color channels.The analysis of the local intensity ratio under the three different scenes is as shown in Figure1.The illumination of the scene (three cases).
(a)
(b)If all the local regions belong to one of the three areas shown in Figure1, that is, A
(
x
,
y
)
∈
A
1 or A
(
x
,
y
)
∈
A
2, or A
(
x
,
y
)
∈
A
3, and A
1, A
2, and A
3 express the illuminate area, penumbra area, and umbra area, respectively, we can obtain the following results by formulas (4), (3), and (2) and assume |
A
(
x
,
y
)
|
=
n.Case 1 (A
(
x
,
y
)
∈
A
1).
Consider(6)
R
1
(
x
,
y
)
=
n
(
L
a
+
L
p
·
ϕ
(
x
,
y
)
)
·
ρ
(
x
,
y
)
·
θ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
(
L
a
+
L
p
·
ϕ
(
i
,
j
)
)
·
ρ
(
i
,
j
)
·
θ
(
i
,
j
)
.Case 2 (A
(
x
,
y
)
∈
A
2).
Consider(7)
R
2
(
x
,
y
)
=
n
(
L
a
+
α
(
x
,
y
)

·

L
p
·
ϕ
(
x
,
y
)
)
·
ρ
(
x
,
y
)
·
θ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
(
L
a

+

α
(
i
,
j
)
·
L
p
·
ϕ
(
i
,
j
)
)

·

ρ
(
i
,
j
)
·
θ
(
i
,
j
)
.Case 3 (A
(
x
,
y
)
∈
A
3).
Consider(8)
R
3
=
n
·
ρ
(
x
,
y
)
·
θ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
ρ
(
i
,
j
)
·
θ
(
i
,
j
)
.
If the pixels are in the same local region, we assume that (1) pixels in the same local region belong to the same object plane, thusϕ
(
x
,
y
)
=
ϕ
(
i
,
j
); (2) sensor sensitivity of camera in all local regions is the same; θ
(
x
,
y
)
=
θ
(
i
,
j
); (3) intensity of penumbra is also the same; α
(
x
,
y
)
=
α
(
i
,
j
).According to the previous assumptions, we get(9)
θ
(
x
,
y
)
=
θ
(
i
,
j
)
,
cos
⁡
ϕ
(
x
,
y
)
=
cos
⁡
ϕ
(
i
,
j
)
,
α
(
x
,
y
)
=
α
(
i
,
j
)
,
where (
i
,
j
)
∈
A
(
x
,
y
).By the previous assumptions, and formulas (6), (7), (8), and (9), we also get
(10)
R
1
(
x
,
y
)
=
n
·
ρ
(
x
,
y
)
·
θ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
ρ
(
i
,
j
)
·
θ
(
i
,
j
)
=
const
,
(11)
R
2
(
x
,
y
)
=
n
·
ρ
(
x
,
y
)
·
θ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
ρ
(
i
,
j
)
·
θ
(
i
,
j
)
=
const
,
(12)
R
1
(
x
,
y
)
=
R
2
(
x
,
y
)
=
R
3
(
x
,
y
)
=
const
.If local region belongs to one of the three illumination cases, local intensity ratio is influenced only by reflectivity. Therefore, local intensity ratio is related to the reflectivity of target surface, not to the illumination changes and types, that is, illumination invariance.The local intensity ratio of pixels is constant under different illumination conditions according to formula (12). As a result, local intensity ratio model not only removes the influence of illumination, but also eliminates shadow of the foreground targets.


### 2.2. Distribution of Local Intensity Ratio

Generally, it is assumed that the images are corrupted by Gaussian white noise, which can be expressed as(13)
P
r
(
x
,
y
)
=
P
b
(
x
,
y
)
+
ɛ
(
x
,
y
)
,
ɛ
(
x
,
y
)
~
N
(
0
,
σ
2
)
,
where P
r
(
x
,
y
) represents actual pixel value; P
b
(
x
,
y
) denotes real pixel value in scene; ɛ
(
x
,
y
) represents noise. The actual local intensity ratio is defined as
(14)
R
r
=
P
r
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
P
r
(
i
,
j
)
=
P
b
(
x
,
y
)
+
ɛ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
(
P
b
(
i
,
j
)
+
ɛ
(
i
,
j
)
)
.Usually,P
b
(
i
,
j
)
≫
ɛ
(
i
,
j
); formula (14) can be denoted as
(15)
R
r
=
P
b
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
P
b
(
i
,
j
)
+
ɛ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
P
b
(
i
,
j
)
=
R
b
+
ɛ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
P
b
(
i
,
j
)
,
where R
b is the real local intensity ratio:
(16)
R
b
=
P
b
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
P
b
(
i
,
j
)
.If pixel value in scene is constant,P
b
(
x
,
y
)
/
∑
(
i
,
j
)
∈
A
(
x
,
y
)
P
b
(
i
,
j
) obeys Gaussian white noise distribution. Therefore, local intensity ratio and pixel value have the same distribution. On the other hand, if ∑
(
i
,
j
)
∈
A
(
x
,
y
)
‍
P
b
(
i
,
j
) is small, the white noise will be amplified.Theoretically, the local intensity ratio ranges from 0 to infinite. In order to be consistent with the scope of a pixel value, the normalized definition of the local intensity ratio is as follows:(17)
LR
(
x
,
y
)
=
(
2
1
+
e
-
R
(
x
,
y
)
-
1
)
×
255
.


## 2.1. Local Intensity Ratio and Illumination Invariant

Zhang et al. [20] proved that the ratio edge is illumination invariant and use it to classify each moving pixel into foreground object or moving shadow. Inspired by this work, we define the local intensity ratio and analyze its illumination invariance.First, the definition of the local intensity ratio (LIR) is(1)
R
(
x
,
y
)
=
p
(
x
,
y
)
·
|
A
(
x
,
y
)
|
∑
(
i
,
j
)
∈
A
(
x
,
y
)
p
(
i
,
j
)
,
where p
(
x
,
y
) is the intensity of pixel (
x
,
y
); |
A
(
x
,
y
)
| is the number of pixels in a local region; A
(
x
,
y
) is the local region of given pixel (
x
,
y
) (a rectangle region) and defined as follows:
(2)
A
(
i
,
j
)
=
{
(
x
+
i
,
y
+
j
)
∣
-
r
⩽
i
,
j
⩽
r
}
and r is the size of the local region.For the images or videos acquired by a fixed camera, the intensity value of the pixel is(3)
p
(
x
,
y
)
=
ρ
(
x
,
y
)
·
I
(
x
,
y
)
·
θ
(
x
,
y
)
,
where ρ
(
x
,
y
) is the reflectance of object surface in pixel (
x
,
y
), that is, the reflection coefficient; I
(
x
,
y
) is the amount of light power per receiving object surface area in pixel (
x
,
y
); θ
(
x
,
y
) is the sensor sensitivity of the camera. The light in scenes can be divided into direct light of light source and scattered light of environment. We assume that the light source is a distant light source, and the light is parallel light, such as sunlight. Light of environment is scattered light, light direction is random, and its intensity in scenes is assumed to be constant. If objects are occluded, the scene can be divided into three cases: illuminated area, penumbra area, and umbra area [22, 23], and the light intensity of the real target pixel (
x
,
y
) is
(4)
I
(
x
,
y
)
=
{
L
a
+
L
p
·
cos
⁡
ϕ
(
x
,
y
)
,
illuminated
area
,
L
a
+
α
(
x
,
y
)
·
L
p
·
cos
⁡
ϕ
(
x
,
y
)
,
penumbra
area
,
L
a
,
umbra
area
,
where L
a is the intensity of ambient light; L
p is the intensity of light source; α
(
x
,
y
) is the transition inside the penumbra which depends on the light source and scene geometry, and 0
⩽
α
(
x
,
y
)
⩽
1; ϕ
(
x
,
y
) is the angle between light source direction and surface normal.While using RGB model to express light intensity, (4) can be shown as follows
(5)
I
(
x
,
y
)
k
=
{
L
a
k
+
L
p
k
·
cos
⁡
ϕ
(
x
,
y
)
,
illuminated
area
,
L
a
k
+
α
(
x
,
y
)
·
L
p
k
·
cos
⁡
ϕ
(
x
,
y
)
,
penumbra
area
,
L
a
k
,
umbra
area
,wherek is the number of color channels, k
=
1,2, and 3. For simplification, in this paper we consider only one light source and ignore the influence of different color channels.The analysis of the local intensity ratio under the three different scenes is as shown in Figure1.The illumination of the scene (three cases).
(a)
(b)If all the local regions belong to one of the three areas shown in Figure1, that is, A
(
x
,
y
)
∈
A
1 or A
(
x
,
y
)
∈
A
2, or A
(
x
,
y
)
∈
A
3, and A
1, A
2, and A
3 express the illuminate area, penumbra area, and umbra area, respectively, we can obtain the following results by formulas (4), (3), and (2) and assume |
A
(
x
,
y
)
|
=
n.Case 1 (A
(
x
,
y
)
∈
A
1).
Consider(6)
R
1
(
x
,
y
)
=
n
(
L
a
+
L
p
·
ϕ
(
x
,
y
)
)
·
ρ
(
x
,
y
)
·
θ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
(
L
a
+
L
p
·
ϕ
(
i
,
j
)
)
·
ρ
(
i
,
j
)
·
θ
(
i
,
j
)
.Case 2 (A
(
x
,
y
)
∈
A
2).
Consider(7)
R
2
(
x
,
y
)
=
n
(
L
a
+
α
(
x
,
y
)

·

L
p
·
ϕ
(
x
,
y
)
)
·
ρ
(
x
,
y
)
·
θ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
(
L
a

+

α
(
i
,
j
)
·
L
p
·
ϕ
(
i
,
j
)
)

·

ρ
(
i
,
j
)
·
θ
(
i
,
j
)
.Case 3 (A
(
x
,
y
)
∈
A
3).
Consider(8)
R
3
=
n
·
ρ
(
x
,
y
)
·
θ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
ρ
(
i
,
j
)
·
θ
(
i
,
j
)
.
If the pixels are in the same local region, we assume that (1) pixels in the same local region belong to the same object plane, thusϕ
(
x
,
y
)
=
ϕ
(
i
,
j
); (2) sensor sensitivity of camera in all local regions is the same; θ
(
x
,
y
)
=
θ
(
i
,
j
); (3) intensity of penumbra is also the same; α
(
x
,
y
)
=
α
(
i
,
j
).According to the previous assumptions, we get(9)
θ
(
x
,
y
)
=
θ
(
i
,
j
)
,
cos
⁡
ϕ
(
x
,
y
)
=
cos
⁡
ϕ
(
i
,
j
)
,
α
(
x
,
y
)
=
α
(
i
,
j
)
,
where (
i
,
j
)
∈
A
(
x
,
y
).By the previous assumptions, and formulas (6), (7), (8), and (9), we also get
(10)
R
1
(
x
,
y
)
=
n
·
ρ
(
x
,
y
)
·
θ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
ρ
(
i
,
j
)
·
θ
(
i
,
j
)
=
const
,
(11)
R
2
(
x
,
y
)
=
n
·
ρ
(
x
,
y
)
·
θ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
ρ
(
i
,
j
)
·
θ
(
i
,
j
)
=
const
,
(12)
R
1
(
x
,
y
)
=
R
2
(
x
,
y
)
=
R
3
(
x
,
y
)
=
const
.If local region belongs to one of the three illumination cases, local intensity ratio is influenced only by reflectivity. Therefore, local intensity ratio is related to the reflectivity of target surface, not to the illumination changes and types, that is, illumination invariance.The local intensity ratio of pixels is constant under different illumination conditions according to formula (12). As a result, local intensity ratio model not only removes the influence of illumination, but also eliminates shadow of the foreground targets.


## 2.2. Distribution of Local Intensity Ratio

Generally, it is assumed that the images are corrupted by Gaussian white noise, which can be expressed as(13)
P
r
(
x
,
y
)
=
P
b
(
x
,
y
)
+
ɛ
(
x
,
y
)
,
ɛ
(
x
,
y
)
~
N
(
0
,
σ
2
)
,
where P
r
(
x
,
y
) represents actual pixel value; P
b
(
x
,
y
) denotes real pixel value in scene; ɛ
(
x
,
y
) represents noise. The actual local intensity ratio is defined as
(14)
R
r
=
P
r
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
P
r
(
i
,
j
)
=
P
b
(
x
,
y
)
+
ɛ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
(
P
b
(
i
,
j
)
+
ɛ
(
i
,
j
)
)
.Usually,P
b
(
i
,
j
)
≫
ɛ
(
i
,
j
); formula (14) can be denoted as
(15)
R
r
=
P
b
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
P
b
(
i
,
j
)
+
ɛ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
P
b
(
i
,
j
)
=
R
b
+
ɛ
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
P
b
(
i
,
j
)
,
where R
b is the real local intensity ratio:
(16)
R
b
=
P
b
(
x
,
y
)
∑
(
i
,
j
)
∈
A
(
x
,
y
)
P
b
(
i
,
j
)
.If pixel value in scene is constant,P
b
(
x
,
y
)
/
∑
(
i
,
j
)
∈
A
(
x
,
y
)
P
b
(
i
,
j
) obeys Gaussian white noise distribution. Therefore, local intensity ratio and pixel value have the same distribution. On the other hand, if ∑
(
i
,
j
)
∈
A
(
x
,
y
)
‍
P
b
(
i
,
j
) is small, the white noise will be amplified.Theoretically, the local intensity ratio ranges from 0 to infinite. In order to be consistent with the scope of a pixel value, the normalized definition of the local intensity ratio is as follows:(17)
LR
(
x
,
y
)
=
(
2
1
+
e
-
R
(
x
,
y
)
-
1
)
×
255
.


## 3. Moving Object Detection Based on Local Intensity Ratio

In this section, we present the detailed procedure of shadow removing. The proposed method is a multistage approach and the flow chart is shown in Figure2.Figure 2
Flow chart of moving object detection and shadow removing.Generally, the shadow detection methods utilize object detection or image segmentation algorithms to detect the foreground with shadow and then classify the foreground as foreground or shadow. According to the results in the previous section, the local intensity ratio obeys Gaussian distribution. This paper uses the normalized LIR to replace the pixel to detect foreground, and the process is shown in Figure2. In this paper, Gaussian mixture model [5] is used to acquire the foreground. In mixture of Gaussians, the recent history of each pixel is maintained using k Gaussian distributions and the value of k typically chooses from 3 to 5. Each distribution has its associated attributes like weight ω
k, mean μ
k, and variance σ
k. Each Gaussian updates its parameters using LIR in every new frame.After detecting foreground, the foreground target with little shadow can be obtained (called foreground image as follows,I
fore). Meanwhile, some parts of the foreground object may be darker than the background and easily be false detected as background. The false detected parts of shadow are discrete; the false detected parts of moving object like holes are surrounded by foreground pixels (such as contour). The moving objects contour can be detected, while the shadows contour can be removed at most time. In order to get enhanced moving objects without discrete shadow patches, erosion is used to erase the scatter and noises and to get moving objects contours image without shadow (called contour image as follows, I
cont). Then the contour image is used to enhance moving objects by contour enhancement method. The enhancement procedure is as follows: for a pixel P
(
x
,
y
) being not foreground pixel in contours image, we calculate the weighted foreground pixel ratio of a local region in the contour image and foreground image as follows:
(18)
s
(
x
,
y
)
=
(
ω
c
N
c
(
x
,
y
)
+
ω
f
N
f
(
x
,
y
)
)
|
A
(
x
,
y
)
|
,
N
c
(
x
,
y
)
=
|
{
(
i
,
j
)
∣
(
i
,
j
)
∈
A
(
x
,
y
)
∧
(
i
,
j
)
∈
I
cont
}
|
,
N
f
(
x
,
y
)
=
|
{
(
i
,
j
)
∣
(
i
,
j
)
∈
A
(
x
,
y
)
∧
(
i
,
j
)
∈
I
fore
}
|
,
where s
(
x
,
y
) represents the rate of the enhanced moving object contours in (
x
,
y
), N
c
(
x
,
y
) is the number of foreground pixels in a neighbor region of pixel (
x
,
y
) in contour image, N
f
(
x
,
y
) is the number of foreground pixels in a neighbor region of pixel (
x
,
y
) in foreground image, and ω
c and ω
f are the weight to contour image and foreground image. We select ω
c
=
3, ω
f
=
1 in our experiments. |
A
(
x
,
y
)
| is the number of pixels in a local region; A
(
x
,
y
) is the local region of given pixel (
x
,
y
) (a rectangle region) and defined as in (2).On the other hand, we consider eight directions of a pixel, determine whether there is foreground pixel in each direction of the local region and count how many times it reaches foreground pixels, as shown in Figure3:
(19)
δ
i
(
x
,
y
)
=
{
1
,
foreground
pixels
in
the
i
th
direction
,
0
,
otherwise
,
v
(
x
,
y
)
=
1
8
∑
i
=
1
8
δ
i
(
x
,
y
)
,
where δ
i means whether there is a foreground pixel in the ith direction, and if it exists, its value is 1, otherwise 0. v
(
x
,
y
) is the ratio of foreground in eight directions. After calculating s
(
x
,
y
) and v
(
x
,
y
), by verifying whether or not the s
(
x
,
y
) and v
(
x
,
y
) of a pixel is in the feasible range, the pixel is determined by
(20)
p
(
x
,
y
)
=
{
255
,
v
(
x
,
y
)
>
γ
v
,
s
(
x
,
y
)
>
γ
s
,
0
,
otherwise
,
where γ
v and γ
s are the threshold values.Figure 3
Local region of the center pixel detection and its eight directions.So, we get the enhanced foreground contours image (called enhanced foreground contour image,I
enfc). However, some moving object pixels are false detected as background pixels, such as holes in the image. To get integral foreground object, we use filling method to eliminate false detected pixel for background pixel (Figure 4). For a pixel (
x
,
y
) which is detected as background pixel in enhanced foreground contour image, we first consider eight directions of a pixel: determine whether there is foreground pixel in each direction of the local region and count how many times it reaches foreground pixels, as expressed in (19). We also consider the ratio in a local region between numbers of foreground pixels in foreground image and in contour image and the numbers of pixels in the same region:
(21)
s
′
(
x
,
y
)
=
N
s
(
x
,
y
)
N
r
(
x
,
y
)
,
where s
′
(
x
,
y
) is the ratio of pixels detected as foreground in local region, N
s
(
x
,
y
) is the number of pixels which are detected as foreground, and N
r
(
x
,
y
) is the sum of pixels in the local region.Illustration of the shadow removal process using Campus sequence. (a) Current frame. (b) Normalized LIR of current frame. (c) Foreground object detected using GMM of LIR. (d) Result of erosion operation (contour image) to remove false detection shadow and noise. (e) Enhanced contour image by contour enhancement method. (f) Final result of filling holes.
(a)
(b)
(c)
(d)
(e)
(f)After calculatingv
(
x
,
y
) and s
′
(
x
,
y
), we can get the option that the pixel P
(
x
,
y
) is moving object pixel or not by
(22)
p
(
x
,
y
)
=
{
255
,
v
(
x
,
y
)
<
γ
v
′
,
s
′
(
x
,
y
)
<
γ
s
′
,
0
,
otherwise
,
where γ
v
′ and γ
s
′ are the threshold values; p
(
x
,
y
) denotes the final value of pixel (
x
,
y
).


## 4. Experiment Results

In this section, we describe the test videos used in this study, measure the performance of the proposed method, and compare the performance to the state-of-the-art methods. In general, state-of-the-art methods use different steps to remove shadow and reduce the influence of illumination changes. To compare with other methods in different steps, we first compare the shadow removing results and then compare the results under various illumination change conditions in different data sets.


### 4.1. Experiment Conditions and Parameter Setting

The size of the local rectangle region in (2) is important to the proposed method. If the size is too large, its inner region cannot meet the assumptions (9). On the other hand, if too small, the change of its value is also small. In our experiment, r is set as 2.


### 4.2. Experiment Results

To test the effect of shadow removing based on local intensity ratio and the effect of foreground detection, we use four typical videos from the ATON video set [4] as the test videos, which are Campus, Hallway, Highway 1, and Intelligent room. Intelligent room and Hallway are typical indoor environment. In the videos, people are walking in scene, and their shadows are mapped to the background. The Campus is a video of campus parking lot, and there are shadows of people and cars in the scenes.To compare the performance of the proposed moving objects detection method with other shadow detection methods, we assume that if shadow is detected as background, it is correct detection, otherwise it is false detection, and if moving object is detected as foreground, it is correct detection, otherwise it is false detection. The proposed method is compared with five methods introduced by [2], which are chromaticity-based method, physical method, geometry-based method, Small region (SR) texture-based method, and large region (LR) texture-based method. To estimate the effect of these methods, shadow detection rate (η) and shadow distinguishing rate (ξ) are the discriminate parameters [4], and their definitions are as follows:
(23)
η
=
T
P
S
T
P
S
+
F
N
S
×
100
%
,
ξ
=
T
P
F
T
P
F
+
F
N
F
×
100
%
,
where S is shadow; F is foreground. T
P
S is the number of the pixels which are detected correctly; F
N
S is the number of shadow pixels which are mistakenly detected as foreground; T
P
F is the number of foreground pixels detected correctly after removing shadows. F
N
F is the number of foreground pixels which are mistakenly detected as shadow. The shadow distinguishing rate is concerned with maintaining the pixels which belong to the moving object as foreground. In this paper, we use the average of the two rates as a single performance measure (avg).Table1 is the compared results among the method based on LIRM and other methods in [2]. Table 1 shows the average shadow detection and discrimination rates on each test sequence. From the compared results, the method proposed in this paper is better at most time. The main cause is that the presented method directly detects the foreground from video data, but other methods extract the shadow from foreground by true background and foreground with shadow. Our method use local intensity ratio to replace the actual pixel values; complexity is lower. Figure 6 is the result of proposed method in moving object detection without shadow in different scenes.Table 1
Comparison of moving object detection with different methods.
Methods
Campus
Intelligent room
Hallway
Highway I
η (%)
ξ (%)
Avg
η (%)
ξ (%)
Avg
η (%)
ξ (%)
Avg
η (%)
ξ (%)
Avg
chrMask
74.84
38.59
56.72
95.84
67.56
81.70
95.81
82.44
89.14
77.65
68.38
73.01
geoMask
76.78
85.96
81.36
57.35
73.87
65.61
50.68
77.81
64.24
65.34
74.15
69.74
lrTexMask
41.31
99.18
70.24
81.97
96.75
89.36
97.13
97.01
97.07
60.21
93.94
77.07
phyMask
71.41
30.60
51.00
77.96
85.95
81.95
85.82
86.89
86.35
48.15
79.47
63.81
srTexMask
64.6
91.13
77.86
93.12
56.64
74.88
98.40
67.15
82.77
14.79
94.87
54.82
proposed
67.97
88.68
78.32
91.70
95.36
93.53
96.26
97.47
96.86
74.59
66.82
70.71Figure5 represents compared results of the LIRM moving object detection via GMM and postprocess. From Figure 5, the postprocess obviously improves the shadow discrimination rate and slightly reduces the shadow detection rate. However, the average of the two rates is increased obviously. So, the postprocess enhances the moving object detection result.Figure 5
Compared detection result of LIRM via GMM and postprocess.Detection results in different scenes. (a) is Highway I sequence, (b) is intelligent room sequence, (c) is Campus sequence, and (d) is Hallway sequence. In the image of detection result, the moving object pixels are white, the background is black, and the shadow is gray.
(a)
(b)
(c)
(d)Finally, we show that the proposed method rapidly adapts to variations in environment. To test moving object detection under illumination changes condition, we compare the result of other techniques which are GMM [5], adaptive GMM [24] that controls the learning rate of the GMM adaptively, LBP [25] that detects moving objects using texture and edges, Xu’s methods [26] that use a color chromaticity, Pilet’s methods [27] that use illumination and spatial likelihood, and Choi’s methods [28] that develop chromaticity difference model and brightness model that estimates the intensity difference and intensity ratio of false foreground pixels. For the quantitative comparison, we have made three test videos [28]. Figure 7 represents moving object detection results of each method. From Figure 7, we find the postprocessing of the proposed method can strengthen the moving objects and remove the shadow patches and the noise, but it sometimes enhances the edge of part shadows incorrectly and makes moving objects’ edge fuzzy. In a word, the proposed method adapts to the changed background completely and detects moving object pixels without shadow pixels successfully. Although some other methods are robust to illumination, their detection moving pixels results show that they cannot detect moving object pixels meanwhile removing shadow.Figure 7
The comparison of moving object detection results under the changing illumination condition (three scenes). From left to right: (a) is video 1, (b) is video 2, and (c) is video 3. The 1st row is an input image, the remaining nine rows are detection results of each method, the 2nd row is a detection result of GMM, the 3rd row is of adaptive GMM, the 4th row is of LBP, the 5th row is of Xu, the 6th row is of Pilet, the 7th row is of Choi, the 8th row is of the proposed method without postprocessing, and the 9th row is the final result of proposed method.


## 4.1. Experiment Conditions and Parameter Setting

The size of the local rectangle region in (2) is important to the proposed method. If the size is too large, its inner region cannot meet the assumptions (9). On the other hand, if too small, the change of its value is also small. In our experiment, r is set as 2.


## 4.2. Experiment Results

To test the effect of shadow removing based on local intensity ratio and the effect of foreground detection, we use four typical videos from the ATON video set [4] as the test videos, which are Campus, Hallway, Highway 1, and Intelligent room. Intelligent room and Hallway are typical indoor environment. In the videos, people are walking in scene, and their shadows are mapped to the background. The Campus is a video of campus parking lot, and there are shadows of people and cars in the scenes.To compare the performance of the proposed moving objects detection method with other shadow detection methods, we assume that if shadow is detected as background, it is correct detection, otherwise it is false detection, and if moving object is detected as foreground, it is correct detection, otherwise it is false detection. The proposed method is compared with five methods introduced by [2], which are chromaticity-based method, physical method, geometry-based method, Small region (SR) texture-based method, and large region (LR) texture-based method. To estimate the effect of these methods, shadow detection rate (η) and shadow distinguishing rate (ξ) are the discriminate parameters [4], and their definitions are as follows:
(23)
η
=
T
P
S
T
P
S
+
F
N
S
×
100
%
,
ξ
=
T
P
F
T
P
F
+
F
N
F
×
100
%
,
where S is shadow; F is foreground. T
P
S is the number of the pixels which are detected correctly; F
N
S is the number of shadow pixels which are mistakenly detected as foreground; T
P
F is the number of foreground pixels detected correctly after removing shadows. F
N
F is the number of foreground pixels which are mistakenly detected as shadow. The shadow distinguishing rate is concerned with maintaining the pixels which belong to the moving object as foreground. In this paper, we use the average of the two rates as a single performance measure (avg).Table1 is the compared results among the method based on LIRM and other methods in [2]. Table 1 shows the average shadow detection and discrimination rates on each test sequence. From the compared results, the method proposed in this paper is better at most time. The main cause is that the presented method directly detects the foreground from video data, but other methods extract the shadow from foreground by true background and foreground with shadow. Our method use local intensity ratio to replace the actual pixel values; complexity is lower. Figure 6 is the result of proposed method in moving object detection without shadow in different scenes.Table 1
Comparison of moving object detection with different methods.
Methods
Campus
Intelligent room
Hallway
Highway I
η (%)
ξ (%)
Avg
η (%)
ξ (%)
Avg
η (%)
ξ (%)
Avg
η (%)
ξ (%)
Avg
chrMask
74.84
38.59
56.72
95.84
67.56
81.70
95.81
82.44
89.14
77.65
68.38
73.01
geoMask
76.78
85.96
81.36
57.35
73.87
65.61
50.68
77.81
64.24
65.34
74.15
69.74
lrTexMask
41.31
99.18
70.24
81.97
96.75
89.36
97.13
97.01
97.07
60.21
93.94
77.07
phyMask
71.41
30.60
51.00
77.96
85.95
81.95
85.82
86.89
86.35
48.15
79.47
63.81
srTexMask
64.6
91.13
77.86
93.12
56.64
74.88
98.40
67.15
82.77
14.79
94.87
54.82
proposed
67.97
88.68
78.32
91.70
95.36
93.53
96.26
97.47
96.86
74.59
66.82
70.71Figure5 represents compared results of the LIRM moving object detection via GMM and postprocess. From Figure 5, the postprocess obviously improves the shadow discrimination rate and slightly reduces the shadow detection rate. However, the average of the two rates is increased obviously. So, the postprocess enhances the moving object detection result.Figure 5
Compared detection result of LIRM via GMM and postprocess.Detection results in different scenes. (a) is Highway I sequence, (b) is intelligent room sequence, (c) is Campus sequence, and (d) is Hallway sequence. In the image of detection result, the moving object pixels are white, the background is black, and the shadow is gray.
(a)
(b)
(c)
(d)Finally, we show that the proposed method rapidly adapts to variations in environment. To test moving object detection under illumination changes condition, we compare the result of other techniques which are GMM [5], adaptive GMM [24] that controls the learning rate of the GMM adaptively, LBP [25] that detects moving objects using texture and edges, Xu’s methods [26] that use a color chromaticity, Pilet’s methods [27] that use illumination and spatial likelihood, and Choi’s methods [28] that develop chromaticity difference model and brightness model that estimates the intensity difference and intensity ratio of false foreground pixels. For the quantitative comparison, we have made three test videos [28]. Figure 7 represents moving object detection results of each method. From Figure 7, we find the postprocessing of the proposed method can strengthen the moving objects and remove the shadow patches and the noise, but it sometimes enhances the edge of part shadows incorrectly and makes moving objects’ edge fuzzy. In a word, the proposed method adapts to the changed background completely and detects moving object pixels without shadow pixels successfully. Although some other methods are robust to illumination, their detection moving pixels results show that they cannot detect moving object pixels meanwhile removing shadow.Figure 7
The comparison of moving object detection results under the changing illumination condition (three scenes). From left to right: (a) is video 1, (b) is video 2, and (c) is video 3. The 1st row is an input image, the remaining nine rows are detection results of each method, the 2nd row is a detection result of GMM, the 3rd row is of adaptive GMM, the 4th row is of LBP, the 5th row is of Xu, the 6th row is of Pilet, the 7th row is of Choi, the 8th row is of the proposed method without postprocessing, and the 9th row is the final result of proposed method.


## 5. Conclusions

In this paper, we propose a method to detect moving object meanwhile removing cast shadow, which is robust in changing illumination condition. This paper presents a local intensity ratio model according to illumination model and proves its illumination invariance. Meanwhile, if the noise in video obeys the Gaussian distribution, the local intensity ratio also obeys the Gaussian distribution. In the process of Gaussian mixture model to obtain foreground, this paper replaces actual pixel value by local intensity ratio. Finally, postprocess methods are used to get pure moving object pixels without noise, such as erosion method to remove shadow pitch and noise which is false detected as foreground, foreground contour enhanced method to strengthen moving object contour, and filling methods to deal with holes in foreground object. Experiment results demonstrate that the method presented by this paper can eliminate shadow on foreground effectively, and is robust in changing illumination condition. However, in some scenes that foreground is similar to background or foreground is similar to shadow, foreground may be easily detected as background. If illumination changes severely, such as turn on/off light in indoor scene, the background may be easily detected as foreground, and the performance drops.



---

*Source: 827461-2014-02-24.xml*