Package org.opencv.bgsegm

## Class BackgroundSubtractorGSOC

- java.lang.Object
- - org.opencv.core.Algorithm
  - - org.opencv.video.BackgroundSubtractor
    - - org.opencv.bgsegm.BackgroundSubtractorGSOC

-     public class BackgroundSubtractorGSOC
      extends BackgroundSubtractor

  Implementation of the different yet better algorithm which is called GSOC, as it was implemented during GSOC and was not originated from any paper. This algorithm demonstrates better performance on CDNET 2014 dataset compared to other algorithms in OpenCV.

- - ### Field Summary

    - ### Fields inherited from class org.opencv.core.Algorithm

      `nativeObj`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `BackgroundSubtractorGSOC​(long addr)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static BackgroundSubtractorGSOC` | `__fromPtr__​(long addr)` |
    `void` | `apply​(Mat image, Mat fgmask)` | Computes a foreground mask.
    `void` | `apply​(Mat image, Mat fgmask, double learningRate)` | Computes a foreground mask.
    `protected void` | `finalize()` |
    `void` | `getBackgroundImage​(Mat backgroundImage)` | Computes a background image.

    - ### Methods inherited from class org.opencv.core.Algorithm

      `clear, empty, getDefaultName, getNativeObjAddr, save`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BackgroundSubtractorGSOC

          protected BackgroundSubtractorGSOC​(long addr)

  - ### Method Detail

    - #### __fromPtr__

          public static BackgroundSubtractorGSOC __fromPtr__​(long addr)

    - #### apply

          public void apply​(Mat image,
                            Mat fgmask,
                            double learningRate)

      Description copied from class: `BackgroundSubtractor`
      Computes a foreground mask.
      Overrides:
        `apply` in 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.

    - #### apply

          public void apply​(Mat image,
                            Mat fgmask)

      Description copied from class: `BackgroundSubtractor`
      Computes a foreground mask.
      Overrides:
        `apply` in 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.

    - #### getBackgroundImage

          public void getBackgroundImage​(Mat backgroundImage)

      Description copied from class: `BackgroundSubtractor`
      Computes a background image.
      Overrides:
        `getBackgroundImage` in class `BackgroundSubtractor`
      Parameters:
        `backgroundImage` - The output background image. Note: Sometimes the background image can be very blurry, as it contain the average background statistics.

    - #### finalize

          protected void finalize()
                           throws java.lang.Throwable

      Overrides:
        `finalize` in class `BackgroundSubtractor`
      Throws:
        `java.lang.Throwable`