mean.list: Mean of Images in a List

View source: R/statistics.R

mean.listR Documentation

Mean of Images in a List

Description

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 Image objects. 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 Image object is created and the results are stored inside (the default).

  • An Image object:the results are stored in another existing Image object. This is fast but will replace the content of target. Note that target should 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 x is 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(s)

Simon Garnier, garnier@njit.edu

See Also

Image

Examples

balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision"))
img_list <- lapply(1:10, function(x) readNext(balloon))
mean_img <- mean(img_list)


swarm-lab/Rvision documentation built on Feb. 7, 2024, 4:59 a.m.