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

クラス BackgroundSubtractorKNN


  • public class BackgroundSubtractorKNN extends BackgroundSubtractor
    K近傍法 (K-nearest neighbours) に基づく背景/前景セグメンテーション(領域分割)アルゴリズム。このクラスは CITE: Zivkovic2006 で説明されているK近傍法による背景差分を実装している。前景ピクセル数が少ない場合に非常に効率的である。
    • コンストラクタの詳細

      • BackgroundSubtractorKNN

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

      • getHistory

        public int getHistory()
        Returns the number of last frames that affect the background model
        戻り値:
        自動生成
      • setHistory

        public void setHistory​(int history)
        Sets the number of last frames that affect the background model
        引数:
        history - 自動生成
      • getNSamples

        public int getNSamples()
        Returns the number of data samples in the background model
        戻り値:
        自動生成
      • setNSamples

        public void setNSamples​(int _nN)
        Sets the number of data samples in the background model. The model needs to be reinitialized to reserve memory.
        引数:
        _nN - 自動生成
      • getDist2Threshold

        public double getDist2Threshold()
        Returns the threshold on the squared distance between the pixel and the sample The threshold on the squared distance between the pixel and the sample to decide whether a pixel is close to a data sample.
        戻り値:
        自動生成
      • setDist2Threshold

        public void setDist2Threshold​(double _dist2Threshold)
        Sets the threshold on the squared distance
        引数:
        _dist2Threshold - 自動生成
      • getkNNSamples

        public int getkNNSamples()
        Returns the number of neighbours, the k in the kNN. K is the number of samples that need to be within dist2Threshold in order to decide that that pixel is matching the kNN background model.
        戻り値:
        自動生成
      • setkNNSamples

        public void setkNNSamples​(int _nkNN)
        Sets the k in the kNN. How many nearest neighbours need to match.
        引数:
        _nkNN - 自動生成
      • getDetectShadows

        public boolean getDetectShadows()
        Returns the shadow detection flag If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorKNN for details.
        戻り値:
        自動生成
      • setDetectShadows

        public void setDetectShadows​(boolean detectShadows)
        Enables or disables shadow detection
        引数:
        detectShadows - 自動生成
      • getShadowValue

        public int getShadowValue()
        Returns the shadow value Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0 in the mask always means background, 255 means foreground.
        戻り値:
        自動生成
      • setShadowValue

        public void setShadowValue​(int value)
        Sets the shadow value
        引数:
        value - 自動生成
      • getShadowThreshold

        public double getShadowThreshold()
        Returns the shadow threshold A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiara, Detecting Moving Shadows...*, IEEE PAMI,2003.
        戻り値:
        自動生成
      • setShadowThreshold

        public void setShadowThreshold​(double threshold)
        Sets the shadow threshold
        引数:
        threshold - 自動生成