Interface BackgroundAlgorithmGaussian
- All Known Implementing Classes:
BackgroundMovingGaussian
,BackgroundMovingGaussian_IL
,BackgroundMovingGaussian_IL_MT
,BackgroundMovingGaussian_PL
,BackgroundMovingGaussian_PL_MT
,BackgroundMovingGaussian_SB
,BackgroundMovingGaussian_SB_MT
,BackgroundStationaryGaussian
,BackgroundStationaryGaussian_IL
,BackgroundStationaryGaussian_IL_MT
,BackgroundStationaryGaussian_PL
,BackgroundStationaryGaussian_PL_MT
,BackgroundStationaryGaussian_SB
,BackgroundStationaryGaussian_SB_MT
Background model in which each pixel is modeled as an independent Guassian distribution. For computational efficiency each band is modeled as having a diagonal covariance matrix with off diagonal terms set to zero, i.e. each band is independent. See [1] for a summary. This is an approximation but according to several papers it doesn't hurt performance much but simplifies computations significantly.
Internally background model is represented by two images; mean and variance, which are stored in
GrayF32
images. This allows for the mean and variance of each pixel to be interpolated,
reducing artifacts along the border of objects.
Tuning Parameters:
- learnRate: Specifies how fast it will adapt. 0 to 1, inclusive. 0 = static 1.0 = instant. Try 0.05
- threshold: Pixel's with a Mahalanobis distance ≤ threshold are assumed to be background. Consult a Chi-Squared table for theoretical values. 1-band try 10. 3-bands try 20.
- initial variance The initial variance assigned to pixels when they are first observed. By default this is Float.MIN_VALUE.
[1] Benezeth, Y., Jodoin, P. M., Emile, B., Laurent, H., & Rosenberger, C. (2010). Comparative study of background subtraction algorithms. Journal of Electronic Imaging, 19(3), 033003-033003.
-
Method Summary
Modifier and TypeMethodDescriptionfloat
Returns the initial variance assigned to a pixelfloat
Returns the learning rate.float
float
void
setInitialVariance
(float initialVariance) Sets the initial variance assigned to a pixelvoid
setLearnRate
(float learnRate) Specifies the learning ratevoid
setMinimumDifference
(float minimumDifference) void
setThreshold
(float threshold)
-
Method Details
-
getInitialVariance
float getInitialVariance()Returns the initial variance assigned to a pixel- Returns:
- initial variance
-
setInitialVariance
void setInitialVariance(float initialVariance) Sets the initial variance assigned to a pixel- Parameters:
initialVariance
- initial variance
-
getLearnRate
float getLearnRate()Returns the learning rate.- Returns:
- 0 (slow) to 1 (fast)
-
setLearnRate
void setLearnRate(float learnRate) Specifies the learning rate- Parameters:
learnRate
- 0 (slow) to 1 (fast)
-
getThreshold
float getThreshold() -
setThreshold
void setThreshold(float threshold) -
getMinimumDifference
float getMinimumDifference() -
setMinimumDifference
void setMinimumDifference(float minimumDifference)
-