View Source Evision.BackgroundSubtractorKNN (Evision v0.1.8)
Link to this section Summary
cv
Returns the shadow detection flag
Returns the threshold on the squared distance between the pixel and the sample
Returns the number of last frames that affect the background model
Returns the number of neighbours, the k in the kNN.
Returns the number of data samples in the background model
Returns the shadow threshold
Returns the shadow value
Enables or disables shadow detection
Sets the threshold on the squared distance
Sets the number of last frames that affect the background model
Sets the k in the kNN. How many nearest neighbours need to match.
Sets the number of data samples in the background model.
Sets the shadow threshold
Sets the shadow value
Functions
Raising version of getDetectShadows/1
.
Raising version of getDist2Threshold/1
.
Raising version of getHistory/1
.
Raising version of getkNNSamples/1
.
Raising version of getNSamples/1
.
Raising version of getShadowThreshold/1
.
Raising version of getShadowValue/1
.
Raising version of setDetectShadows/2
.
Raising version of setDist2Threshold/2
.
Raising version of setHistory/2
.
Raising version of setkNNSamples/2
.
Raising version of setNSamples/2
.
Raising version of setShadowThreshold/2
.
Raising version of setShadowValue/2
.
Link to this section cv
Returns the shadow detection flag
If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorKNN for details.
Python prototype (for reference):
getDetectShadows() -> retval
Returns the threshold on the squared distance between the pixel and the sample
The threshold on the squared distance between the pixel and the sample to decide whether a pixel is close to a data sample.
Python prototype (for reference):
getDist2Threshold() -> retval
Returns the number of last frames that affect the background model
Python prototype (for reference):
getHistory() -> retval
Returns the number of neighbours, the k in the kNN.
K is the number of samples that need to be within dist2Threshold in order to decide that that pixel is matching the kNN background model.
Python prototype (for reference):
getkNNSamples() -> retval
Returns the number of data samples in the background model
Python prototype (for reference):
getNSamples() -> 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
Enables or disables shadow detection
Positional Arguments
- detectShadows:
bool
Python prototype (for reference):
setDetectShadows(detectShadows) -> None
Sets the threshold on the squared distance
Positional Arguments
- dist2Threshold:
double
Python prototype (for reference):
setDist2Threshold(_dist2Threshold) -> 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 k in the kNN. How many nearest neighbours need to match.
Positional Arguments
- nkNN:
int
Python prototype (for reference):
setkNNSamples(_nkNN) -> None
Sets the number of data samples in the background model.
Positional Arguments
- nN:
int
The model needs to be reinitalized to reserve memory.
Python prototype (for reference):
setNSamples(_nN) -> 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
Link to this section Functions
Raising version of getDetectShadows/1
.
Raising version of getDist2Threshold/1
.
Raising version of getHistory/1
.
Raising version of getkNNSamples/1
.
Raising version of getNSamples/1
.
Raising version of getShadowThreshold/1
.
Raising version of getShadowValue/1
.
Raising version of setDetectShadows/2
.
Raising version of setDist2Threshold/2
.
Raising version of setHistory/2
.
Raising version of setkNNSamples/2
.
Raising version of setNSamples/2
.
Raising version of setShadowThreshold/2
.
Raising version of setShadowValue/2
.