rescale(image, scale, order=None, mode='reflect', cval=0, clip=True, preserve_range=False, multichannel=False, anti_aliasing=None, anti_aliasing_sigma=None)
Performs interpolation to up-scale or down-scale N-dimensional images. Note that anti-aliasing should be enabled when down-sizing images to avoid aliasing artifacts. For down-sampling with an integer factor also see skimage.transform.downscale_local_mean
.
Modes 'reflect' and 'symmetric' are similar, but differ in whether the edge pixels are duplicated during the reflection. As an example, if an array has values [0, 1, 2] and was padded to the right by four values using symmetric, the result would be [0, 1, 2, 2, 1, 0, 0], while for reflect it would be [0, 1, 2, 1, 0, 1, 2].
The order of the spline interpolation, default is 0 if image.dtype is bool and 1 otherwise. The order has to be in the range 0-5. See skimage.transform.warp
for detail.
Points outside the boundaries of the input are filled according to the given mode. Modes match the behaviour of numpy.pad
.
Used in conjunction with mode 'constant', the value outside the image boundaries.
Whether to clip the output to the range of values of the input image. This is enabled by default, since higher order interpolation may produce values outside the given input range.
Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float
. Also see https://scikit-image.org/docs/dev/user_guide/data_types.html
Whether the last axis of the image is to be interpreted as multiple channels or another spatial dimension.
Whether to apply a Gaussian filter to smooth the image prior to down-scaling. It is crucial to filter when down-sampling the image to avoid aliasing artifacts. If input image data type is bool, no anti-aliasing is applied.
Standard deviation for Gaussian filtering to avoid aliasing artifacts. By default, this value is chosen as (s - 1) / 2 where s is the down-scaling factor.
Input image.
Scale factors. Separate scale factors can be defined as :None:None:`(rows, cols[, ...][, dim])`
.
Scaled version of the input.
Scale image by a certain factor.
>>> from skimage import dataThis example is valid syntax, but we were not able to check execution
... from skimage.transform import rescale
... image = data.camera()
... rescale(image, 0.1).shape (51, 51)
>>> rescale(image, 0.5).shape (256, 256)See :
The following pages refer to to this document either explicitly or contain code examples using this.
skimage.transform._warps.downscale_local_mean
skimage.transform._warps.rescale
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them