
public:
virtual ~BackgroundSubtractor();
virtual void apply(
cv::InputArray image,
cv::OutputArray fgmask,
double learningRate = 0
);
virtual void getBackgroundImage(
cv::OutputArray backgroundImage
) const;
};
As you can see, after the destructor, there are only two methods definedF
16
F. The first is the apply()
function, which in this context is used to both ingest a new image and to produce the calculated foreground
mask for that image. The second function produces an image representation of the background. This image
is primarily for visualization and debugging; after all there is much more information associated with any
single pixel in the background than just a color. As a result the image produced by
getBackgroundImage() can only be a partial presentation of the information that exists in the
background model.
One thing that might seem to be a glaring omission is the absence of a method that accumulates
background images for training. The reason for this is that there came to be (relative) consensus in the
academic literature that any background subtraction algorithm that was not essentially continuously
training was an undesirable algorithm. The reasons for this are many, with the most obvious of which being
the effect of gradual illumination change on a scene (e.g., as the sun rises and sets outside the window). The
more subtle issues arise from the fact that ...