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

Class MotionCompensatedFrameDifferencer

source code

AbstractBGModel --+
                  |
                 MotionCompensatedFrameDifferencer

This class represents a more sophisticated frame differencing algorithm that takes into account potential camera motion, and applies a registration method to align subsequent images prior to frame subtraction.

Instance Methods [hide private]
 
__init__(self, imageBuffer, thresh=20, soft_thresh=False) source code
 
_initFlow(self)
Should be called after buffer is full to compute the optical flow information on the buffered frames.
source code
 
getOpticalFlow(self)
Returns: A handle to the pv.OpticalFlow object being used by this object.
source code
 
setOpticalFlow(self, OF_Object)
This is an optional method that allows the user to provide an optical flow object (pv.OpticalFlow) with non-default settings.
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)

_initFlow(self)

source code 

Should be called after buffer is full to compute the optical flow information on the buffered frames. Only needs to be called once, prior to first call of _computeBGDiff(), because from then on, the flow will be updated as new frames are added to the buffer.

getOpticalFlow(self)

source code 
Returns:
A handle to the pv.OpticalFlow object being used by this object.

setOpticalFlow(self, OF_Object)

source code 

This is an optional method that allows the user to provide an optical flow object (pv.OpticalFlow) with non-default settings.

Parameters:
  • OF_Object - The optical flow object desired for use in computing the motion compensated frame difference.

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