+ All Categories
Home > Documents > Background Subtraction

Background Subtraction

Date post: 07-Jan-2016
Category:
Upload: landen
View: 110 times
Download: 7 times
Share this document with a friend
Description:
Background Subtraction. Purpose of Background Subtraction. Reduce problem set for further processing Only process part of picture that contains the relevant information Segment the image into foreground and background Add a virtual background. Encountered Problems. Lighting Shadows - PowerPoint PPT Presentation
Popular Tags:
88
1 Background Subtraction
Transcript
Page 1: Background Subtraction

1

Background Subtraction

Page 2: Background Subtraction

2

Purpose of Background Subtraction

Reduce problem set for further processing Only process part of picture that contains the

relevant information Segment the image into foreground and

background Add a virtual background

Page 3: Background Subtraction

3

Encountered Problems Lighting

Shadows Gradual/Sudden illumination changes

Camouflage

Moving objects Foreground aperture

Foreground object becomes motionless

Page 4: Background Subtraction

4

Lighting and Shadows

Weight the luminance with other characteristics Depth of object Region/Frame information

Adjust the background model with time Store a history of previous backgrounds

Page 5: Background Subtraction

5

Page 6: Background Subtraction

Widely Used

6

Page 7: Background Subtraction

Simple Approach

7

Page 8: Background Subtraction

Frame Differencing

8

The accuracy of this approach is dependent on speed of movement in the scene. Faster movements may require higher thresholds

Page 9: Background Subtraction

Frame Differencing

9

This approach will only work for cases where all foreground pixels are moving and all background pixels are static.

Page 10: Background Subtraction

Mean Filter

10

where N is the number of preceding images taken for averaging. This averaging refers to averaging corresponding pixels in the given images.N would depend on the video speed (number of images per second in the video) and the amount of movement in the video.

Page 11: Background Subtraction

Mean Filter

11

Page 12: Background Subtraction

Median Filter

Nathan Johnson 12

Page 13: Background Subtraction

Median Filter

Nathan Johnson 13

Page 14: Background Subtraction

Advantages & Shortcomings

14

Page 15: Background Subtraction

Advantages & Shortcomings

15

Page 16: Background Subtraction

Adaptive Background Mixture Models

16

Page 17: Background Subtraction

Normal Gaussian Distribution

17

As a result, a pixel, once it has become foreground, can only become background again when the intensity value gets close to what it was before turning foreground. This method, however, has several issues: It only works if all pixels are initially background pixels (or foreground pixels are annotated as such).

Page 18: Background Subtraction

Running Gaussian Average

The pdf of every pixel is characterized by mean and variance.

In order to initialize variance, we can, for example, use the variance in x and y from a small window around each pixel.

Note that background may change over time (e.g. due to illumination changes or non-static background objects). To accommodate for that change, at every frame , every pixel's mean and variance must be updated

.18

Page 19: Background Subtraction

Algorithm Overview

19

If a pixel is categorized as foreground for a too long period of time, the background intensity in that location might have changed (because illumination has changed etc.). As a result, once the foreground object is gone, the new background intensity might not be recognized as such anymore.

Page 20: Background Subtraction

Mixture Model

20

Page 21: Background Subtraction

Mixture Model

Nathan Johnson 21

Page 22: Background Subtraction

Model Adaptation

Nathan Johnson 22

Page 23: Background Subtraction

Background Model Estimation

23

Page 24: Background Subtraction

Background Model Estimation

Nathan Johnson 24

Page 25: Background Subtraction

Advantages Vs Shortcomings

25

Page 26: Background Subtraction

Relevant papers

Nathan Johnson 26

Page 27: Background Subtraction

Summary

27

Page 28: Background Subtraction

Selectivity

28

Page 29: Background Subtraction

Selectivity

29

Page 30: Background Subtraction

Limitations (Selectivity)

Nathan Johnson 30

Page 31: Background Subtraction

Kernel Density Estimators

31

Kernel density estimation is a fundamental data smoothing problem where inferences about the population are made, based on a finite samples.Kernel density estimates are closely related to histograms, but can be endowed with properties such as smoothness or continuity by using a suitable kernell.

Page 32: Background Subtraction

Mean- Shift Based Estimation

Page 33: Background Subtraction

Mean Shift Based Estimation

33

Mean shift is a procedure for locating the maxima of density function from given discrete data sampled density function.

The simplest such algorithm would create a confidence map in the new image based on the color histogram of the object in the previous image, and use mean shift to find the peak of a confidence map near the object's old position.

The confidence map is a probability density function on the new image, assigning each pixel of the new image a probability, which is the probability of the pixel color occurring in the object in the previous image.

Page 34: Background Subtraction

Problems & Solutions

34

Page 35: Background Subtraction

Eigen Backgrounds

The method uses the difference between input image and the reconstructed background image to detect foreground objects based on eigenvalue decomposition.

Foreground regions are represented in the reconstructed image using eigenbackground.

As the principle components of a scene are its background in general, the eigenbackgrounds that are used to reconstruct the background depict the characteristics of background. 35

Page 36: Background Subtraction

Eigen- backgrounds

36

Page 37: Background Subtraction

Spatial Correlation

Nathan Johnson 37

Page 38: Background Subtraction

Binary Morphology Binary Morphological techniques probe an

image with a small shape or template called a structuring element.

The structuring element is positioned at all possible locations in the image and it is compared with the corresponding neighbourhood of pixels.

Some operations test whether the element "fits" within the neighbourhood, while others test whether it "hits" or intersects the neighbourhood. 38

Page 39: Background Subtraction

Summary

Nathan Johnson 39

Page 40: Background Subtraction

Summary

Nathan Johnson 40

Page 41: Background Subtraction

Definition of Motion Detection

Action of sensing physical movement in a give area

Motion can be detected by measuring change in speed or vector of an object

41

Page 42: Background Subtraction

42

Motion DetectionGoals of motion detection • Identify moving objects• Detection of unusual activity patterns• Computing trajectories of moving objects

Applications of motion detection • Indoor/outdoor security• Real time crime detection• Traffic monitoringMany intelligent video analysis systems are based on

motion detection.

Page 43: Background Subtraction

43

Two Approaches to Motion Detection Optical Flow

Compute motion within region or the frame as a whole

Change detection Detect objects within a scene Track object across a number of frames

Page 44: Background Subtraction

44

Background Subtraction Uses a reference background image for

comparison purposes. Current image (containing target object) is

compared to reference image pixel by pixel. Places where there are differences are detected

and classified as moving objects.

Motivation: simple difference of two images shows moving objects

Page 45: Background Subtraction

45

a. Original scene b. Same scene later

Subtraction of scene a from scene b Subtracted image with threshold of 100

Page 46: Background Subtraction

46

Static Scene Object Detection and Tracking

Model the background and subtract to obtain object mask

Filter to remove noise Group adjacent pixels to obtain objects Track objects between frames to develop

trajectories

Page 47: Background Subtraction

47

Background Modelling

Page 48: Background Subtraction

48

Background Model

Page 49: Background Subtraction

49

After Background Filtering…

Page 50: Background Subtraction

50

Approaches to Background Modeling Background Subtraction

Statistical Methods (e.g., Gaussian Mixture Model, Stauffer and Grimson 2000)

Background Subtraction:1. Construct a background image B as average of few images2. For each actual frame I, classify individual pixels as

foreground if |B-I| > T (threshold)3. Clean noisy pixels

Page 51: Background Subtraction

51

Background Subtraction

Background Image Current Image

Page 52: Background Subtraction

52

Statistical Methods

Pixel statistics: average and standard deviation of color and gray level values (e.g., W4 by Haritaoglu, Harwood, and Davis 2000)

Gaussian Mixture Model (e.g., Stauffer and Grimson 2000)

Page 53: Background Subtraction

53

Proposed ApproachMeasuring Texture Change

Classical approaches to motion detection are based on background subtraction, i.e., a model of background image is computed, e.g., Stauffer and Grimson (2000)

Our approach does not model any background image.

We estimate the speed of texture change.

Page 54: Background Subtraction

54

In our system we divide video plane in disjoint blocks(4x4 pixels), and compute motion measure for each block.

mm(x,y,t) for a given block location (x,y) is a function of t

Page 55: Background Subtraction

55

8x8 Blocks

Page 56: Background Subtraction

56

Block size relative to image size

Block 24x28

1728 blocks per frame

Image Size:36x48 blocks

Page 57: Background Subtraction

57

Motion Measure Computation We use spatial-temporal blocks to represent

videos Each block consists of NBLOCK x NBLOCK pixels from

3 consecutive frames Those pixel values are reduced to K principal

components using PCA (Kahrunen-Loeve trans.) In our applications, NBLOCK=4, K=10 Thus, we project 48 gray level values to a texture

vector with 10 PCA components

Page 58: Background Subtraction

58

3D Block Projection with PCA (Kahrunen-Loeve trans.)

48-component block vector (4*4*3)

-0.5221 -0.0624 -0.1734 -0.2221 -0.2621 -0.4739 -0.4201 -0.4224 -0.0734 -0.1386

10 principal components

t+1 tt-1

4*4*3 spatial-temporal blockLocation I=24, J=28,time t-1, t, t+1

Motion Measure Computation

Page 59: Background Subtraction

59

Texture of spatiotemporal blocks works better than color pixel values

More robust Faster

We illustrate this with texture trajectories.

Page 60: Background Subtraction

60

499 624

863 1477

Page 61: Background Subtraction

61

Detection of Moving Objects Based on Local Variation

For each block location (x,y) in the video plane• Consider texture vectors in a symmetric window [t-

W, t+W] at time t• Compute the covariance matrix• Motion measure is defined as

the largest eigenvalue of the covariance matrix

Page 62: Background Subtraction

Background Subtraction and Matting

Page 63: Background Subtraction

Image Stack

As can look at video data as a spatio-temporal volume If camera is stationary, each line through time

corresponds to a single ray in space We can look at how each ray behaves What are interesting things to ask?

t0

255time

Page 64: Background Subtraction

Background Subtraction A largely unsolved problem…

Estimatedbackground

Difference Image

ThresholdedForeground on blue

One videoframe

Page 65: Background Subtraction

How does Superman fly?

Super-human powers?

OR Image Matting and Compositing?

Page 66: Background Subtraction

Compositing Procedure

1. Extract Sprites (e.g using Intelligent Scissors in Photoshop)

2. Blend them into the composite (in the right order)

Page 67: Background Subtraction

Multiple Alpha Blending So far we assumed that one image

(background) is opaque. If blending semi-transparent sprites (the “A

over B” operation):

Icomp = aIa + (1-a)bIb

comp = a + (1-a)b

Note: sometimes alpha is premultiplied: im(R,G,B,):

Icomp = Ia + (1-a)Ib

(same for alpha!)

Page 68: Background Subtraction

“Pulling a Matte” Problem Definition:

The separation of an image C into A foreground object image Co,

a background image Cb, and an alpha matte

Co and can then be used to composite the foreground object into a different image

Hard problem Even if alpha is binary, this is hard to do automatically

(background subtraction problem) For movies/TV, manual segmentation of each frame is

infeasible Need to make a simplifying assumption…

Page 69: Background Subtraction

Blue Screen

Page 70: Background Subtraction

Blue Screen matting

Most common form of matting in TV studios & movies

A form of background subtraction: Need a known background Compute alpha as SSD(C,Cb) > threshold

Or use Vlahos’ formula: = 1-p1(B-p2G)

Hope that foreground object doesn’t look like background no blue ties!

Why blue? Why uniform?

Page 71: Background Subtraction

The Ultimatte

p1 and p2

Page 72: Background Subtraction

Blue screen for superman?

Page 73: Background Subtraction

Semi-transparent mattes

What we really want is to obtain a true alpha matte, which involves semi-transparency Alpha between 0 and 1

Page 74: Background Subtraction

Matting Problem: Mathematical Definition

Page 75: Background Subtraction

Why is general matting hard?

Page 76: Background Subtraction

Solution #1: No Blue!

Page 77: Background Subtraction

More examples

Page 78: Background Subtraction

Removing Shadows (Weiss, 2001)

How does one detect (subtract away) shadows?

Page 79: Background Subtraction

Averaging Derivatives

Page 80: Background Subtraction

Recovering Shadows

Page 81: Background Subtraction

Compositing with Shadows

Page 82: Background Subtraction

Outline

• Applications of segmentation to video• Motion and perceptual organization• Motion field• Optical flow• Motion segmentation with layers

Page 83: Background Subtraction

Video• A video is a sequence of frames captured

over time• Now our image data is a function of space

(x, y) and time (t)

Page 84: Background Subtraction

Applications of segmentation to video

• Background subtraction A static camera is observing a scene Goal: separate the static background from the

moving foreground

Page 85: Background Subtraction

Applications of segmentation to video

• Background subtraction Form an initial background estimate For each frame:

Update estimate using a moving average Subtract the background estimate from the frame Label as foreground each pixel where the magnitude

of the difference is greater than some threshold Use median filtering to “clean up” the results

Page 86: Background Subtraction

Applications of segmentation to video

• Background subtraction• Shot boundary detection

Commercial video is usually composed of shots or sequences showing the same objects or scene

Goal: segment video into shots for summarization and browsing (each shot can be represented by a single keyframe in a user interface)

Difference from background subtraction: the camera is not necessarily stationary

Page 87: Background Subtraction

Motion and perceptual organization

• Sometimes, motion is the only cue

Page 88: Background Subtraction

Motion estimation techniques• Direct methods

Directly recover image motion at each pixel from spatio-temporal image brightness variations

Dense motion fields, but sensitive to appearance variations

Suitable for video and when image motion is small

• Feature-based methods Extract visual features (corners, textured areas) and track

them over multiple frames Sparse motion fields, but more robust tracking Suitable when image motion is large (10s of pixels)


Recommended