Moving Objects Segmentation Based on Histogram for Video Surveillance

The detection of moving object is one of the key techniques for video surveillance. In order to extract the moving object robustly in complex background, this paper presents a novel background subtraction method for detecting foreground objects in dynamic scenes. The difference image of color distance between current image and the reference background image in YUV color space is first obtained. According to the mono-modal feature of histogram of the difference image, an adaptive clustering method based on histogram is given. With morphological filtering, the flecks of noise existed in the segmented binary image can be removed. Finally, an updating scheme for background image is introduced to follow the variation of illumination and environmental conditions. Experimental results show that the proposed approach can detect moving objects effectively from video sequences


Introduction
The detecting of moving target in video sequence is of importance in many applications, such as intelligent transportation, safety monitoring, etc.At present, the main existed approaches of moving target detection are background difference, time difference (frame difference) and optical flow.In the past, there have been researchers investigating kinds of methods for segmenting moving objects in real time to achieve these vision-based applications.For example, difference image method was proposed in Anderson, C(1985), and the optical flow technique was introduced in Barron, J(1994).The impact of noise, many light source, shadows (Y.M. Wu, 2002, Wren, C.1997), transparency and shelter reduces the reliability and accuracy of the algorithm which is based on optical flow technology for moving object detection methods.Despite these difficulties, computational complexity and time-consuming further complicate the moving object detection in real-time monitoring (Lipton, A,1998), it is hard to meet real-time requirement without the support of specific hardware devices.Image difference method was divided into the background difference method and the inter-frame difference method.The former algorithm is simple but it lacks a reasonable method for the background update, which changes with illumination and other factors.The latter using the adjacent frame difference can extract information of moving objects, The method is robust to the change of environment, since it assumes that there should be a certain degree of difference of moving speed between target and background, and the information of grey scale or gradient of temporal difference image can be employed to obtain the moving information from the deviation of two or three consecutive frames.but objects of sudden stopping cannot be detected, and this method can not solve the problem of background exposed and the overlapping of moving objects in the adjacent frames.In addition, the current difference method, which didn't make full use of rich color information, is generally limited to two images of the brightness, but color information is indispensable in practical application.
In this paper, a new method is proposed for separating moving objects from current frame.In order to change in time (Yujian, S,2001) with the illumination of background scene, the quick update strategy of reference background image is given.Due to the simplicity of the proposed method, the moving objects can be extracted accurately and quickly.

Determining Color Difference Model
Traditional method of background image subtraction accomplished with background images and the current image in the gray space, because of less information available in gray space, the gray value of the target and background are very closely, fracture and large hole would appear in difference image, which are not conducive to further processing.
Through observation and analysis of many images, the same moving object and background in gray space are the same.Generally, they wouldn't be identical in color space.Thus the color image difference model(D.Wang,2002) was chosen in this paper.RGB color model in the computer field has an important position, which was been widely used in computer graphics and imaging.However, in some image applications, this model is not effective as the former, because all its colors are all isometric pixel R, G, B three colors to be synthesized.This allows each pixel on the three components of the R, G, B has the same pixel depth and display resolution.In addition, related to human visual system, human eyes has a higher sensitivity on the low-frequency6 signals than on high-frequency signal, compared the changes of visibility with color, the former was more sensitive.Therefore, YUV color model was chosen, transform formula is as follows: 0.299 0.587 0.114 0.148 0.289 0.437 0.615 0.515 0.100 color difference mode as follow: k V i j are three values of the pixel in the current frame.The a is an experienced value, which obtained from a large number of experiments, 0.5 is the value of a in the paper.Because of full use of information in the color difference model, the method greatly improves the integrity of the target region.

Segmentation Algorithm
Differential image segmentation algorithms mainly include automatic threshold approach based on class variance, euclidean distance among all instances of different class, the histogram segmentation method and the clustering segmentation method based on the Gaussian model.However, the above methods are all not applicable, if color distance is used as the difference result in the color space.Since automatic threshold segmentation method was most suitable in the bimodal histogram of the image, and the histogram from color distance as shown in Fig. 1 is single-peak form, Gaussian model-based approach is to assume that pixel values of difference image obey the Gaussian distribution, in which there must be the margin of plus or minus.According to (2), the distance value is positive, and negative value does not exist.Thus new segmentation method should be explored.
In Fig. 1, horizontal axis represents the gray value of the image.Vertical axis represents the frequency of occurrence of each gray value.As can be seen from Fig. 1, the histogram shows the characteristics of a single and highly concentrated peak.Single-peak represents the background region.The color difference is not exactly zero, but an interval greater than zero.The upper limit of interval is decided by the width of single-peak.Based on these features, a segmentation algorithm is presented as follows: 1) Find the maximum peak value pf of the difference image histogram and the gray value pc , which is clustering centre of the background region and corresponding to the peak.
2) Seek the width hw of peak.Experiments indicate that peak width corresponding to 0.04 pf * height can achieve more satisfactory segmentation results, and hw could be obtained by the statistics of histogram.Obviously the clustering centre and the clustering radius depend on the single-peak shape of the histogram and change with it, so it has strong adaptive ability.

Morphological Method Dealing with Binary Image
Wind and other factors will lead to changes of elements, such as trees, grass in background, so difference image contains lots of noise.The difference image after binarization still has a lot of useless noise spots in the background and objects.In this paper, Mathematical Morphology (Zhu,Weigang, 2002) is used to carry out post-processing of the segmented binary image.Basic morphological operations include expansion, corrosion, opening, closing, etc.Combined opening and closing can achieve morphological noise filter, which can effectively remove noise spots.Since the scale of morphology filter is fixed, the target region may also have empty holes after segmenting.Area surrounded method is applied to fill the hole of object in order to provide complete moving templates, benefiting to the background update and so on.

Updating Background Strategy
In video surveillance, because of changes of outdoor light and climatic condition, background image(Pascual, J,2006) must have its corresponding update strategy.If no moving object is detected at a fixed time interval, the current frame image substitutes for the background image; otherwise, the background should be updated after segmentation of each moving object.The updated region is obtained from moving templates ahead.The background of current frame can be adapted as follows:

Experimental results
The algorithms discussed above were tested on personal computer with an INTEL Pentium 4 2400 CPU using Microsoft Visual C++6.0.In this paper, all images used were obtained by a general video camera and the size of the image is 320×240.In order to analyze the effectiveness of the proposed method, many experiments under different conditions were performed.Fig. 2 was typical experimental results.The background frame and the current frame are shown in Fig. 2(a) and Fig. 2(b) respectively.The segmentation and morphological filtering results of the algorithms are shown in Fig. 2(c) and Fig. 2(d).At last, an integrated moving object can be seen in Fig. 2(d).The experimental results also shows that the method can segment moving object accurately and quickly.

Conclusion
In this paper, methods of moving objects segmentation based on histogram were proposed to detect moving objects effectively.The method used YUV color model by using (2) to obtain difference image of color distance.Then a histogram could be obtained by statistics of the difference image.The information extracted by algorithm in this paper was used for segmenting moving targets.In particular, the background subtraction was applied to detect image motion, and the algorithm correctly distinguished the changed areas in the scene from the background.Experimental results indicated that the proposed algorithm is simple and effective in segmenting moving objects.Since the background update was performed only in the changed areas where the moving objects occurred too frequently, the computational load is reduced significantly.Moreover, the proposed methods are based on general scenes, so it is suitable for other surveillance sequence.
are three values of the pixel in the background, respectively, and 3) Find clustering radius R .R hw pc = − .4) In accordance with the established clustering centre and clustering radius, clustering starts on the difference image.Suppose any pixel gray value is i p and R i p pc − ≤ , the pixel belongs to background; otherwise, it belongs to moving object.
respectively.i and j are the coordinates.

Figure 1 .
Figure 1.The general shape of the color difference histogram