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

Class MedianFilter

source code

AbstractBGModel --+
                  |
                 MedianFilter
Known Subclasses:

Uses median pixel values of the images in a buffer to approximate a background model.

Instance Methods [hide private]
 
__init__(self, imageBuffer, thresh=20, soft_thresh=False) source code
 
_getMedianVals(self)
Returns: A scipy matrix representing the gray-scale median values of the image stack.
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)

_getMedianVals(self)

source code 
Returns:
A scipy matrix representing the gray-scale median values of the image stack. If you want a pyvision image, just wrap the result in pv.Image(result).

_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)