mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-16 11:21:25 +08:00
Expanding the documentation in transform._warps
This commit is contained in:
@@ -5,6 +5,12 @@ def sum_blocks(array, factors):
|
||||
"""Sums the elements in blocks of integer factors and pads the original
|
||||
array with zeroes if the dimensions are not perfectly divisible by factors.
|
||||
|
||||
This function is different from resize and rescale in transform._warps in
|
||||
the sense that they use interpolation to upsample or downsample on a 2D
|
||||
array, while this function performs only dawnsampling but on any
|
||||
n-dimensional array and returns the sum of elements in a block of size
|
||||
factors in the original array.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
array : ndarray
|
||||
|
||||
@@ -8,6 +8,12 @@ from skimage.util.shape import view_as_blocks, _pad_asymmetric_zeros
|
||||
def resize(image, output_shape, order=1, mode='constant', cval=0.):
|
||||
"""Resize image to match a certain size.
|
||||
|
||||
Resize performs interpolation to upsample or downsample 2D arrays. For
|
||||
downsampling any n-dimensional array by performing arithmetic sum or
|
||||
arithmetic mean, see meassure._sum_blocks.sum_blocks and
|
||||
transform._warps.downscale_local_means respectively.
|
||||
|
||||
|
||||
Parameters
|
||||
----------
|
||||
image : ndarray
|
||||
@@ -89,6 +95,11 @@ def resize(image, output_shape, order=1, mode='constant', cval=0.):
|
||||
def rescale(image, scale, order=1, mode='constant', cval=0.):
|
||||
"""Scale image by a certain factor.
|
||||
|
||||
Rescale performs interpolation to upsample or downsample 2D arrays. For
|
||||
downsampling any n-dimensional array by performing arithmetic sum or
|
||||
arithmetic mean, see meassure._sum_blocks.sum_blocks and
|
||||
transform._warps.downscale_local_means respectively.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
image : ndarray
|
||||
@@ -339,6 +350,12 @@ def downscale_local_means(array, factors):
|
||||
the original array with zeroes if the dimensions are not perfectly
|
||||
divisible by factors and replaces it with mean i.e. average value.
|
||||
|
||||
This function is different from resize and rescale in the sense that they
|
||||
use interpolation to upsample or downsample on a 2D array, while this
|
||||
function performs only dawnsampling but on any n-dimensional array and
|
||||
returns the arithmetic mean of elements in a block of size factors in the
|
||||
original array.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
array : ndarray
|
||||
|
||||
Reference in New Issue
Block a user