BackgroundSubtractor
Objective-C
@interface BackgroundSubtractor : Algorithm
Swift
class BackgroundSubtractor : Algorithm
Base class for background/foreground segmentation. :
The class is only used to define the common interface for the whole family of background/foreground segmentation algorithms.
Member of Video
-
Computes a foreground mask.
Declaration
Parameters
imageNext video frame.
fgmaskThe output foreground mask as an 8-bit binary image.
learningRateThe value between 0 and 1 that indicates how fast the background model is learnt. Negative parameter value makes the algorithm to use some automatically chosen learning rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
-
Computes a foreground mask.
Declaration
Parameters
imageNext video frame.
fgmaskThe output foreground mask as an 8-bit binary image. learnt. Negative parameter value makes the algorithm to use some automatically chosen learning rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
-
Computes a background image.
Declaration
Objective-C
- (void)getBackgroundImage:(nonnull Mat *)backgroundImage;Swift
func getBackgroundImage(backgroundImage: Mat)Parameters
backgroundImageThe output background image.
Note
Sometimes the background image can be very blurry, as it contain the average background statistics.
View on GitHub
BackgroundSubtractor Class Reference