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

Class AbstractBGModel

source code

Known Subclasses:

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
 
getForegroundMask(self)
Returns: A mask image indicating which pixels are considered foreground.
source code
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.

getForegroundMask(self)

source code 
Returns:
A mask image indicating which pixels are considered foreground. Depending on whether soft-thresholding is used, this may be a binary image with values of [0 or 255], or image of weights [0.0-255.0], which will have to be divided by 255 to get weights [0.0-1.0].

Note: One may wish to perform additional morphological operations on the foreground mask prior to use.