View Source Evision.BackgroundSubtractor (Evision v0.1.12)

Link to this section Summary

Types

t()

Type that represents an Evision.BackgroundSubtractor struct.

Functions

Computes a foreground mask.

Computes a foreground mask.

Computes a background image.

Link to this section Types

@type t() :: %Evision.BackgroundSubtractor{ref: reference()}

Type that represents an Evision.BackgroundSubtractor struct.

  • ref. reference()

    The underlying erlang resource variable.

Link to this section Functions

@spec apply(t(), Evision.Mat.maybe_mat_in()) :: Evision.Mat.t() | {:error, String.t()}

Computes a foreground mask.

Positional Arguments
Keyword Arguments
  • learningRate: double.

    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.

Return
  • fgmask: Evision.Mat.

    The output foreground mask as an 8-bit binary image.

Python prototype (for reference):

apply(image[, fgmask[, learningRate]]) -> fgmask
Link to this function

apply(self, image, opts)

View Source
@spec apply(t(), Evision.Mat.maybe_mat_in(), [{atom(), term()}, ...] | nil) ::
  Evision.Mat.t() | {:error, String.t()}

Computes a foreground mask.

Positional Arguments
Keyword Arguments
  • learningRate: double.

    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.

Return
  • fgmask: Evision.Mat.

    The output foreground mask as an 8-bit binary image.

Python prototype (for reference):

apply(image[, fgmask[, learningRate]]) -> fgmask
Link to this function

getBackgroundImage(self)

View Source
@spec getBackgroundImage(t()) :: Evision.Mat.t() | {:error, String.t()}

Computes a background image.

Return
  • backgroundImage: Evision.Mat.

    The output background image.

Note: Sometimes the background image can be very blurry, as it contain the average background statistics.

Python prototype (for reference):

getBackgroundImage([, backgroundImage]) -> backgroundImage