{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / transform / _warps / downscale_local_mean

function

skimage.transform._warps:downscale_local_mean

source: /dev/scikit-image/src/skimage/transform/_warps.py :472

Signature

def   downscale_local_mean ( image factors cval = 0 clip = True )

Summary

Down-sample N-dimensional image by local averaging.

Extended Summary

The image is padded with cval if it is not perfectly divisible by the integer factors.

In contrast to interpolation in skimage.transform.resize and skimage.transform.rescale this function calculates the local mean of elements in each block of size factors in the input image.

Parameters

image : (M[, ...]) ndarray

Input image.

factors : array_like

Array containing down-sampling integer factor along each axis.

cval : float, optional

Constant padding value if image is not perfectly divisible by the integer factors.

clip : bool, optional

Unused, but kept here for API consistency with the other transforms in this module. (The local mean will never fall outside the range of values in the input image, assuming the provided cval also falls within that range.)

Returns

image : ndarray

Down-sampled image with same number of dimensions as input image. For integer inputs, the output dtype will be float64. See numpy.mean for details.

Examples

a = np.arange(15).reshape(3, 5)
a
downscale_local_mean(a, (2, 3))

Aliases

  • skimage.transform.downscale_local_mean

Referenced by