Android Open Source - android-opencv-template Background Subtractor M O G2






From Project

Back to project page android-opencv-template.

License

The source code is released under:

MIT License

If you think the Android project android-opencv-template listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

//
// This file is auto-generated. Please don't modify it!
////w  w w .java 2 s.  c o  m
package org.opencv.video;



// C++: class BackgroundSubtractorMOG2
/**
 * <p>Gaussian Mixture-based Background/Foreground Segmentation Algorithm.</p>
 *
 * <p>Here are important members of the class that control the algorithm, which you
 * can set after constructing the class instance:</p>
 *
 * <p>Maximum allowed number of mixture components. Actual number is determined
 * dynamically per pixel.</p>
 *
 * <p>Threshold defining whether the component is significant enough to be included
 * into the background model (corresponds to <code>TB=1-cf</code> from the
 * paper??which paper??). <code>cf=0.1 => TB=0.9</code> is default. For
 * <code>alpha=0.001</code>, it means that the mode should exist for
 * approximately 105 frames before it is considered foreground.
 * <code></p>
 *
 * <p>// C++ code:</p>
 *
 * <p>Threshold for the squared Mahalanobis distance that helps decide when a
 * sample is close to the existing components (corresponds to <code>Tg</code>).
 * If it is not close to any component, a new component is generated. <code>3
 * sigma => Tg=3*3=9</code> is default. A smaller <code>Tg</code> value
 * generates more components. A higher <code>Tg</code> value may result in a
 * small number of components but they can grow too large.</p>
 *
 * <p>Initial variance for the newly generated components. It affects the speed of
 * adaptation. The parameter value is based on your estimate of the typical
 * standard deviation from the images. OpenCV uses 15 as a reasonable value.</p>
 *
 * <p>Parameter used to further control the variance.</p>
 *
 * <p>Parameter used to further control the variance.</p>
 *
 * <p>Complexity reduction parameter. This parameter defines the number of samples
 * needed to accept to prove the component exists. <code>CT=0.05</code> is a
 * default value for all the samples. By setting <code>CT=0</code> you get an
 * algorithm very similar to the standard Stauffer&Grimson algorithm.</p>
 *
 * <p>The value for marking shadow pixels in the output foreground mask. Default
 * value is 127.</p>
 *
 * <p>Shadow threshold. The shadow is detected if the pixel is a darker version of
 * the background. <code>Tau</code> is a threshold defining how much darker the
 * shadow can be. <code>Tau= 0.5</code> means that if a pixel is more than twice
 * darker then it is not shadow. See Prati,Mikic,Trivedi,Cucchiarra, *Detecting
 * Moving Shadows...*, IEEE PAMI,2003.</p>
 *
 * <p>The class implements the Gaussian mixture model background subtraction
 * described in: </code></p>
 * <ul>
 *   <li> Z.Zivkovic, *Improved adaptive Gausian mixture model for background
 * subtraction*, International Conference Pattern Recognition, UK, August, 2004,
 * http://www.zoranz.net/Publications/zivkovic2004ICPR.pdf. The code is very
 * fast and performs also shadow detection. Number of Gausssian components is
 * adapted per pixel.
 *   <li> Z.Zivkovic, F. van der Heijden, *Efficient Adaptive Density Estimapion
 * per Image Pixel for the Task of Background Subtraction*, Pattern Recognition
 * Letters, vol. 27, no. 7, pages 773-780, 2006. The algorithm similar to the
 * standard Stauffer&Grimson algorithm with additional selection of the number
 * of the Gaussian components based on: Z.Zivkovic, F.van der Heijden, Recursive
 * unsupervised learning of finite mixture models, IEEE Trans. on Pattern
 * Analysis and Machine Intelligence, vol.26, no.5, pages 651-656, 2004.
 * </ul>
 *
 * @see <a href="http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html#backgroundsubtractormog2">org.opencv.video.BackgroundSubtractorMOG2 : public BackgroundSubtractor</a>
 */
public class BackgroundSubtractorMOG2 extends BackgroundSubtractor {

    protected BackgroundSubtractorMOG2(long addr) { super(addr); }


    //
    // C++:   BackgroundSubtractorMOG2::BackgroundSubtractorMOG2()
    //

/**
 * <p>The constructors.</p>
 *
 * @see <a href="http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html#backgroundsubtractormog2-backgroundsubtractormog2">org.opencv.video.BackgroundSubtractorMOG2.BackgroundSubtractorMOG2</a>
 */
    public   BackgroundSubtractorMOG2()
    {

        super( BackgroundSubtractorMOG2_0() );

        return;
    }


    //
    // C++:   BackgroundSubtractorMOG2::BackgroundSubtractorMOG2(int history, float varThreshold, bool bShadowDetection = true)
    //

/**
 * <p>The constructors.</p>
 *
 * @param history Length of the history.
 * @param varThreshold Threshold on the squared Mahalanobis distance to decide
 * whether it is well described by the background model (see Cthr??). This
 * parameter does not affect the background update. A typical value could be 4
 * sigma, that is, <code>varThreshold=4*4=16;</code> (see Tb??).
 * @param bShadowDetection Parameter defining whether shadow detection should be
 * enabled (<code>true</code> or <code>false</code>).
 *
 * @see <a href="http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html#backgroundsubtractormog2-backgroundsubtractormog2">org.opencv.video.BackgroundSubtractorMOG2.BackgroundSubtractorMOG2</a>
 */
    public   BackgroundSubtractorMOG2(int history, float varThreshold, boolean bShadowDetection)
    {

        super( BackgroundSubtractorMOG2_1(history, varThreshold, bShadowDetection) );

        return;
    }

/**
 * <p>The constructors.</p>
 *
 * @param history Length of the history.
 * @param varThreshold Threshold on the squared Mahalanobis distance to decide
 * whether it is well described by the background model (see Cthr??). This
 * parameter does not affect the background update. A typical value could be 4
 * sigma, that is, <code>varThreshold=4*4=16;</code> (see Tb??).
 *
 * @see <a href="http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html#backgroundsubtractormog2-backgroundsubtractormog2">org.opencv.video.BackgroundSubtractorMOG2.BackgroundSubtractorMOG2</a>
 */
    public   BackgroundSubtractorMOG2(int history, float varThreshold)
    {

        super( BackgroundSubtractorMOG2_2(history, varThreshold) );

        return;
    }


    @Override
    protected void finalize() throws Throwable {
        delete(nativeObj);
    }



    // C++:   BackgroundSubtractorMOG2::BackgroundSubtractorMOG2()
    private static native long BackgroundSubtractorMOG2_0();

    // C++:   BackgroundSubtractorMOG2::BackgroundSubtractorMOG2(int history, float varThreshold, bool bShadowDetection = true)
    private static native long BackgroundSubtractorMOG2_1(int history, float varThreshold, boolean bShadowDetection);
    private static native long BackgroundSubtractorMOG2_2(int history, float varThreshold);

    // native support for java finalize()
    private static native void delete(long nativeObj);

}




Java Source Code List

com.floatlearning.android_opencv_template.MainActivity.java
org.opencv.android.AsyncServiceHelper.java
org.opencv.android.BaseLoaderCallback.java
org.opencv.android.CameraBridgeViewBase.java
org.opencv.android.FpsMeter.java
org.opencv.android.InstallCallbackInterface.java
org.opencv.android.JavaCameraView.java
org.opencv.android.LoaderCallbackInterface.java
org.opencv.android.NativeCameraView.java
org.opencv.android.OpenCVLoader.java
org.opencv.android.StaticHelper.java
org.opencv.android.Utils.java
org.opencv.calib3d.Calib3d.java
org.opencv.calib3d.StereoBM.java
org.opencv.calib3d.StereoSGBM.java
org.opencv.contrib.Contrib.java
org.opencv.contrib.FaceRecognizer.java
org.opencv.contrib.StereoVar.java
org.opencv.core.Algorithm.java
org.opencv.core.Core.java
org.opencv.core.CvException.java
org.opencv.core.CvType.java
org.opencv.core.MatOfByte.java
org.opencv.core.MatOfDMatch.java
org.opencv.core.MatOfDouble.java
org.opencv.core.MatOfFloat4.java
org.opencv.core.MatOfFloat6.java
org.opencv.core.MatOfFloat.java
org.opencv.core.MatOfInt4.java
org.opencv.core.MatOfInt.java
org.opencv.core.MatOfKeyPoint.java
org.opencv.core.MatOfPoint2f.java
org.opencv.core.MatOfPoint3.java
org.opencv.core.MatOfPoint3f.java
org.opencv.core.MatOfPoint.java
org.opencv.core.MatOfRect.java
org.opencv.core.Mat.java
org.opencv.core.Point3.java
org.opencv.core.Point.java
org.opencv.core.Range.java
org.opencv.core.Rect.java
org.opencv.core.RotatedRect.java
org.opencv.core.Scalar.java
org.opencv.core.Size.java
org.opencv.core.TermCriteria.java
org.opencv.features2d.DMatch.java
org.opencv.features2d.DescriptorExtractor.java
org.opencv.features2d.DescriptorMatcher.java
org.opencv.features2d.FeatureDetector.java
org.opencv.features2d.Features2d.java
org.opencv.features2d.GenericDescriptorMatcher.java
org.opencv.features2d.KeyPoint.java
org.opencv.gpu.DeviceInfo.java
org.opencv.gpu.Gpu.java
org.opencv.gpu.TargetArchs.java
org.opencv.highgui.Highgui.java
org.opencv.highgui.VideoCapture.java
org.opencv.imgproc.CLAHE.java
org.opencv.imgproc.Imgproc.java
org.opencv.imgproc.Moments.java
org.opencv.imgproc.Subdiv2D.java
org.opencv.ml.CvANN_MLP_TrainParams.java
org.opencv.ml.CvANN_MLP.java
org.opencv.ml.CvBoostParams.java
org.opencv.ml.CvBoost.java
org.opencv.ml.CvDTreeParams.java
org.opencv.ml.CvDTree.java
org.opencv.ml.CvERTrees.java
org.opencv.ml.CvGBTreesParams.java
org.opencv.ml.CvGBTrees.java
org.opencv.ml.CvKNearest.java
org.opencv.ml.CvNormalBayesClassifier.java
org.opencv.ml.CvParamGrid.java
org.opencv.ml.CvRTParams.java
org.opencv.ml.CvRTrees.java
org.opencv.ml.CvSVMParams.java
org.opencv.ml.CvSVM.java
org.opencv.ml.CvStatModel.java
org.opencv.ml.EM.java
org.opencv.ml.Ml.java
org.opencv.objdetect.CascadeClassifier.java
org.opencv.objdetect.HOGDescriptor.java
org.opencv.objdetect.Objdetect.java
org.opencv.photo.Photo.java
org.opencv.utils.Converters.java
org.opencv.video.BackgroundSubtractorMOG2.java
org.opencv.video.BackgroundSubtractorMOG.java
org.opencv.video.BackgroundSubtractor.java
org.opencv.video.KalmanFilter.java
org.opencv.video.Video.java