Class CudaBackgroundSubtractorFGD
Background/Foreground Segmentation Algorithm.
public class CudaBackgroundSubtractorFGD : SharedPtrObject, IDisposable
- Inheritance
-
CudaBackgroundSubtractorFGD
- Implements
- Inherited Members
Constructors
CudaBackgroundSubtractorFGD(int, int, int, int, int, int, bool, int, float, float, float, float, float, float)
Create a Background/Foreground Segmentation model
public CudaBackgroundSubtractorFGD(int Lc = 128, int N1c = 15, int N2c = 25, int Lcc = 64, int N1cc = 25, int N2cc = 40, bool isObjWithoutHoles = true, int performMorphing = 1, float alpha1 = 0.1, float alpha2 = 0.005, float alpha3 = 0.1, float delta = 2, float T = 0.9, float minArea = 15)
Parameters
Lc
intQuantized levels per 'color' component. Power of two, typically 32, 64 or 128.
N1c
intNumber of color vectors used to model normal background color variation at a given pixel.
N2c
intUsed to allow the first N1c vectors to adapt over time to changing background.
Lcc
intQuantized levels per 'color co-occurrence' component. Power of two, typically 16, 32 or 64.
N1cc
intNumber of color co-occurrence vectors used to model normal background color variation at a given pixel.
N2cc
intUsed to allow the first N1cc vectors to adapt over time to changing background.
isObjWithoutHoles
boolIf TRUE we ignore holes within foreground blobs. Defaults to TRUE.
performMorphing
intThese erase one-pixel junk blobs and merge almost-touching blobs. Default value is 1.
alpha1
floatBackground reference image update parameter
alpha2
floatStat model update parameter. 0.002f ~ 1K frame(~45sec), 0.005 ~ 18sec (if 25fps and absolutely static BG)
alpha3
floatstart value for alpha parameter (to fast initiate statistic model)
delta
floatAffects color and color co-occurrence quantization, typically set to 2.
T
floatT
minArea
floatDiscard foreground blobs whose bounding box is smaller than this threshold.
Methods
Apply(IInputArray, IOutputArray, double)
Updates the background model
public void Apply(IInputArray frame, IOutputArray forgroundMask, double learningRate = -1)
Parameters
frame
IInputArrayNext video frame.
forgroundMask
IOutputArrayOutput the current forground mask
learningRate
doubleThe learning rate, use -1.0f for default value.
DisposeObject()
Release all the unmanaged resource associated with this object
protected override void DisposeObject()