Package pyvision :: Package surveillance :: Module BackgroundSubtraction :: Class FrameDifferencer
[hide private]
[frames] | no frames]

Class FrameDifferencer

source code

AbstractBGModel --+
                  |
                 FrameDifferencer

This class is useful for simple N-frame differencing method of background subtraction. If you have a stationary camera, this can be a simple and effective way to isolate people/moving objects from the background scene.

FrameDifferencer uses ImageBuffer for operation. Assume the buffer size is 5. The output of the frame differencing operation will be based on the middle image, the 3rd in the buffer. The output is the intersection of the following two absolute differences: abs(Middle-First) AND abs(Last-Middle).

Instance Methods [hide private]
 
__init__(self, imageBuffer, thresh=20, soft_thresh=False) source code
 
_computeBGDiff(self)
This private method should be overridden by a concrete background subtraction class to yield a difference image from the background model.
source code

Inherited from AbstractBGModel: getForegroundMask

Method Details [hide private]

__init__(self, imageBuffer, thresh=20, soft_thresh=False)
(Constructor)

source code 
Parameters:
  • imageBuffer - An ImageBuffer object that has already been filled with the appropriate number of images. (Provide a full buffer...so a few frames of initialization will be required in most cases to fill up a newly created buffer.)
  • thresh - A noise threshold to remove very small differences.
Overrides: AbstractBGModel.__init__
(inherited documentation)

_computeBGDiff(self)

source code 

This private method should be overridden by a concrete background subtraction class to yield a difference image from the background model.

Overrides: AbstractBGModel._computeBGDiff
(inherited documentation)