Example usage for org.opencv.video BackgroundSubtractorMOG2 setShadowThreshold

List of usage examples for org.opencv.video BackgroundSubtractorMOG2 setShadowThreshold

Introduction

In this page you can find the example usage for org.opencv.video BackgroundSubtractorMOG2 setShadowThreshold.

Prototype

public void setShadowThreshold(double threshold) 

Source Link

Usage

From source file:com.davidmiguel.gobees.monitoring.algorithm.processors.BackgroundSubtractor.java

License:Open Source License

/**
 * Get the instance of BackgroundSubtractorMOG2 with the desired configuration.
 *
 * @param history         the number of frames to consider in the background model.
 * @param shadowThreshold the threshold to consider a pixel as shadow or not.
 * @return instance of BackgroundSubtractorMOG2.
 *///  ww w. j ava 2 s. com
private BackgroundSubtractorMOG2 getMogInstance(int history, double shadowThreshold) {
    BackgroundSubtractorMOG2 instance = Video.createBackgroundSubtractorMOG2(history, VAR_THRESHOLD,
            DETECT_SHADOWS);
    instance.setBackgroundRatio(BACKGROUND_RATIO);
    instance.setVarInit(VAR_INIT);
    instance.setShadowThreshold(shadowThreshold);
    return instance;
}