mean.Rcpp_Image: Mean Value of the Pixels in an Image

View source: R/statistics.R

mean.Rcpp_ImageR Documentation

Mean Value of the Pixels in an Image

Description

Returns the mean of the pixel values of an Image object. If the Image object has more than one channel, it returns the mean for each channel.

Usage

## S3 method for class 'Rcpp_Image'
mean(x, ..., mask = NA)

Arguments

x

An Image object.

...

Unused at the moment.

mask

A single-channel (GRAY) 8-bit (8U) Image object with the same dimensions as x. This can be used to mask out pixels that should not be considered when calculating the mean (pixels set to 0 in the mask will be ignored during the mean calculation).

Value

A numeric value (for single-channel images) or a vector of numeric values (for multi-channel images).

Author(s)

Simon Garnier, garnier@njit.edu

See Also

Image

Examples

balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
mean(balloon)


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