class cv::cuda::BackgroundSubtractorMOG

Overview

Gaussian Mixture-based Background/Foreground Segmentation Algorithm. Moreā€¦

#include <cudabgsegm.hpp>

class BackgroundSubtractorMOG: public cv::BackgroundSubtractor
{
public:
    // methods

    virtual
    void
    apply(
        InputArray image,
        OutputArray fgmask,
        double learningRate,
        Stream& stream
        ) = 0;

    virtual
    void
    getBackgroundImage(
        OutputArray backgroundImage,
        Stream& stream
        ) const = 0;

    virtual
    double
    getBackgroundRatio() const = 0;

    virtual
    int
    getHistory() const = 0;

    virtual
    int
    getNMixtures() const = 0;

    virtual
    double
    getNoiseSigma() const = 0;

    virtual
    void
    setBackgroundRatio(double backgroundRatio) = 0;

    virtual
    void
    setHistory(int nframes) = 0;

    virtual
    void
    setNMixtures(int nmix) = 0;

    virtual
    void
    setNoiseSigma(double noiseSigma) = 0;
};

Inherited Members

public:
    // methods

    virtual
    void
    clear();

    virtual
    bool
    empty() const;

    virtual
    String
    getDefaultName() const;

    virtual
    void
    read(const FileNode& fn);

    virtual
    void
    save(const String& filename) const;

    virtual
    void
    write(FileStorage& fs) const;

    template <typename _Tp>
    static
    Ptr<_Tp>
    load(
        const String& filename,
        const String& objname = String()
        );

    template <typename _Tp>
    static
    Ptr<_Tp>
    loadFromString(
        const String& strModel,
        const String& objname = String()
        );

    template <typename _Tp>
    static
    Ptr<_Tp>
    read(const FileNode& fn);

    virtual
    void
    apply(
        InputArray image,
        OutputArray fgmask,
        double learningRate = -1
        ) = 0;

    virtual
    void
    getBackgroundImage(OutputArray backgroundImage) const = 0;

protected:
    // methods

    void
    writeFormat(FileStorage& fs) const;

Detailed Documentation

Gaussian Mixture-based Background/Foreground Segmentation Algorithm.

The class discriminates between foreground and background pixels by building and maintaining a model of the background. Any pixel which does not fit this model is then deemed to be foreground. The class implements algorithm described in [41].

  • An example on gaussian mixture based background/foreground segmantation can be found at opencv_source_code/samples/gpu/bgfg_segm.cpp

See also:

BackgroundSubtractorMOG