Expanding the documentation in transform._warps

This commit is contained in:
Ankit Agrawal
2013-07-05 00:21:11 +08:00
parent 6f9d7c5d1a
commit 8ac4427d9b
2 changed files with 23 additions and 0 deletions
+6
View File
@@ -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
+17
View File
@@ -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