Understanding background subtraction

Background subtraction is very useful in video surveillance. Basically, the background subtraction technique performs really well in cases where we have to detect moving objects in a static scene. How is this useful for video surveillance? The process of video surveillance involves dealing with constant data flow. The data stream keeps coming in and we need to analyze it to recognize any suspicious activity. Let's consider the example of a hotel lobby. All the walls and furniture have a fixed location. If we build a background model, we can use it to identify suspicious activity in the lobby. We are taking advantage of the fact that the background scene remains static (which happens to be true in this case). This helps us avoid any unnecessary computational overhead. As the name indicates, this algorithm works by detecting and assigning each pixel of an image to two classes, either the background (assumed static and stable) or the foreground, and subtracting it from the current frame to obtain the foreground image part, which includes moving objects such as persons, cars, and so on. With the static assumption, the foreground objects will naturally correspond to objects or people moving in front of the background.

In order to detect moving objects, we need to build a model of the background. This is not the same as direct frame differencing, because we are actually modeling the background and using this model to detect moving objects. When we say that we are modeling the background, we are basically building a mathematical formula that can be used to represent the background. This is much better than the simple frame-differencing technique. This technique tries to detect static parts of the scene and then include small updates in the build statistic formula of the background model. This background model is then used to detect background pixels. So, it's an adaptive technique that can adjust according to the scene.