View Source Evision.BackgroundSubtractorMOG2 (Evision v0.1.8)
Link to this section Summary
cv
Computes a foreground mask.
Computes a foreground mask.
Returns the "background ratio" parameter of the algorithm
Returns the complexity reduction threshold
Returns the shadow detection flag
Returns the number of last frames that affect the background model
Returns the number of gaussian components in the background model
Returns the shadow threshold
Returns the shadow value
Returns the initial variance of each gaussian component
Python prototype (for reference):
Python prototype (for reference):
Returns the variance threshold for the pixel-model match
Returns the variance threshold for the pixel-model match used for new mixture component generation
Sets the "background ratio" parameter of the algorithm
Sets the complexity reduction threshold
Enables or disables shadow detection
Sets the number of last frames that affect the background model
Sets the number of gaussian components in the background model.
Sets the shadow threshold
Sets the shadow value
Sets the initial variance of each gaussian component
Positional Arguments
- varMax:
double
Python prototype (for reference):
Positional Arguments
- varMin:
double
Python prototype (for reference):
Sets the variance threshold for the pixel-model match
Sets the variance threshold for the pixel-model match used for new mixture component generation
Functions
Raising version of apply/2
.
Raising version of apply/3
.
Raising version of getBackgroundRatio/1
.
Raising version of getComplexityReductionThreshold/1
.
Raising version of getDetectShadows/1
.
Raising version of getHistory/1
.
Raising version of getNMixtures/1
.
Raising version of getShadowThreshold/1
.
Raising version of getShadowValue/1
.
Raising version of getVarInit/1
.
Raising version of getVarMax/1
.
Raising version of getVarMin/1
.
Raising version of getVarThreshold/1
.
Raising version of getVarThresholdGen/1
.
Raising version of setBackgroundRatio/2
.
Raising version of setComplexityReductionThreshold/2
.
Raising version of setDetectShadows/2
.
Raising version of setHistory/2
.
Raising version of setNMixtures/2
.
Raising version of setShadowThreshold/2
.
Raising version of setShadowValue/2
.
Raising version of setVarInit/2
.
Raising version of setVarMax/2
.
Raising version of setVarMin/2
.
Raising version of setVarThreshold/2
.
Raising version of setVarThresholdGen/2
.
Link to this section cv
Computes a foreground mask.
Positional Arguments
image:
Evision.Mat
.Next video frame. Floating point frame will be used without scaling and should be in range \f$[0,255]\f$.
Keyword Arguments
learningRate:
double
.The value between 0 and 1 that indicates how fast the background model is learnt. Negative parameter value makes the algorithm to use some automatically chosen learning rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
Return
fgmask:
Evision.Mat
.The output foreground mask as an 8-bit binary image.
Python prototype (for reference):
apply(image[, fgmask[, learningRate]]) -> fgmask
Computes a foreground mask.
Positional Arguments
image:
Evision.Mat
.Next video frame. Floating point frame will be used without scaling and should be in range \f$[0,255]\f$.
Keyword Arguments
learningRate:
double
.The value between 0 and 1 that indicates how fast the background model is learnt. Negative parameter value makes the algorithm to use some automatically chosen learning rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
Return
fgmask:
Evision.Mat
.The output foreground mask as an 8-bit binary image.
Python prototype (for reference):
apply(image[, fgmask[, learningRate]]) -> fgmask
Returns the "background ratio" parameter of the algorithm
If a foreground pixel keeps semi-constant value for about backgroundRatio*history frames, it's considered background and added to the model as a center of a new component. It corresponds to TB parameter in the paper.
Python prototype (for reference):
getBackgroundRatio() -> retval
Returns the complexity reduction threshold
This parameter defines the number of samples needed to accept to prove the component exists. CT=0.05 is a default value for all the samples. By setting CT=0 you get an algorithm very similar to the standard Stauffer&Grimson algorithm.
Python prototype (for reference):
getComplexityReductionThreshold() -> retval
Returns the shadow detection flag
If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorMOG2 for details.
Python prototype (for reference):
getDetectShadows() -> retval
Returns the number of last frames that affect the background model
Python prototype (for reference):
getHistory() -> retval
Returns the number of gaussian components in the background model
Python prototype (for reference):
getNMixtures() -> retval
Returns the shadow threshold
A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiara, Detecting Moving Shadows...*, IEEE PAMI,2003.
Python prototype (for reference):
getShadowThreshold() -> retval
Returns the shadow value
Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0 in the mask always means background, 255 means foreground.
Python prototype (for reference):
getShadowValue() -> retval
Returns the initial variance of each gaussian component
Python prototype (for reference):
getVarInit() -> retval
Python prototype (for reference):
getVarMax() -> retval
Python prototype (for reference):
getVarMin() -> retval
Returns the variance threshold for the pixel-model match
The main threshold on the squared Mahalanobis distance to decide if the sample is well described by the background model or not. Related to Cthr from the paper.
Python prototype (for reference):
getVarThreshold() -> retval
Returns the variance threshold for the pixel-model match used for new mixture component generation
Threshold for the squared Mahalanobis distance that helps decide when a sample is close to the existing components (corresponds to Tg in the paper). If a pixel is not close to any component, it is considered foreground or added as a new component. 3 sigma => Tg=3*3=9 is default. A smaller Tg value generates more components. A higher Tg value may result in a small number of components but they can grow too large.
Python prototype (for reference):
getVarThresholdGen() -> retval
Sets the "background ratio" parameter of the algorithm
Positional Arguments
- ratio:
double
Python prototype (for reference):
setBackgroundRatio(ratio) -> None
Sets the complexity reduction threshold
Positional Arguments
- ct:
double
Python prototype (for reference):
setComplexityReductionThreshold(ct) -> None
Enables or disables shadow detection
Positional Arguments
- detectShadows:
bool
Python prototype (for reference):
setDetectShadows(detectShadows) -> None
Sets the number of last frames that affect the background model
Positional Arguments
- history:
int
Python prototype (for reference):
setHistory(history) -> None
Sets the number of gaussian components in the background model.
Positional Arguments
- nmixtures:
int
The model needs to be reinitalized to reserve memory.
Python prototype (for reference):
setNMixtures(nmixtures) -> None
Sets the shadow threshold
Positional Arguments
- threshold:
double
Python prototype (for reference):
setShadowThreshold(threshold) -> None
Sets the shadow value
Positional Arguments
- value:
int
Python prototype (for reference):
setShadowValue(value) -> None
Sets the initial variance of each gaussian component
Positional Arguments
- varInit:
double
Python prototype (for reference):
setVarInit(varInit) -> None
Positional Arguments
- varMax:
double
Python prototype (for reference):
setVarMax(varMax) -> None
Positional Arguments
- varMin:
double
Python prototype (for reference):
setVarMin(varMin) -> None
Sets the variance threshold for the pixel-model match
Positional Arguments
- varThreshold:
double
Python prototype (for reference):
setVarThreshold(varThreshold) -> None
Sets the variance threshold for the pixel-model match used for new mixture component generation
Positional Arguments
- varThresholdGen:
double
Python prototype (for reference):
setVarThresholdGen(varThresholdGen) -> None
Link to this section Functions
Raising version of apply/2
.
Raising version of apply/3
.
Raising version of getBackgroundRatio/1
.
Raising version of getComplexityReductionThreshold/1
.
Raising version of getDetectShadows/1
.
Raising version of getHistory/1
.
Raising version of getNMixtures/1
.
Raising version of getShadowThreshold/1
.
Raising version of getShadowValue/1
.
Raising version of getVarInit/1
.
Raising version of getVarMax/1
.
Raising version of getVarMin/1
.
Raising version of getVarThreshold/1
.
Raising version of getVarThresholdGen/1
.
Raising version of setBackgroundRatio/2
.
Raising version of setComplexityReductionThreshold/2
.
Raising version of setDetectShadows/2
.
Raising version of setHistory/2
.
Raising version of setNMixtures/2
.
Raising version of setShadowThreshold/2
.
Raising version of setShadowValue/2
.
Raising version of setVarInit/2
.
Raising version of setVarMax/2
.
Raising version of setVarMin/2
.
Raising version of setVarThreshold/2
.
Raising version of setVarThresholdGen/2
.