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

Class ApproximateMedianFilter

source code

AbstractBGModel --+    
                  |    
       MedianFilter --+
                      |
                     ApproximateMedianFilter

Approximates the median pixels via an efficient incremental algorithm that would converge to the true median in a perfect world. It initializes a median image based on the images in the initial image buffer, but then only updates the median image using the last (newest) image in the buffer.

Instance Methods [hide private]
 
__init__(self, imageBuffer, thresh=20, soft_thresh=False) source code
 
_updateMedian(self) 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 MedianFilter (private): _getMedianVals

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)