Mog2 Background Subtraction

Mog2 Background Subtraction node separates the foreground from the background in a video stream. It does so by subtracting the background image from the current frame to reveal the foreground objects.

Input pins

  • Input: incoming CV Mat with 1, 3, or 4 channels,

  • History: number of frames used to produce background image.

  • Learn rate: - if smaller than 0, then the value is ignored and the best Learn rate is chosen automatically. If the value is equal to 0 or larger than 1, the background image will not be updated with the Input image. If it is 1, the background image will always update with the last Input.

  • Threshold variance: variance parameter MOG2 background subtraction,

  • Detect Shadows: detects shadows in the incoming stream. If a shadow is detected, then it will be represented with grey color in the output.

Output pins

  • Output: outgoing CV Mat stream in which foreground objects are represented in white, background objects are in black color, and shadows, if present, are displayed with grey color.

  • Background: background image from which the current frame is subtracted.

Last updated