classPiiBackgroundExtractor
#include <PiiBackgroundExtractor.h>
An operation that models static background of a scene with moving objects.
Inherits PiiDefaultOperation
Description
The background model is based on the mean and covariance values of the image pixels. The background model is updated according to the following formula:

where
is the background model at the time moment t and
the current intensity of a pixel.
and
are learning weights that control the speed at which the foreground pixels are merged in the background. Note that the input image is normalized so that the maximum pixel intensity is always one.
Inputs
Outputs
true if the relative number of detected foreground pixels is above movementThreshold, and false otherwise.Properties
|
double
|
The first learning weight (0.1 by default). |
|
double
|
The second learning weight (0.01 by default). |
|
int
|
The maximum number of successive frames a pixel can belong to foreground. |
|
double
|
The maximum fraction of pixels that can be classified as foreground before "significant movement" is detected. |
|
double
|
The minimum difference between the background model and the current frame that will be considered a change. |
Constructors and destructor
Public member functions
|
double
|
(
)
|
|
double
|
(
)
|
|
int
|
(
)
|
|
float
|
|
|
void
|
(
|
|
void
|
(
|
|
void
|
(
|
|
void
|
(
|
|
void
|
(
|
|
double
|
(
)
|
Protected member functions
|
virtual void
|
(
)
Executes one round of processing. |
Property details
-
double alpha1
[read, write]The first learning weight (0.1 by default).
-
double alpha2
[read, write]The second learning weight (0.01 by default).
-
int maxStillTime
[read, write]The maximum number of successive frames a pixel can belong to foreground.
This value makes it possible to kill burnt in objects before the adaptation catches them. The default value is 1000.
-
double movementThreshold
[read, write]The maximum fraction of pixels that can be classified as foreground before "significant movement" is detected.
The default value is 1.
-
double threshold
[read, write]The minimum difference between the background model and the current frame that will be considered a change.
The default value is 25.
Function details
-
PiiBackgroundExtractor
() -
double alpha1
() -
double alpha2
() -
int maxStillTime
() -
float movementThreshold
() -
void setAlpha1
(- double alpha1
-
void setAlpha2
(- double alpha2
-
void setMaxStillTime
(- int maxStillTime
-
void setMovementThreshold
(- double movementThreshold
-
void setThreshold
(- double threshold
-
double threshold
() -
virtual void process
()[protected, virtual]Executes one round of processing.
This function is invoked by the processor if the necessary preconditions for a new processing round are met. This function does all the necessary calculations to create output objects and sends them to output sockets.
Calls to process(), syncEvent(), and setProperty() are synchronized and cannot occur simultaneously. PiiDefaultOperation ensures this by locking processLock() for reading before calling process().
Note: With time-consuming operations, one should occasionally check that the operation hasn't been interrupted, i.e. that state() returns
Running.Exceptions
- PiiExecutionException
whenever an unrecoverable error occurs during a processing round, the operation is interrupted, or finishes execution due to end of input data.
Reimplemented from PiiDefaultOperation.
Add a note
Not a single note added yet. Be the first, add yours.