Video Background Extraction Using Improved Mean Algorithm and Frame Difference Method

: Background extraction is a crucial step in many automatic video content analysis applications. In this study, we propose new tracking approach by usage of two sequential images in limited period and by giving the specific threshold; then if the difference is greater than the threshold, the extracted image is classified as foreground image while if it is less than the threshold it classified as background. In addition, we propose extraction of background image from video using the improved mean algorithm. The Experimental results proof that the proposed method is fast and no shadow was recorded.


INTRODUCTION
Extraction of background image from a video sequence is a board problem with numerous practical applications include model-based tracking, intelligent transportation System, to human-computer interactions, in addition to that many other applications stipulated by many researchers (Yang et al., 1998;Bazzani et al., 2009). Natural image sequences frequently contain one or more moving objects playing a series of actions in front of a background view that is stationary (Wang and Yung, 2010). More information of the tracked object can be collected from image sequence extracted from video; this information is obviously better than single image. Currently, for the Analysis of video sequences; solvent of many problems in different application systems is utilized, such as video surveillance and access control systems, automatic systems in traffic tracking and other systems (Kravchonok, 2012). The background always showed differed returns with weather and time in the actual monitor control systems. The effect of weather changes is small and the changes occur on the whole image (Fan, 2005).
Definition of Intelligent Transportation System is the means of transport actualize the modernization of Technology Traffic Management Information, like information technology, data and communication technology, automatic control technology and Computer Processing. The rapid development of video technology and detecting of moving objects from image sequences is a fundamental step through the process of Intelligent Transportation System. The results of moving objects detections rule the precision and efficiency of continuous image processing (Meijin et al., 2009). Currently, the Background subtraction algorithm is the most efficient and exact algorithm of moving objects detecting in the field of Intelligent Transportation System with the fixed camera. Apparently, if there is a scene frame free from any moving object in the image sequences, this frame can be used as a background frame to yields pure background image. Still, in the practice, it is relatively hard to extract a pure background image. Thus, in such a system, a critical issue is to extract the pure background image from the videos which include moving objects. Recently classical algorithms of background extraction have included mode algorithm, median algorithm and mean algorithm presented by many researchers (Bondzulic and Petrovic, 2008). Some advanced complex methods had been applied to the background extraction process; Example of these methods is textural and statistical features and genetic algorithm (Yang et al., 2008) however these complex algorithms still far from meet the needs of real-time practical application in Intelligent Transportation System. In recent years, intelligent transportation system becomes a new generation of traffic management systems, which is based on many new technologies, such as computer network, video transmission, image processing, video processing and computer vision (Wu et al., 2012).
This study proposed a new background extraction algorithm; use the mean algorithm and frame difference algorithm. Mean algorithm had an excellent performance in stable environment and complicated environment; the advantage of this method is its successful extraction of background image. In the case of environment in short time had a big change the mean algorithm yields poor performance. Frame Difference algorithm is use by the time difference for two consecutive images by adjusting the threshold to extract an image of the moving area. The steps of the proposed algorithm are as follows: first, we propose new tracking approach by usage of two sequential images in limited period and by giving the specific threshold; then if the difference is greater than the threshold, the extracted image is classified as foreground image while if it is less than the threshold it classified as background. Secondly, if the number of frames is less than 30, we use the average image to compute the initial background. If the number of frames is greater than or equal to 30 the learning rate (α) is used to update the background image calculation.
The exact results are considered limitless approach to the real value of background pixel. Furthermore, proposed method keeps off causes of inaccuracy to join in mean method. Proposed method is compared versus Mode algorithm, Mean algorithm and median algorithm for different experiments. Experimental results show that our method has better efficient and accurate results.

Algorithms:
Frame difference algorithm: Frame difference algorithm is proposed in such consideration: if there is moving object in the video its grey level will changed importantly between two frames as in.
The vantage of this detecting method is it's insensitive of light changing; its accomplished performance in dynamic situation; it is simple operation and it's locating accurately of moving object. So it adapt to high request of real-time application. In this study, we take two image I n (x, y) and, I n+1 (x, y) as the values of pixels at (x, y) in frames t = t n and t = t n+1 . A Simple difference image d (x, y) between these frames are: (1) where, N×M is the image frame dimension.
Using a suitable threshold T on d (x, y) result in a binary image that classifies all pixels into two classifications unchanged background and moving objects (Meijin et al., 2009): (2) Mean algorithm: In Mean algorithm proposed possibility of the pixel being a background is greater than being foreground. In a very small space of time (e.g., 65 frames), the grey level of background will change within a very small range, but the grey level of the foreground objects is vary with each car. The gray color variation within the car is existed and it depends on each part color. Grounded on this assumption, frequently certain value of pixel can be extracted and categorized to be a background image. This algorithm utilizes in 2-D image sequences, for every pixel at (x, y), the corresponding points' values in former N frames are: Compute the sequence of values by applies the mean algorithm and adopt the result as background value of current image, the computing formula of background magnitude is: This study proposed a new method to obtain the value of unchanging background by employing frame difference algorithm and the changed background pixels are estimated through mean algorithm (Meijin et al., 2009). The result from the new method is approximate to real background.

THE PROPOSED METHODOLOGY
The object of this study is to propose a new method to obtain background and foreground image from moving video, because most of the current methods are suffering from slowness of image extraction, the extracted image most of the time featured by shadow, in addition all other methods need more space memory devices. The proposed method is developed depending on mean algorithm; hereinafter we outline the main steps.
Calculate background in this method: For the proposed method if the number of frames is less than 30 we use the average image to compute the initial background. If the number of frames is greater than or equal to 30 the learning rate (α) is used to update the background image computation; the following computing formula is used: This method can real eliminate the deficiency in mean method.
Calculate foreground in this method: Two sequential frames separated by fixed interval, I n (x, y) and I n+1 (x, y), respectively, were converted into grey images for simple and real-time: • Using I n (x, y) and I n + (x, y) through (1), we can get the frame difference image d n (x, y). • Comparing the value of pixels in d n (x, y) to certain Threshold (T2), we determine the foreground according to the Eq.
(2). • The connect components in computed foreground were found then the components with size less than certain threshold were removed.
Through the steps above, the background and foreground can be extracted accurately.

Standard of algorithm comparison:
The performance of the proposed algorithm is achieved by using the Root Mean Square error (RMS) to assess if the background is better or not and average time to asses if the algorithm is fast enough or not.
We should find a pure background frame STBG (x, y) from the video or man-made it for the comparison. The RMS error and average time defined as fellow: (4) (5) time i = The time of the i th frame take.
The smaller the RMS error, the higher efficiency the background image. The smaller RMS error imply that the pixel of background extraction is distributed closer to the real background scene. Conversely, it is worse.
After judge background image; we use Eq. (6) to judge foreground image is better or not: (6) frame i = The frames of the video.
Make Eq. (6) to use binarization where the white pixel is foreground. The white pixel is calculated by Eq. (6) and name COUNT is given to white pixel.
By Comparing the count obtained by different algorithms, if the algorithm has the small count and similar by a certain extent to the original image, it is the best algorithm for background extraction.

EXPERIMENTAL RESULTS
In this section, we show experimental result of the proposed method. The proposed algorithm was implemented in MATLAB. (R2012 b) and tested in windows 8 with Intel (R) core (TM) i7-3632QM CPU @ 2.20 GHz 2.20 GHz with a memory of 4 GB.
The object video sequences come from MATLAB (traffic.mj2) which is publicly available; the size of the video sequences is 120×160 pixels. We have the same experiments of another data and the results showed in Fig. 1. The video is clear. Figure 1a is an original frame in the video. The time of the video is 90 frames. The foreground extract from proposed method as shown in Fig. 2e show no shadow in front of the extracted object, while shadow was notice in foreground extracted using mean, median and mode algorithms.
Based on the standard of comparison (4), (5) and (6) in above section, we calculate the (RMS), count and average time (t) and corresponding to Fig. 1 and 2. The values are showed in Table 1.
The Number of pixels for the extracted foreground image in video 1 was 1054 for the proposed method while it was ranged from 1337 to 1413 for the other methods. This shows clearly that our method is reducing the number pixels in foreground image; because the proposed method is no shadow. The proposed method average time and memory usage are very small compared with current known methods. The reason behind the small average time is that the calculation steps is less than caudation steps used in other method which is deduce that our proposed method is ultrafast.
The object video sequences taken from Wuhan City (luo yu lu road); the size of the video sequences is 480×640 pixels. We have the same experiments of another data and the results showed in Fig. 3. Figure 3a    is an original frame in the video. The time of the video is many frames, but this frame number 82. The background resulted from proposed method had the same RMS as median algorithm and less RMS than Mode and mean algorithms as shown in The foreground extract from proposed method as shown in Fig. 4e show no shadow in front of the extracted object, while shadow was notice in foreground extracted using mean, median and mode algorithms.
Based on the standard of comparison (4), (5) and (6) in above section, we calculate the (RMS), count and average time (t) and corresponding to Fig. 3 and 4. values are showed in Table 2.
The Number of pixels for the extracted foreground image in video 2 was 6990 for the proposed method while it was ranged from 10523 to 13105 for the other is an original frame in the video. The time of the video is many frames, but this frame number 82. The background resulted from proposed method had the same RMS as median algorithm and less RMS than Mode and mean algorithms as shown in Table 2.
The foreground extract from proposed method as show no shadow in front of the t, while shadow was notice in foreground extracted using mean, median and mode Based on the standard of comparison (4), (5) and (6) in above section, we calculate the (RMS), count and Fig. 3 and 4. The The Number of pixels for the extracted foreground image in video 2 was 6990 for the proposed method was ranged from 10523 to 13105 for the other  methods. This shows clearly that our method is reducing the number pixels in foreground image; because the proposed method is no shadow. The proposed method average time and memory usage are very small compared with current known methods. The reason behind the small average time is that the calculation steps is less than caudation steps used in other method which is deduce that our proposed method is ultrafast. The object video sequences taken from Wuhan City (luo yu lu road); the size of the video sequences is 480×640 pixels. We have the same experiments of another data and the results showed in is an original frame in the video. The time of the video is many frames, but this frame number 69.
The background resulted from proposed method had the same RMS as median algorithm and less RMS than Mode and mean algorithms as shown in The foreground extract from proposed method as shown in Fig. 6e show no shadow extracted object, while shadow was notice in foreground extracted using mean, median and mode algorithms.
Based on the standard of comparison (4), (5) and (6) in above section, we calculate the (RMS), count and average time (t) and corresponding to values are showed in Table 3.
The Number of pixels for the extracted foreground image in video 3 was10106 for the proposed method while it was ranged from 10106 to 14566 for the other methods. This shows clearly that our method is reducing the number pixels in foreground image; because the proposed method is no shadow. The proposed method average time and memory usage are very small compared with current known methods. The reason behind the small average time is that the calculation steps is less than caudation steps used in other method which is deduce that our proposed method is ultrafast.

CONCLUSION
In this study, we proposed a new algorithm of video background extraction based using frame difference method and improved mean algorithms. The experimental results of the proposed method in this study are successfully extract background and foreground image. The experimental results show that the proposed method is fast in speed and accurate in the background and foreground; the advantages of no noise and shadow are associated with all extracted images. This shows clearly that our method is reducing the number pixels in foreground image; because the proposed method is no shadow. The proposed method average time and memory usage are very small compared with current known methods. The l average time is that the calculation steps is less than caudation steps used in other method which is deduce that our proposed method The object video sequences taken from Wuhan luo yu lu road); the size of the video sequences is We have the same experiments of results showed in Fig. 5. Figure 5a is an original frame in the video. The time of the video is many frames, but this frame number 69.
The background resulted from proposed method had the same RMS as median algorithm and less RMS than Mode and mean algorithms as shown in Table 3.
The foreground extract from proposed method as shadow in front of the extracted object, while shadow was notice in foreground extracted using mean, median and mode Based on the standard of comparison (4), (5) and (6) in above section, we calculate the (RMS), count and average time (t) and corresponding to Fig. 5 and 6. The The Number of pixels for the extracted foreground image in video 3 was10106 for the proposed method while it was ranged from 10106 to 14566 for the other This shows clearly that our method is number pixels in foreground image; because the proposed method is no shadow. The proposed method average time and memory usage are very small compared with current known methods. The reason behind the small average time is that the s than caudation steps used in other method which is deduce that our proposed method

CONCLUSION
In this study, we proposed a new algorithm of video background extraction based using frame difference method and improved mean algorithms. The experimental results of the proposed method in this study are successfully extract background and ge. The experimental results show that the proposed method is fast in speed and accurate in the the advantages of no noise and shadow are associated with all extracted images.