Package boofcv.alg.background
Class BackgroundGmmCommon
java.lang.Object
boofcv.alg.background.BackgroundGmmCommon
Common code for all implementations of
BackgroundAlgorithmGmm. This is where most of the important
mathematics is contained.-
Field Summary
FieldsModifier and TypeFieldDescriptionfloatintintintfloatfloatfloatintintintfloatGrowArray<float[]>int -
Constructor Summary
ConstructorsConstructorDescriptionBackgroundGmmCommon(float learningPeriod, float decayCoef, int maxGaussians, ImageType imageType) -
Method Summary
Modifier and TypeMethodDescriptionintcheckBackground(float[] pixelValue, float[] dataRow, int modelIndex) Checks to see if the pixel value refers to the background or foregroundintcheckBackground(float pixelValue, float[] dataRow, int modelIndex) Checks to see if the the pivel value refers to the background or foregroundfloatfloatfloatvoidsetInitialVariance(float initialVariance) voidsetLearningPeriod(float period) voidsetMaxDistance(float maxDistance) voidsetSignificantWeight(float significantWeight) intupdateMixture(float[] pixelValue, float[] dataRow, int modelIndex) Updates the mixtures of gaussian and determines if the pixel matches the background modelintupdateMixture(float pixelValue, float[] dataRow, int modelIndex) Updates the mixtures of gaussian and determines if the pixel matches the background modelvoidupdateWeightAndPrune(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.
-
Field Details
-
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
-
storagePixels
-
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)
-