Click or drag to resize

BackgroundSubtractorKNN Class

http://www.emgu.com
K-nearest neighbors - based Background/Foreground Segmentation Algorithm.
Inheritance Hierarchy

Namespace:  Emgu.CV
Assembly:  Emgu.CV.World (in Emgu.CV.World.dll) Version: 4.1.1.3497 (4.1.1.3497)
Syntax
public class BackgroundSubtractorKNN : UnmanagedObject, 
	IBackgroundSubtractor, IAlgorithm

The BackgroundSubtractorKNN type exposes the following members.

Constructors
  NameDescription
Public methodBackgroundSubtractorKNN
Create a K-nearest neighbors - based Background/Foreground Segmentation Algorithm.
Top
Properties
  NameDescription
Public propertyAlgorithmPtr
Pointer to the unmanaged Algorithm object
Public propertyBackgroundSubtractorPtr
Pointer to the unmanaged BackgroundSubtractor object
Public propertyDetectShadows
If true, the algorithm detects shadows and marks them.
Public propertyDist2Threshold
The threshold on the squared distance between the pixel and the sample to decide whether a pixel is close to a data sample.
Public propertyHistory
The number of last frames that affect the background model
Public propertyKNNSamples
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 pixel is matching the kNN background model.
Public propertyNSamples
The number of data samples in the background model
Public propertyPtr
Pointer to the unmanaged object
(Inherited from UnmanagedObject.)
Public propertyShadowThreshold
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.
Public propertyShadowValue
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.
Top
Methods
  NameDescription
Public methodDispose
The dispose function that implements IDisposable interface
(Inherited from DisposableObject.)
Protected methodDisposeObject
Release all the unmanaged memory associated with this background model.
(Overrides DisposableObjectDisposeObject.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize
Destructor
(Inherited from DisposableObject.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodReleaseManagedResources
Release the managed resources. This function will be called during the disposal of the current object. override ride this function if you need to call the Dispose() function on any managed IDisposable object created by the current object
(Inherited from DisposableObject.)
Public methodToString (Inherited from Object.)
Top
Fields
  NameDescription
Protected field_ptr
A pointer to the unmanaged object
(Inherited from UnmanagedObject.)
Top
Extension Methods
  NameDescription
Public Extension MethodApply
Update the background model
(Defined by BackgroundSubtractorExtension.)
Public Extension MethodClear
Clear the algorithm
(Defined by AlgorithmExtensions.)
Public Extension MethodGetBackgroundImage
Computes a background image.
(Defined by BackgroundSubtractorExtension.)
Public Extension MethodGetDefaultName
Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.
(Defined by AlgorithmExtensions.)
Public Extension MethodIsEmpty
Returns true if the Algorithm is empty. e.g. in the very beginning or after unsuccessful read.
(Defined by AlgorithmExtensions.)
Public Extension MethodLoad
Loads algorithm from the file
(Defined by AlgorithmExtensions.)
Public Extension MethodLoadFromString
Loads algorithm from a String
(Defined by AlgorithmExtensions.)
Public Extension MethodRead
Reads algorithm parameters from a file storage.
(Defined by AlgorithmExtensions.)
Public Extension MethodSave
Save the algorithm to file
(Defined by AlgorithmExtensions.)
Public Extension MethodSaveToString
Save the algorithm to a string
(Defined by AlgorithmExtensions.)
Public Extension MethodWrite(FileStorage)Overloaded.
Stores algorithm parameters in a file storage
(Defined by AlgorithmExtensions.)
Public Extension MethodWrite(FileStorage, String)Overloaded.
Stores algorithm parameters in a file storage
(Defined by AlgorithmExtensions.)
Top
See Also