Received 13 June 2016; accepted 24 July 2016; published 27 July 2016
The performance of moving object detection algorithm is very crucial in a sound surveillance system for reliable tracking and behavior recognition. In recent years, many scholars have successively proposed lots of classic moving object detection algorithms  . They mainly include the optical flow method, the frame difference method and the background subtraction method. The optical flow method uses the vector characteristics of the moving object which changed over with time to detect moving objects in image sequences  . The method can be applied to dynamic scenes, but its calculation is complex and anti-disturbance ability is poor, which can’t meet the requirements of real-time video processing. The frame difference method  uses the two adjacent frame subtraction to detect moving objects, the method is not sensitive to the change of light, and has good real-time performance. However, it’s difficult to obtain complete contour of moving object, and prone to “ghost” and “holes” phenomenon when the speed of moving target is too fast or too slow. The background subtraction method builds first a background image, and then uses the subtraction of the current frame and background image to extract the moving objects  . The key of this method is that the background modeling and accuracy of the model. But the extracted background image is easy to be disturbed by light, weather and the other environmental conditions. Recently, the background modeling method based on statistical model has been developed for its good adaptability to complex scenes.
Stauffer et al. proposed Gaussian mixture model (GMM)  used for background modeling which had been found to cope reliably with slow illumination changes, repetitive motions from clutter, and long-term scene changes. However, this method suffers from many problems in the process of object detection. For example, it will judge the entire frame as foreground when suffering a sudden illumination change; the number of Gaussian distributions is constant in the background model; the result of moving object detection contains shadow region and contour of moving object is discontinuous. Many improved methods have been proposed to solve these problems. Ellis et al. used a method to calculate the ratio of the foreground region to deal with the interference of illumination change  . The method only has better performance for global illumination change rather than local illumination change. Zivkovic proposed an adaptive GMM algorithm with the maximum likelihood estimation  , which adaptively chose the appropriate number of Gaussian distributions to model each pixel on-line. This method reduces the processing time and improves the accuracy of segmentation slightly. However, a priori negative coefficient introduced by artificiality may result in appearing unreasonable update to the weight of the Gaussian distribution during the update processing and affecting effect of the moving target detection. Zhiyan Bin et al. proposed a new effective algorithm which combines HSV color information with RGB normalized space and first-order gradient information for shadow removing in all kinds of complex scene  . The method can remove a portion of the shadow region, but the edge information of moving objects has been influenced, which brings lots of difficulties for subsequent processing.
Based on Gaussian mixture model and three-frame differencing method, we propose a moving object detection algorithm in this paper. The experiments show that our algorithm has improved in the aspects of accuracy, adaptability and real-time performance.
2. Gaussian Mixture Model
GMM algorithm considers the value of a particular pixel over time as a “pixel process”, which is a time series of pixel value. It presents the recent history of each pixel by mixture of K Gaussian distributions, where is the pixel value of at time t. The probability of observing the current pixel value is
where is the mean value of the Gaussian in the mixture at time t, is an estimate of the weight of the Gaussian in the mixture at time t, is the covariance matrix of the Gaussian in the mixture at time t, and where is a Gaussian probability density function
where n is dimension of the. For computational reasons, the covariance matrix is assumed to be of the form.This assumes that the red, green, and blue pixel values are independent and have the same variances, where I is the unit matrix, is the variance of the Gaussian in the mixture at time t. Every new pixel value, , is checked against the existing K Gaussian distributions, until a match is found. A match is defined as a pixel value within 2.5 standard deviations of a distribution. If none of the K distributions match the current pixel value, the least probable distribution is replaced with the current value as its mean value, an initially high variance, and low prior weight. The prior weight of the K distributions at time t, are adjusted as follows
where is the learning rate, is 1 for the model which matched and 0 for the remaining models. The, for unmatched distributions remain the same. Parameters of the distribution which matches the new observation are updated as follows
where is parameter learning rate, and. After this approximation, the weights are renormalized.
The Gaussian distributions are ordered by the value of. This ordering of the model is effectively an ordered, open-ended list, where the most likely background distributions remain on top and the less probable transient background distributions gravitate towards the bottom and are eventually replaced by new distributions. Then the first B distributions are chosen as the background model
where T is a measure of the minimum portion of the pixel that should be accounted for by the background. Each pixel which is matched with any of the former B Gaussian distributions will be marked as background pixel. Otherwise, it will be marked as foreground pixel.
3. Proposed Algorithm
This paper proposes a moving object detection algorithm which based on Gaussian mixture model and three- frame difference method. Firstly, we achieve the coarse segmentation of motion region which utilize the improved three-frame difference method. We make up the target boundary fracture portions by combining with edge detection technology, and overcome the impact of the sudden illumination change by adjusting the binary threshold value based on changes of the scenes. Secondly, in the process of mixture Gaussian background model, according to the change of model’s weight decide to add model or remove unmatched model, the number of components of the mixture is constantly adapted for each pixel, which improves the ability of the algorithm to describe the scene. Finally, we utilize characteristic of HSV color space to eliminate the interference of the shadow region effectively.
3.1. Improved Three-Frame Difference Method
The traditional three-frame difference method can quickly detect moving objects. But the algorithm has poor ability to deal with illumination change scenes because of the fixed segmentation threshold it utilized. In addition, holes phenomena will occur in object interior and part of the object contour is not continuous. To solve these problems, this paper proposes the improved of three-frame difference method. It combines three-frame difference method with canny edge detection  operator, which solves the problem of target edge discontinuity. What’s more, with dynamic binary threshold value, it effectively adapt to the scene of illumination change. Steps of the improved three-frame difference method are shown as follows
1) Three frames, defined as, then we calculate the difference value of image between adjacent two frames respectively, binary image and are obtained by the segmentation threshold. They can be written as follows
where T is the fixed binary threshold, are dynamic threshold. They are described as follows
where is the number of pixels of the image, is inhibition coefficient. We can get binary image by doing and operation between and.
2) We get edge image by using canny operator extract edge information of frame image. Then we obtain binary image by doing and operation between edge image and. Finally, we get binary image by doing or operation between and.
3) We obtain complete moving object region by doing or operation between and.
When, which is foreground pixel, and others are background pixels.
3.2. Improved Gaussian Mixture Model
Moving target detection algorithm based on Gaussian mixture model basically set the fixed number of Gaussian distributions for each pixel. In fact, when recently observed pixel values are roughly constant, all of the distributions approximate the same values. In such a case, only one distribution should exist and the other distributions are not necessary at all. On the contrary, if recently observed pixel values change frequently, a constant number of Gaussian is not always enough to estimate the background model, and which is very difficult to determine the appropriate number of Gaussians. Therefore, this paper proposes a new background estimation method, which can increase and decrease the number of distributions to handle the variations of each pixel. The update process of improved Gaussian mixture model is listed as follows:
1) Increment of distribution
Every new pixel value is checked against the existing K Gaussian distributions, when none of the K distribution matches the current pixel value, if, we increase a new Gaussian distribution. Setting the Gaussian distribution of mean, variance, and weights are; if, the least probable distribution is replaced with the current value as its mean value, an initially high variance and low prior weight.
2) Decrement of distribution
In the process of Gaussian mixture model update, if a Gaussian distribution of the current pixel can’t describe the background accurately, its weight will continue to decay according to. Therefore, we can set an initial weight, when a Gaussian distribution satisfies the formula (13). Which indicate that the Gaussian distribution can’t describe background well. And this distribution will affect the convergence rate of the model, therefore, we should delete it.
3) The integrated Gaussian distribution
When the difference between means of two Gaussians (the one is and the other is) is smaller than a threshold, these distributions are integrated into one Gaussian. The integrated Gaussian is calculated as follow
3.3. HSV Color Space Shadow Removal
Shadow is the dark area in which the light source can’t directly irradiate to the surface of the object, and it can be divided into two types: shadows of the object and the cast shadows  . Shadows cause serious problems while segmenting and extracting moving objects due to the misclassification of shadow points as foreground. Usually, we are interested only in the objects and the pixels corresponding to the shadow should be detected. This algorithm works in Hue-Saturation-Value (HSV)  color space. We analyze pixels in HSV color space, the main reasons that HSV color space corresponds closely to the human perception of color and it has revealed more accuracy in distinguishing shadows. In fact, a shadow cast on a background does not change its hue and saturation significantly. However, whether in color or grayscale image, Value component always reflect the useful information of the image. According to this characteristic, this paper proposes a new method of shadow detection. The resulting decision process is reported in the following equation:
where is the Value component at coordinate (x, y) in the input image (frame i) and is the Values component at coordinate (x, y) in the background model, is the value of the Value component of the previous frame. For each pixel belonging to the objects resulting from the segmentation step, we check if it is a shadow according to the formula (17). If, the point is shadow point, others are moving object points. Compared with previous algorithm which judges shadow region just by using change of the value of current frame and background frame, this algorithm increases the change of value between current frame and previous frame, which improves the accuracy of the shadow judging. Moreover, we set the fixed ratio threshold of Value component between the input image and the background model, which improve the processing speed of the algorithm.
4. Experimental Results and Analysis
In this paper, all experiments are performed on windows 7 system with 3.00 GHz Core 4 processor and 4.00 GB of memory. In order to analyze the robustness and effectiveness of the proposed method, four experiments under different conditions are demonstrated in our paper. The results are compared with GMM algorithm and the algorithm  in subjective visual and objective parameters statistics.
Figure 1 shows results of the algorithm in situation of single object and multiple objects. GMM algorithm can’t extract complete object region, and it isn’t sensitivity to low-speed object. Literature  and our algorithm can detect the complete moving targets, but literature  still exist holes phenomenon. However, our algorithm is preferably made up for this shortcoming, and the detection sensitivity to low-speed moving object has improved a lot in the meanwhile.
Figure 2 shows the detection results in shadow scenes. Due to the interference of noise and shadows, the detection result of GMM algorithm isn’t accurate. The algorithm  is only able to remove a portion of shadows. But our method can eliminate the influences of noise and shadow, and retain complete edge and internal information of moving targets.
Figure 3 shows detection results under the illumination change scenes. GMM algorithm can hardly recognize the moving objects, and it exist false detection objects in the result. Literature  is able to detect moving targets. However, as it is affected by illumination mutation, the information of edges and internal details has been seriously damaged. What’s worse, some of small objects can’t be detected. Compared with it, our algorithm can
(a) (b) (c) (d)
Figure 1. Single and multiple object. (a) The original image; (b) GMM algorithm; (c) Algorithm  ; (d) Our algorithm.
(a) (b) (c) (d)
Figure 2. The result of shadow scenes. (a) The original image; (b) GMM algorithm; (c) Algorithm  ; (d) Our algorithm.
(a) (b) (c) (d)
Figure 3. The result of the illumination change scene. (a) The original image; (b) GMM algorithm; (c) Algorithm  ; (d) Our algorithm.
Table 1. The running time for single frame.
Table 2. A comparison of performance of various algorithms (%).
detect the moving objects accurately and completely.
Table 1 presents the processing speed of various algorithms. The image sequence is sampled to. As we can see, the proposed method has better real-time performance than the algorithm  and GMM algorithm. The improved three-frame difference method is used to quickly detect the motion regions, and it can avoid matching detection of pixels which belong to the background. In addition, we reduce the computational complexity of the algorithm by automatically choosing the number of components for each pixel.
In order to systematically evaluate various algorithms, it is useful to identify the following two important quality measures: Recall (also known as detection rate) and Precision (also known as positive prediction)  . They are written as follows
where is the total number of true positives, is the total number of false negatives, is the total number of false positives. Precision reflects the false detection rate, and Recall reflects the accuracy of detection result.
We calculate Recall and Precision of various algorithms, and results are reported in Table 2. The ground truth for each frame is necessary, and we obtain it by segmenting the images with an accurate manual classification of points in foreground and background regions. From the table data, GMM algorithm is easily affected with the scenes change. The proposed algorithm reduces the interference of environmental impact and removes shadow regions. Compared with the algorithm  , our algorithm has improved the rates of Precision and Recall.
This paper proposes an improved moving object detection algorithm based on adaptive Gaussian mixture model and three-frame difference method. The proposed algorithm can automatically select the number of components for each pixel. This modification dramatically improves the convergence and the accuracy of background subtraction whilst maintaining the same temporal adaptability. The three-frame difference method uses adaptive segmentation threshold that can adapt to illumination change scene. In addition, we preserve the complete edge information of moving object by using edge detection technology, and effectively remove the shadow by using HSV color space. Comprehensive analysis of experimental results shows that our algorithm can detect moving objects in the complex scenes effectively and has good robustness.