cupyx.scipy.ndimage.gaussian_filter#
- cupyx.scipy.ndimage.gaussian_filter(input, sigma, order=0, output=None, mode='reflect', cval=0.0, truncate=4.0, radius=None, axes=None)[source]#
Multi-dimensional Gaussian filter.
- Parameters:
input (cupy.ndarray) – The input array.
sigma (scalar or sequence of scalar) – Standard deviations for each axis of Gaussian kernel. A single value applies to all axes.
order (int or sequence of scalar) – An order of
0
, the default, corresponds to convolution with a Gaussian kernel. A positive order corresponds to convolution with that derivative of a Gaussian. A single value applies to all axes.output (cupy.ndarray, dtype or None) – The array in which to place the output. Default is is same dtype as the input.
mode (str or sequence of str) – The array borders are handled according to the given mode (
'reflect'
,'constant'
,'nearest'
,'mirror'
,'wrap'
). Default is'reflect'
. By passing a sequence of modes with length equal to the number ofaxes
along which the input array is being filtered, different modes can be specified along each axis. For more details on the supported modes, seescipy.ndimage.gaussian_filter()
.cval (scalar) – Value to fill past edges of input if mode is
'constant'
. Default is0.0
.truncate (float) – Truncate the filter at this many standard deviations. Default is
4.0
.radius (int, sequence of int, or None) – Radius of the Gaussian kernel. The radius are given for each axis as a sequence, or as a single number, in which case it is equal for all axes. If specified, the size of the kernel along each axis will be
2*radius + 1
, and truncate is ignored. Default isNone
.axes (tuple of int or None) – If None,
input
is filtered along all axes. Otherwise,input
is filtered along the specified axes. Whenaxes
is specified, any tuples used forsigma
,order
,mode
and/orradius
must match the length ofaxes
. The ith entry in any of these tuples corresponds to the ith entry inaxes
. Default isNone
.
- Returns:
The result of the filtering.
- Return type:
See also
Note
The Gaussian kernel will have size
2*radius + 1
along each axis. If radius is None, a defaultradius = round(truncate * sigma)
will be used.When the output data type is integral (or when no output is provided and input is integral) the results may not perfectly match the results from SciPy due to floating-point rounding of intermediate results.