Table of Contents

Class CudaBackgroundSubtractorFGD

Namespace
Emgu.CV.Cuda
Assembly
Emgu.CV.dll

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 int

Quantized levels per 'color' component. Power of two, typically 32, 64 or 128.

N1c int

Number of color vectors used to model normal background color variation at a given pixel.

N2c int

Used to allow the first N1c vectors to adapt over time to changing background.

Lcc int

Quantized levels per 'color co-occurrence' component. Power of two, typically 16, 32 or 64.

N1cc int

Number of color co-occurrence vectors used to model normal background color variation at a given pixel.

N2cc int

Used to allow the first N1cc vectors to adapt over time to changing background.

isObjWithoutHoles bool

If TRUE we ignore holes within foreground blobs. Defaults to TRUE.

performMorphing int

These erase one-pixel junk blobs and merge almost-touching blobs. Default value is 1.

alpha1 float

Background reference image update parameter

alpha2 float

Stat model update parameter. 0.002f ~ 1K frame(~45sec), 0.005 ~ 18sec (if 25fps and absolutely static BG)

alpha3 float

start value for alpha parameter (to fast initiate statistic model)

delta float

Affects color and color co-occurrence quantization, typically set to 2.

T float

T

minArea float

Discard 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 IInputArray

Next video frame.

forgroundMask IOutputArray

Output the current forground mask

learningRate double

The learning rate, use -1.0f for default value.

DisposeObject()

Release all the unmanaged resource associated with this object

protected override void DisposeObject()