Package org.opencv.bgsegm
Class BackgroundSubtractorCNT
- java.lang.Object
- 
- org.opencv.core.Algorithm
- 
- org.opencv.video.BackgroundSubtractor
- 
- org.opencv.bgsegm.BackgroundSubtractorCNT
 
 
 
- 
 public class BackgroundSubtractorCNT extends BackgroundSubtractor Background subtraction based on counting. About as fast as MOG2 on a high end system. More than twice faster than MOG2 on cheap hardware (benchmarked on Raspberry Pi3). %Algorithm by Sagi Zeevi ( https://github.com/sagi-z/BackgroundSubtractorCNT )
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedBackgroundSubtractorCNT(long addr)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BackgroundSubtractorCNT__fromPtr__(long addr)voidapply(Mat image, Mat fgmask)Computes a foreground mask.voidapply(Mat image, Mat fgmask, double learningRate)Computes a foreground mask.protected voidfinalize()voidgetBackgroundImage(Mat backgroundImage)Computes a background image.booleangetIsParallel()Returns if we're parallelizing the algorithm.intgetMaxPixelStability()Returns maximum allowed credit for a pixel in history.intgetMinPixelStability()Returns number of frames with same pixel color to consider stable.booleangetUseHistory()Returns if we're giving a pixel credit for being stable for a long time.voidsetIsParallel(boolean value)Sets if we're parallelizing the algorithm.voidsetMaxPixelStability(int value)Sets the maximum allowed credit for a pixel in history.voidsetMinPixelStability(int value)Sets the number of frames with same pixel color to consider stable.voidsetUseHistory(boolean value)Sets if we're giving a pixel credit for being stable for a long time.- 
Methods inherited from class org.opencv.core.Algorithmclear, empty, getDefaultName, getNativeObjAddr, save
 
- 
 
- 
- 
- 
Method Detail- 
__fromPtr__public static BackgroundSubtractorCNT __fromPtr__(long addr) 
 - 
applypublic void apply(Mat image, Mat fgmask, double learningRate) Description copied from class:BackgroundSubtractorComputes a foreground mask.- Overrides:
- applyin class- BackgroundSubtractor
- Parameters:
- image- Next video frame.
- fgmask- The output foreground mask as an 8-bit binary image.
- learningRate- The value between 0 and 1 that indicates how fast the background model is learnt. Negative parameter value makes the algorithm to use some automatically chosen learning rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
 
 - 
applypublic void apply(Mat image, Mat fgmask) Description copied from class:BackgroundSubtractorComputes a foreground mask.- Overrides:
- applyin class- BackgroundSubtractor
- Parameters:
- image- Next video frame.
- fgmask- The output foreground mask as an 8-bit binary image. learnt. Negative parameter value makes the algorithm to use some automatically chosen learning rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
 
 - 
getBackgroundImagepublic void getBackgroundImage(Mat backgroundImage) Description copied from class:BackgroundSubtractorComputes a background image.- Overrides:
- getBackgroundImagein class- BackgroundSubtractor
- Parameters:
- backgroundImage- The output background image. Note: Sometimes the background image can be very blurry, as it contain the average background statistics.
 
 - 
getMinPixelStabilitypublic int getMinPixelStability() Returns number of frames with same pixel color to consider stable.- Returns:
- automatically generated
 
 - 
setMinPixelStabilitypublic void setMinPixelStability(int value) Sets the number of frames with same pixel color to consider stable.- Parameters:
- value- automatically generated
 
 - 
getMaxPixelStabilitypublic int getMaxPixelStability() Returns maximum allowed credit for a pixel in history.- Returns:
- automatically generated
 
 - 
setMaxPixelStabilitypublic void setMaxPixelStability(int value) Sets the maximum allowed credit for a pixel in history.- Parameters:
- value- automatically generated
 
 - 
getUseHistorypublic boolean getUseHistory() Returns if we're giving a pixel credit for being stable for a long time.- Returns:
- automatically generated
 
 - 
setUseHistorypublic void setUseHistory(boolean value) Sets if we're giving a pixel credit for being stable for a long time.- Parameters:
- value- automatically generated
 
 - 
getIsParallelpublic boolean getIsParallel() Returns if we're parallelizing the algorithm.- Returns:
- automatically generated
 
 - 
setIsParallelpublic void setIsParallel(boolean value) Sets if we're parallelizing the algorithm.- Parameters:
- value- automatically generated
 
 - 
finalizeprotected void finalize() throws java.lang.Throwable- Overrides:
- finalizein class- BackgroundSubtractor
- Throws:
- java.lang.Throwable
 
 
- 
 
-