Returns the pixelwise mean of Image objects stored
in a list.
Usage
# S3 method for class 'list'
mean(x, target = "new", ...)Arguments
- x
A list of
Imageobjects. All images must have the same dimensions, number of channels, and bit depth.- target
The location where the results should be stored when passing a list of images to the function. It can take 3 values:
- "new":
a new
Imageobject is created and the results are stored inside (the default).- An
Imageobject: the results are stored in another existing
Imageobject. This is fast but will replace the content oftarget. Note thattargetshould have the same dimensions and number of channels as the images in the list, otherwise an error will be thrown.
- ...
Further arguments passed to summary methods. Unused if
xis a list of images.
Value
If target="new", the function returns an Image
object. If target is an Image object, the function
returns nothing and modifies that Image object in place.
Author
Simon Garnier, garnier@njit.edu
Examples
balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision"))
#> Error: Could not open the video.
img_list <- lapply(1:10, function(x) readNext(balloon))
#> Error in FUN(X[[i]], ...): object 'balloon' not found
mean_img <- mean(img_list)
#> Error in eval(expr, envir, enclos): object 'img_list' not found