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
Modifier and TypeFieldDescriptionfloat
int
int
int
float
float
float
int
int
int
float
GrowArray<float[]>
int
-
Constructor Summary
ConstructorDescriptionBackgroundGmmCommon
(float learningPeriod, float decayCoef, int maxGaussians, ImageType imageType) -
Method Summary
Modifier and TypeMethodDescriptionint
checkBackground
(float[] pixelValue, float[] dataRow, int modelIndex) Checks to see if the pixel value refers to the background or foregroundint
checkBackground
(float pixelValue, float[] dataRow, int modelIndex) Checks to see if the the pivel value refers to the background or foregroundfloat
float
float
void
setInitialVariance
(float initialVariance) void
setLearningPeriod
(float period) void
setMaxDistance
(float maxDistance) void
setSignificantWeight
(float significantWeight) int
updateMixture
(float[] pixelValue, float[] dataRow, int modelIndex) Updates the mixtures of gaussian and determines if the pixel matches the background modelint
updateMixture
(float pixelValue, float[] dataRow, int modelIndex) Updates the mixtures of gaussian and determines if the pixel matches the background modelvoid
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.
-
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)
-