Package org.opencv.bgsegm
Class BackgroundSubtractorGMG
java.lang.Object
org.opencv.core.Algorithm
org.opencv.video.BackgroundSubtractor
org.opencv.bgsegm.BackgroundSubtractorGMG
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.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BackgroundSubtractorGMG
__fromPtr__
(long addr) protected void
finalize()
double
Returns the prior probability that each individual pixel is a background pixel.double
Returns the value of decision threshold.double
Returns the learning rate of the algorithm.int
Returns total number of distinct colors to maintain in histogram.double
Returns the maximum value taken on by pixels in image sequence.double
Returns the minimum value taken on by pixels in image sequence.int
Returns the number of frames used to initialize background model.int
Returns the parameter used for quantization of color-space.int
Returns the kernel radius used for morphological operationsboolean
Returns the status of background model updatevoid
setBackgroundPrior
(double bgprior) Sets the prior probability that each individual pixel is a background pixel.void
setDecisionThreshold
(double thresh) Sets the value of decision threshold.void
setDefaultLearningRate
(double lr) Sets the learning rate of the algorithm.void
setMaxFeatures
(int maxFeatures) Sets total number of distinct colors to maintain in histogram.void
setMaxVal
(double val) Sets the maximum value taken on by pixels in image sequence.void
setMinVal
(double val) Sets the minimum value taken on by pixels in image sequence.void
setNumFrames
(int nframes) Sets the number of frames used to initialize background model.void
setQuantizationLevels
(int nlevels) Sets the parameter used for quantization of color-spacevoid
setSmoothingRadius
(int radius) Sets the kernel radius used for morphological operationsvoid
setUpdateBackgroundModel
(boolean update) Sets the status of background model updateMethods inherited from class org.opencv.video.BackgroundSubtractor
apply, apply, getBackgroundImage
Methods inherited from class org.opencv.core.Algorithm
clear, empty, getDefaultName, getNativeObjAddr, save
-
Constructor Details
-
BackgroundSubtractorGMG
protected BackgroundSubtractorGMG(long addr)
-
-
Method Details
-
__fromPtr__
-
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
- Overrides:
finalize
in classBackgroundSubtractor
- Throws:
Throwable
-