| blur | R Documentation |
Smooth a numeric array of arbitrary dimension with a separable Gaussian
kernel. This function is conceptually similar to gblur from the
EBImage package (which is limited to 2D), but works for arrays of
any dimension.
blur(x, sigma, boundary = "replicate")
x |
A numeric array to be smoothed. |
sigma |
A non-negative numeric scalar or numeric vector specifying the standard deviation(s) of the Gaussian kernel in pixel units. If a single value is provided, it is used for all dimensions. |
boundary |
A character string specifying the boundary handling, or a character vector of length equal to the number of dimensions of 'x'. Possible values are '"none"', '"circular"', and '"replicate"'. If a single value is provided, it is used for all dimensions. |
The Gaussian kernel is separable, so smoothing is performed via successive 1D convolutions along each dimension.
This function is similar in spirit to gblur from EBImage, but
generalises naturally to arrays of arbitrary dimension.
Boundary handling can be controlled via 'boundary':
'"none"' uses centered filtering without padding and therefore returns 'NA' values near array boundaries.
'"circular"' applies periodic wrap-around boundary conditions.
'"replicate"' extends the array by repeating the edge values.
For finite arrays, the Gaussian kernel is truncated as needed so that its length does not exceed the array extent along any dimension.
A numeric array with the same dimensions as 'x', containing the blurred values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.