This function attempts to reconstruct the background of a video that was filmed from a fixed point of view.

backgrounder(
  video,
  n = 10,
  method = "median",
  prob = 0.025,
  start = NULL,
  end = NULL
)

Arguments

video

A video object as produced by video.

n

The number of images of the video that will be used to reconstruct the background.

method

The name of a method to reconstruct the background. There are currently 4 methods available: "median" (uses the median value of each pixel as background), "min" (uses the minimum value of each pixel as background), "max" (uses the maximum value of each pixel as background), and "quant" (uses an arbitrary quantile value of each pixel as background).

prob

If method = "quant", the quantile value to use.

start, end

The start and end frames of the video to use for the background reconstruction. If not set, the first and last frames will be used.

Value

And Image object.

Author

Simon Garnier, garnier@njit.edu

Examples

cctv <- Rvision::video(system.file("sample/people.mp4", package = "trackR"))
background <- backgrounder(cctv, 20)
#> Loading images in memory.
#> Calculating background.
#> Processing red channel.
#> Processing green channel.
#> Processing blue channel.
plot(background)