🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。

クラス BackgroundSubtractorGMG


  • public class BackgroundSubtractorGMG extends BackgroundSubtractor
    CITE: Gold2012 で与えられたアルゴリズムに基づく背景差分モジュール。一連の画像を受け取り、同じサイズのマスク (8UC1) 画像の系列を返す。マスクでは 255 が前景を示し、0 が背景を表す。このクラスは、「Visual Tracking of Human Visitors under Variable-Lighting Conditions for a Responsive Audio Art Installation」, A. Godbehere, A. Matsukawa, K. Goldberg, American Control Conference, Montreal, June 2012 で説明されているアルゴリズムを実装する。
    • フィールドの要約

    • コンストラクタの要約

      コンストラクタ
      Modifier Constructor Description
      protected BackgroundSubtractorGMG​(long addr)  
    • メソッドの要約

      すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド
      Modifier and Type Method Description
      static BackgroundSubtractorGMG __fromPtr__​(long addr)  
      void apply​(Mat image, Mat fgmask)
      Computes a foreground mask.
      void apply​(Mat image, Mat fgmask, double learningRate)
      Computes a foreground mask.
      void apply​(Mat image, Mat knownForegroundMask, Mat fgmask)
      Computes a foreground mask with known foreground mask input.
      void apply​(Mat image, Mat knownForegroundMask, Mat fgmask, double learningRate)
      Computes a foreground mask with known foreground mask input.
      void getBackgroundImage​(Mat backgroundImage)
      Computes a background image.
      double getBackgroundPrior()
      Returns the prior probability that each individual pixel is a background pixel.
      double getDecisionThreshold()
      Returns the value of decision threshold.
      double getDefaultLearningRate()
      Returns the learning rate of the algorithm.
      int getMaxFeatures()
      Returns total number of distinct colors to maintain in histogram.
      double getMaxVal()
      Returns the maximum value taken on by pixels in image sequence.
      double getMinVal()
      Returns the minimum value taken on by pixels in image sequence.
      int getNumFrames()
      Returns the number of frames used to initialize background model.
      int getQuantizationLevels()
      Returns the parameter used for quantization of color-space.
      int getSmoothingRadius()
      Returns the kernel radius used for morphological operations
      boolean getUpdateBackgroundModel()
      Returns the status of background model update
      void setBackgroundPrior​(double bgprior)
      Sets the prior probability that each individual pixel is a background pixel.
      void setDecisionThreshold​(double thresh)
      Sets the value of decision threshold.
      void setDefaultLearningRate​(double lr)
      Sets the learning rate of the algorithm.
      void setMaxFeatures​(int maxFeatures)
      Sets total number of distinct colors to maintain in histogram.
      void setMaxVal​(double val)
      Sets the maximum value taken on by pixels in image sequence.
      void setMinVal​(double val)
      Sets the minimum value taken on by pixels in image sequence.
      void setNumFrames​(int nframes)
      Sets the number of frames used to initialize background model.
      void setQuantizationLevels​(int nlevels)
      Sets the parameter used for quantization of color-space
      void setSmoothingRadius​(int radius)
      Sets the kernel radius used for morphological operations
      void setUpdateBackgroundModel​(boolean update)
      Sets the status of background model update
      • クラス java.lang.Object から継承したメソッド

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • コンストラクタの詳細

      • BackgroundSubtractorGMG

        protected BackgroundSubtractorGMG​(long addr)
    • メソッドの詳細

      • apply

        public void apply​(Mat image,
                          Mat fgmask,
                          double learningRate)
        Computes a foreground mask.
        オーバーライド:
        クラス BackgroundSubtractor 内の apply
        引数:
        image - CV_8UC(n),CV_8SC(n),CV_16UC(n),CV_16SC(n),CV_32SC(n),CV_32FC(n),CV_64FC(n) 型の次の動画フレーム。ここで n は 1,2,3,4 のいずれか。
        fgmask - 8ビットのバイナリ画像としての出力前景マスク。
        learningRate - 背景モデルがどれだけ速く学習されるかを示す0から1の間の値。負のパラメータ値を指定すると、アルゴリズムは自動的に選択された学習率を使用する。0 は背景モデルがまったく更新されないことを意味し、1 は背景モデルが最後のフレームから完全に再初期化されることを意味する。
      • apply

        public void apply​(Mat image,
                          Mat fgmask)
        Computes a foreground mask.
        オーバーライド:
        クラス BackgroundSubtractor 内の apply
        引数:
        image - CV_8UC(n),CV_8SC(n),CV_16UC(n),CV_16SC(n),CV_32SC(n),CV_32FC(n),CV_64FC(n) 型の次の動画フレーム。ここで n は 1,2,3,4 のいずれか。
        fgmask - 8ビットのバイナリ画像としての出力前景マスク。学習される。負のパラメータ値を指定すると、アルゴリズムは自動的に選択された学習率を使用する。0 は背景モデルがまったく更新されないことを意味し、1 は背景モデルが最後のフレームから完全に再初期化されることを意味する。
      • apply

        public void apply​(Mat image,
                          Mat knownForegroundMask,
                          Mat fgmask,
                          double learningRate)
        Computes a foreground mask with known foreground mask input.
        オーバーライド:
        クラス BackgroundSubtractor 内の apply
        引数:
        image - 次の動画フレーム。
        fgmask - 8ビットのバイナリ画像としての出力前景マスク。
        knownForegroundMask - 既知の前景を入力するためのマスク。
        learningRate - 背景モデルがどれだけ速く学習されるかを示す0から1の間の値。負のパラメータ値を指定すると、アルゴリズムは自動的に選択された学習率を使用する。0 は背景モデルがまったく更新されないことを意味し、1 は背景モデルが最後のフレームから完全に再初期化されることを意味する。覚え書き: このメソッドには、「not implemented」エラーを送出するデフォルトの仮想実装がある。前景マスキングはすべての背景差分器でサポートされているとは限らない。
      • apply

        public void apply​(Mat image,
                          Mat knownForegroundMask,
                          Mat fgmask)
        Computes a foreground mask with known foreground mask input.
        オーバーライド:
        クラス BackgroundSubtractor 内の apply
        引数:
        image - 次の動画フレーム。
        fgmask - 8ビットのバイナリ画像としての出力前景マスク。
        knownForegroundMask - 既知の前景を入力するためのマスク。学習される。負のパラメータ値を指定すると、アルゴリズムは自動的に選択された学習率を使用する。0 は背景モデルがまったく更新されないことを意味し、1 は背景モデルが最後のフレームから完全に再初期化されることを意味する。覚え書き: このメソッドには、「not implemented」エラーを送出するデフォルトの仮想実装がある。前景マスキングはすべての背景差分器でサポートされているとは限らない。
      • getBackgroundImage

        public void getBackgroundImage​(Mat backgroundImage)
        Description copied from class: BackgroundSubtractor
        Computes a background image.
        オーバーライド:
        クラス BackgroundSubtractor 内の getBackgroundImage
        引数:
        backgroundImage - 出力背景画像。覚え書き: 背景画像は平均的な背景統計量を含むため、非常にぼやけて見えることがある。
      • getMaxFeatures

        public int getMaxFeatures()
        Returns total number of distinct colors to maintain in histogram.
        戻り値:
        自動生成
      • setMaxFeatures

        public void setMaxFeatures​(int maxFeatures)
        Sets total number of distinct colors to maintain in histogram.
        引数:
        maxFeatures - 自動生成
      • getDefaultLearningRate

        public double getDefaultLearningRate()
        Returns the learning rate of the algorithm. It lies between 0.0 and 1.0. It determines how quickly features are "forgotten" from histograms.
        戻り値:
        自動生成
      • setDefaultLearningRate

        public void setDefaultLearningRate​(double lr)
        Sets the learning rate of the algorithm.
        引数:
        lr - 自動生成
      • getNumFrames

        public int getNumFrames()
        Returns the number of frames used to initialize background model.
        戻り値:
        自動生成
      • setNumFrames

        public void setNumFrames​(int nframes)
        Sets the number of frames used to initialize background model.
        引数:
        nframes - 自動生成
      • getQuantizationLevels

        public int getQuantizationLevels()
        Returns the parameter used for quantization of color-space. It is the number of discrete levels in each channel to be used in histograms.
        戻り値:
        自動生成
      • setQuantizationLevels

        public void setQuantizationLevels​(int nlevels)
        Sets the parameter used for quantization of color-space
        引数:
        nlevels - 自動生成
      • getBackgroundPrior

        public double getBackgroundPrior()
        Returns the prior probability that each individual pixel is a background pixel.
        戻り値:
        自動生成
      • setBackgroundPrior

        public void setBackgroundPrior​(double bgprior)
        Sets the prior probability that each individual pixel is a background pixel.
        引数:
        bgprior - 自動生成
      • getSmoothingRadius

        public int getSmoothingRadius()
        Returns the kernel radius used for morphological operations
        戻り値:
        自動生成
      • setSmoothingRadius

        public void setSmoothingRadius​(int radius)
        Sets the kernel radius used for morphological operations
        引数:
        radius - 自動生成
      • getDecisionThreshold

        public double getDecisionThreshold()
        Returns the value of decision threshold. Decision value is the value above which pixel is determined to be FG.
        戻り値:
        自動生成
      • setDecisionThreshold

        public void setDecisionThreshold​(double thresh)
        Sets the value of decision threshold.
        引数:
        thresh - 自動生成
      • getUpdateBackgroundModel

        public boolean getUpdateBackgroundModel()
        Returns the status of background model update
        戻り値:
        自動生成
      • setUpdateBackgroundModel

        public void setUpdateBackgroundModel​(boolean update)
        Sets the status of background model update
        引数:
        update - 自動生成
      • getMinVal

        public double getMinVal()
        Returns the minimum value taken on by pixels in image sequence. Usually 0.
        戻り値:
        自動生成
      • setMinVal

        public void setMinVal​(double val)
        Sets the minimum value taken on by pixels in image sequence.
        引数:
        val - 自動生成
      • getMaxVal

        public double getMaxVal()
        Returns the maximum value taken on by pixels in image sequence. e.g. 1.0 or 255.
        戻り値:
        自動生成
      • setMaxVal

        public void setMaxVal​(double val)
        Sets the maximum value taken on by pixels in image sequence.
        引数:
        val - 自動生成