Class BackgroundSubtractorGMG


  • public class BackgroundSubtractorGMG
    extends BackgroundSubtractor
    Background Subtractor module based on the algorithm given in CITE: Gold2012 . Takes a series of images and returns a sequence of mask (8UC1) images of the same size, where 255 indicates Foreground and 0 represents Background. This class implements an algorithm described in "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.
    • Constructor Detail

      • BackgroundSubtractorGMG

        protected BackgroundSubtractorGMG​(long addr)
    • Method Detail

      • getMaxFeatures

        public int getMaxFeatures()
        Returns total number of distinct colors to maintain in histogram.
        Returns:
        automatically generated
      • setMaxFeatures

        public void setMaxFeatures​(int maxFeatures)
        Sets total number of distinct colors to maintain in histogram.
        Parameters:
        maxFeatures - automatically generated
      • 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.
        Returns:
        automatically generated
      • setDefaultLearningRate

        public void setDefaultLearningRate​(double lr)
        Sets the learning rate of the algorithm.
        Parameters:
        lr - automatically generated
      • getNumFrames

        public int getNumFrames()
        Returns the number of frames used to initialize background model.
        Returns:
        automatically generated
      • setNumFrames

        public void setNumFrames​(int nframes)
        Sets the number of frames used to initialize background model.
        Parameters:
        nframes - automatically generated
      • 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.
        Returns:
        automatically generated
      • setQuantizationLevels

        public void setQuantizationLevels​(int nlevels)
        Sets the parameter used for quantization of color-space
        Parameters:
        nlevels - automatically generated
      • getBackgroundPrior

        public double getBackgroundPrior()
        Returns the prior probability that each individual pixel is a background pixel.
        Returns:
        automatically generated
      • setBackgroundPrior

        public void setBackgroundPrior​(double bgprior)
        Sets the prior probability that each individual pixel is a background pixel.
        Parameters:
        bgprior - automatically generated
      • getSmoothingRadius

        public int getSmoothingRadius()
        Returns the kernel radius used for morphological operations
        Returns:
        automatically generated
      • setSmoothingRadius

        public void setSmoothingRadius​(int radius)
        Sets the kernel radius used for morphological operations
        Parameters:
        radius - automatically generated
      • getDecisionThreshold

        public double getDecisionThreshold()
        Returns the value of decision threshold. Decision value is the value above which pixel is determined to be FG.
        Returns:
        automatically generated
      • setDecisionThreshold

        public void setDecisionThreshold​(double thresh)
        Sets the value of decision threshold.
        Parameters:
        thresh - automatically generated
      • getUpdateBackgroundModel

        public boolean getUpdateBackgroundModel()
        Returns the status of background model update
        Returns:
        automatically generated
      • setUpdateBackgroundModel

        public void setUpdateBackgroundModel​(boolean update)
        Sets the status of background model update
        Parameters:
        update - automatically generated
      • getMinVal

        public double getMinVal()
        Returns the minimum value taken on by pixels in image sequence. Usually 0.
        Returns:
        automatically generated
      • setMinVal

        public void setMinVal​(double val)
        Sets the minimum value taken on by pixels in image sequence.
        Parameters:
        val - automatically generated
      • getMaxVal

        public double getMaxVal()
        Returns the maximum value taken on by pixels in image sequence. e.g. 1.0 or 255.
        Returns:
        automatically generated
      • setMaxVal

        public void setMaxVal​(double val)
        Sets the maximum value taken on by pixels in image sequence.
        Parameters:
        val - automatically generated
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class BackgroundSubtractor
        Throws:
        java.lang.Throwable