This interface provide functionalities of background subtraction for consistent or slowly changing environment. More...
Public Member Functions | |
LPVErrorCode | Apply (ILImage *img, ILImage *fgMask, BOOL doUpdateBGModel) |
LPVErrorCode | UpdateBGModel (ILImage *img) |
Public Member Functions inherited from ILObject | |
ILObject * | Copy () |
LPVErrorCode | Load (LString filename) |
void | Reset () |
LPVErrorCode | Save (LString filename) |
BOOL | Valid () |
Properties | |
double | GenerateThreshold [get, set] |
The generation threshold used to determine the complexity of the background model. If the foreground and the background is very different, you should use a larger threshold which result in more robust background model; otherwise if they are very similar, you should use a smaller threshold to generate a more sensitive background model. It should be a positive value. By default, it's set to 3. Change this value will reset the background model. | |
int | HistoryMaxCount [get, set] |
The max count of the history images which affect the background model. The larger number result in the smaller default learning rate and the slower the background update. It should be a positive integer. By default, it's set to 500. Change this value will reset the background model. | |
double | LearningRate [get, set] |
The learning rate is used to control how much the background model should learn from the new coming frame. It's in range 0 ~ 1, bigger value means faster learning. 0 means not learning at all, 1 means completely reinitialized. By default, it's set to -1 to let the algorithm to automatically chose the rate, based on the historical data and current model. | |
double | VarianceThreshold [get, set] |
The variance threshold used to determine whether the current pixel is foreground or background. If the background changes obviously, the threshold should be set higher, while the detection sensitivity decreases. It should be a positive value. By default, it's set to 25. Change this value will reset the background model. | |
This interface provide functionalities of background subtraction for consistent or slowly changing environment.
Background subtraction is a widely-used technique for detecting moving or pop-up objects in the static scene.
We model the background for each pixel using the history images. Then given the present image, every pixel is compared with the background model and classified as either foreground or background. The background model should also be updated continuously on the fly, which is controllable by a proper learning rate.
To use this interface, you should create a LBGSubtract object.
LPVErrorCode Apply | ( | ILImage * | img, |
ILImage * | fgMask, | ||
BOOL | doUpdateBGModel | ||
) |
Apply the background model to the input image, report the foreground mask.
[in] | img | The input image. |
[out] | fgMask | Output the foreground mask. White pixels are foreground. |
[in] | doUpdateBGModel | Whether to update the background model using the current new frame. |
error | Return error code if anything is wrong. |
LPVErrorCode UpdateBGModel | ( | ILImage * | img | ) |
Update the background model using the input image.
[in] | img | The input image. |
error | Return error code if anything is wrong. |