backgrounder: Reconstruct the Background of a Video

View source: R/backgrounder.R

backgrounderR Documentation

Reconstruct the Background of a Video

Description

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

Usage

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(s)

Simon Garnier, garnier@njit.edu

Examples

cctv <- Rvision::video(system.file("sample/people.mp4", package = "trackR"))
background <- backgrounder(cctv, 20)
plot(background)


swarm-lab/trackR documentation built on Nov. 20, 2022, 11:29 a.m.