Class BackgroundGmmCommon

java.lang.Object
boofcv.alg.background.BackgroundGmmCommon

public class BackgroundGmmCommon
extends Object
Common code for all implementations of BackgroundAlgorithmGmm. This is where most of the important mathematics is contained.
  • Field Details

    • model

      public RArray2D_F32 model
    • imageWidth

      public int imageWidth
    • imageHeight

      public int imageHeight
    • numBands

      public int numBands
    • modelStride

      public int modelStride
    • gaussianStride

      public int gaussianStride
    • learningRate

      public float learningRate
    • decay

      public float decay
    • maxGaussians

      public int maxGaussians
    • maxDistance

      public float maxDistance
    • significantWeight

      public float significantWeight
    • initialVariance

      public float initialVariance
    • unknownValue

      public int unknownValue
    • inputWrapperMB

      public GImageMultiBand inputWrapperMB
    • storagePixels

      public GrowArray<float[]> storagePixels
    • inputWrapperG

      public GImageGray inputWrapperG
  • Constructor Details

    • BackgroundGmmCommon

      public BackgroundGmmCommon​(float learningPeriod, float decayCoef, int maxGaussians, ImageType imageType)
  • Method Details

    • updateMixture

      public int updateMixture​(float[] pixelValue, float[] dataRow, int modelIndex)
      Updates the mixtures of gaussian and determines if the pixel matches the background model
      Returns:
      true if it matches the background or false if not
    • updateWeightAndPrune

      public void updateWeightAndPrune​(float[] dataRow, int modelIndex, int ng, int bestIndex, float bestWeight)
      Updates the weight of each Gaussian and prunes one which have a negative weight after the update.
    • updateMixture

      public int updateMixture​(float pixelValue, float[] dataRow, int modelIndex)
      Updates the mixtures of gaussian and determines if the pixel matches the background model
      Returns:
      true if it matches the background or false if not
    • checkBackground

      public int checkBackground​(float[] pixelValue, float[] dataRow, int modelIndex)
      Checks to see if the pixel value refers to the background or foreground
      Returns:
      true for background or false for foreground
    • checkBackground

      public int checkBackground​(float pixelValue, float[] dataRow, int modelIndex)
      Checks to see if the the pivel value refers to the background or foreground
      Returns:
      true for background or false for foreground
    • setLearningPeriod

      public void setLearningPeriod​(float period)
    • getMaxDistance

      public float getMaxDistance()
    • setMaxDistance

      public void setMaxDistance​(float maxDistance)
    • getSignificantWeight

      public float getSignificantWeight()
    • setSignificantWeight

      public void setSignificantWeight​(float significantWeight)
    • getInitialVariance

      public float getInitialVariance()
    • setInitialVariance

      public void setInitialVariance​(float initialVariance)