Vibe algorithm principle and code analysis

Source: Internet
Author: User

Vibe-a powerful technique for background detection and subtraction in video sequences

Judge Net: http://www2.ulg.ac.be/telecom/research/vibe/


Description

Vibe is a pixel-level video background modeling or foreground detection algorithm, the effect is better than the well-known algorithms, the hardware memory footprint is less. Vibe is a pixel-level background modeling and foreground detection algorithm, the main difference is the update strategy of the background model, random selection of pixels to replace the sample, random selection of neighborhood pixels to update. When the model of pixel change cannot be determined, the stochastic updating strategy can simulate the uncertainty of pixel change to some extent.


The challenge of the background difference method to realize moving object detection mainly includes:

Can be directly used in the product, software and hardware compatibility is good;

Must adapt to the changes in the environment (such as the changes in the illumination of the image color changes);

Camera jitter causes the image to wobble (such as hand-held camera when taking pictures of the movement);

Images of dense objects (such as leaves or tree trunks, such as dense objects, to be properly detected);

Must be able to correctly detect the changes in the background object (for example, the newly parked car must be in time to be classified as a background object, and the static start moving objects also need to be detected in a timely manner).


The object detection often appears ghost area, Ghost area is to refer to when a originally static object starts to move, the back static error detection algorithm may the original object covers the area error detection as the movement, this area becomes the ghost, Of course the original movement of the object into a static will also be introduced into the Ghost region, ghost area in the detection must be eliminated as soon as possible. An example of a ghost region, such as Figure fig.1, can be found in the figure, compared to the original image, the detection results of more than two people in the wrong shape, this is ghost.


Fig 1

Vibe algorithm Detailed:

Vibe Detection Method

Vibe is a test method presented in this paper, which has many differences and advantages compared with other methods. The specific idea is to store a sample set for each pixel, the sampled value is the pixel value of the pixel in the past and the pixels of its neighbor, and then compare each new pixel value and the sample set to determine whether it belongs to the background point. The model mainly includes three aspects: the working principle of the model, the initialization method of the model, and the updating strategy of the model.

The working principle of the model

A background object is a stationary or very slow moving object, and the foreground object corresponds to the moving object. So we can see the object detection a classification problem, that is, to determine whether a pixel is a background point. In the vibe model, the background model stores a sample set for each background point, and then compares each new pixel value with a sample set to determine whether it belongs to a background point. You can tell if a new observation is a background point then it should be closer to the sampled value in the sample set.

Specifically, we remember V (x): The pixel value at x point; M (x) ={v1,v2,... VN} is the background sample set at x (the sample set size is n); SR (v (x)): An area with a radius of x centered R, if m (x) [{SR (V (x)) ∩{v1,v2, ..., VN}}] is greater than a given threshold #min, then the X point is considered to be a background point.

initialization of the background model

Initialization is the process of establishing the background model, the general detection algorithm needs a certain length of the video sequence learning complete, affecting the real-time detection, and when the video scene suddenly changes, it takes a long time to learn the background model.

The vibe algorithm mainly uses the single frame video sequence initialization background model, for a pixel point, unifies the neighboring pixel point to have the similar pixel value the spatial distribution characteristic, randomly chooses its neighborhood point the pixel value as its model sample value. The initialization of vibe is done only through a single frame of image. Vibe initialization is the process of populating a sample set of pixels, but since it is not possible to include the temporal and spatial distribution of pixels in a single frame of image, we use similar pixel points have similar space-time distribution characteristics, specifically: for a pixel, randomly select its neighbor point of the pixel value as its model sample value. M0 (x) = {V0 (y | y∈ng (x))},t=0 The initial moment, NG (x) is the neighbor point. The advantage of this initialization method is that the response of the noise is more sensitive, the calculation is small and fast, it can quickly detect the moving object, the disadvantage is that it is easy to introduce the ghost area.

Advantages: Not only reduce the process of setting up the background model, but also deal with the sudden change of background, when the background is detected suddenly, only the original model should be discarded, and the background model should be established by using the changed first frame image.

Disadvantage: Because it is possible to use the pixel initialization sample set of moving object, it is easy to introduce the drag Shadow (Ghost) region.

Foreground detection Process

The background model stores a sample set for each background point, and then each new pixel value and sample set are compared to determine whether it belongs to the background.

Calculates the distance between the new pixel value and each sample value in the sample set, and the approximate number of sample points increases if the distance is less than the threshold value.

If the approximate number of sample points is greater than the threshold, the new pixel point is considered to be the background.

The detection process is mainly determined by three parameters: the number of sample sets N, Threshold #min and the threshold R of proximity judgment, General concrete implementation, parameter set to N=20, #min =2,r=20.

  

Update strategy for background model

The update of the background model is to make the background model adapt to the changing background, such as illumination change, background object change and so on. Conservative update policy: The former sights will never be used to populate the background model, causing deadlocks, such as when initializing a stationary region that is incorrectly detected as moving, it will always be treated as a moving object; blind policy: Insensitive to deadlocks, The foreground background can be used to update the background model, the disadvantage is that the slow moving object will be integrated into the background can not be detected. The update strategy used in this method is the conservative update Strategy + the former attraction counting method. Pre-attraction count: The pixel is counted, and if a pixel is continuously detected as the foreground, it is updated to the background point.

Random sub-sampling: it is not necessary to update the sample values of each pixel in the background model in each new video frame, when a pixel is classified as a background point, it has 1/φ probability to update the background model.

The specific Update method: Each background point has the 1/φ probability to update its own model sample value, but also has the 1/φ probability to update its neighbor Point model sample value. Updating the neighbor's sample value the spatial propagation characteristic of pixel value is used, and the background model spreads out gradually, which also facilitates the faster recognition of ghost region. At the same time, when the current scenic spot count reaches the critical value, it turns it into a background, and has the 1/φ probability to update its model sample value.

When selecting a sample value in the sample set to be replaced, we randomly select a sample value to update it to ensure that the smooth life cycle of the sample value is due to a random update, so that a sample value in the moment T is not updated probability is (N-1)/n, assuming that the time is continuous, then after the time of DT, The probability that the sample value is still retained is

can also write,

This indicates whether a sample value is replaced in the model with time t, and the stochastic strategy is appropriate.

1). No Memory update strategy

Each time a background model is determined to update the pixel, a sample value of the pixel sample set is randomly replaced with the new pixel value.

2). Time Sampling Update Strategy

Not every processing of a frame of data, all need to update processing, but according to a certain update rate update the background model. When a pixel is judged as a background, it has a 1/rate probability update background model. Rate is a time sampling factor, the general value is 16.

3). Spatial Neighborhood Renewal Strategy

In order to update the pixel, the background model of the neighborhood of the pixel is randomly selected, and the selected background model is updated with the new pixel point.

Improvement of Vibe

  

1). Distance calculation method

A method for calculating the geometric distance of a circular vertebral model instead of the original

  

The threshold value is proportional to the variance of the sample set, and the greater the variance of the sample set, the more complex the background is, the greater the threshold should be.

  

2). Separation of updating mask and segmentation mask

The concept of target whole is introduced to make up for the deficiency of the foreground detection based on pixel level. Aiming at the updating mask and segmentation mask, the morphological processing method of different sizes was adopted to improve the accuracy of detection.

3). Suppression of Neighborhood updates

In updating mask, the gradient of the pixel is computed and the neighborhood is updated according to the gradient size. The larger the gradient value, the greater the change in pixel values, indicating that the pixel value may be the foreground and should not be updated.

4). Detect blinking pixel points

Introducing the concept of flicker, when the updating label of a pixel is not the same as the updating label of the previous frame, the blinking level is increased by 15, otherwise it is reduced by 1 and then the pixel is a blinking point according to the size of the blinking level. Flashing pixels are mainly found in background complex scenes, such as leaves, veins, and so on, these scenes will have a pixel background and the frequent changes in the foreground, so for these flashes should be handled separately, can be used as a whole background.

5). Increase the update factor

Vibe algorithm, the default update factor is 16, when the background changes quickly, the background model can not be quickly updated, will lead to more errors in the foreground detection. Therefore, according to the background changes in the degree of speed, adjust the size of the update factor, update factors can be divided into multiple levels, such as rate = 16,rate = 5,rate = 1.


Vibe Experimental Results

In the experiment, we and other detection algorithms in the detection accuracy and calculation of algorithms are compared, the experiment shows that our method detection effect is much better, for the light changes and camera jitter, and so the effect is very stable, and the calculation is very small, memory footprint is less, This allows the method to be embedded in a handheld camera. Some specific experimental results and data are as follows

Comparison of fig.2 detection effect


The movement of the Fig.3 camera


Fig.4 Ghost area ablation, bright floors in the picture


fig.5 detection accuracy rate fig.6 algorithm processing speed

Summary

In this article, we propose a new-vibe algorithm, which has three different points than before. First, we propose a new classification model. Second, we describe how the vibe initialization, which requires only one frame of image to complete initialization, while other algorithms usually need to wait a few seconds to complete initialization, which is very useful for embedding the camera's requirements in real-time and some relatively short video sequences. Finally, we propose our own update strategy, compared to other algorithms to keep the sample value in the model for a fixed time, we use a random replacement to update the sample value, proved to be able to ensure that the sample value of an exponential attenuation of the smooth life cycle, and can make the background model well adapted to the video scene changes, So as to achieve better detection effect.

Through a series of experiments, it is shown that the Vibe method has a small computational capacity compared to some other detection algorithms. Low memory footprint, fast processing speed, good detection effect, faster ghost area ablation speed and reliable noise stability, and ideal for embedding cameras in situations where the computational load is small and memory footprint is low.

Effect Chart:



Code

Algorithm execution Efficiency test program, Windows and Linux operating system under the program and C/COM + + files can be downloaded from the author's website, as follows:

Windows and Linux users:a Benchmarking program to evaluate the time needed from ViBe on your platform and on your own s equences! Download an archive zip archive [MB] to evaluate the time needed from ViBe on your platform (Windows or Linux [Wine] ), and on your own sequences. A Program for Windows and Linux. Download an archive zip archive [MB] to use ViBe on Windows (or under Wine in Linux).
The program allows to: (1) Save the result for your own images, (2) Change the few parameters of ViBe to experiment WI Th, and (3) reproduce our results. Linux:link A C + + object file to your own code. We provide the object (compiled) code of VIBE for non-commercial applications. Under Linux, download the32 bits zip file, or the "bits zip file." Details on this page. We should follow the license of the judge net when using the VIBE algorithm. The main advantages of the algorithm: less memory footprint, one pixel needs to make a comparison, occupy a byte of memory;

No parameter method;

Performance is superior to mixed Gaussian, parametric method, Sacon, etc.

Pixel level algorithm, the key steps of preprocessing in video processing;

The background model is initialized in time.

It has good ability of resisting noise.


Reference documents:

O. Barnich and M. Van Droogenbroeck. vibe:a Universal Background subtraction algorithmfor video sequences. In the IEEE transactions on Image Processing (6): 1709-1724, June 2011. Also available on the University site in PDF format:, and HTML format.  This paper contains a very detailed pseudo-codedescription of the complete. M. Van Droogenbroeck and O. Paquot. Background subtraction:experiments and improvements for ViBe. In the change Detection Workshop (CDW), Providence, Rhode Island, June 2012. Available on the University site in PDF format:, and

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.