Description Usage Arguments Details Value See Also Examples
This function computes the background image of a video. It tries to determine the background value of each pixel by approximating its central value, either as the mean or as the median of a given number n of images spread throughout the video.
1 | backgrounder(video, n = 10, method = "mean", color = FALSE)
|
video |
A vpVideo object from which a background image need to be computed. |
n |
The number of images to extract from the video in order to compute the background image. The images are taken at evenly spaced intervals throughout the video. The default is 10. Larger numbers will result in better accuracy, but might take longer to compute. |
method |
The type of computation to be performed in order to obtain the background image. The possible values are "mean" (default) and "median". "mean" is faster but is usually less accurate than "median". |
color |
A logical value indicating if the the background image should be color (TRUE) or grayscale (FALSE, default). Grayscale background image are faster to compute. |
The vpImage object created by the backgrounder
function is
not a persistent object, but a pointer to a C++ object that cannot be saved
for reuse in a different session.
This function returns a vpImage object.
1 2 3 4 5 | filename <- system.file("sample_vid/Walk3.mp4", package = "videoplayR")
vid <- readVid(filename)
imshow(getFrame(vid, 125))
bg <- backgrounder(vid, n = 100, method = "median", color = TRUE)
imshow(bg)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.