"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "skimage/transform/_warps.py" between
scikit-image-0.19.1.tar.gz and scikit-image-0.19.2.tar.gz

About: scikit-image is a collection of algorithms for image processing in Python.

_warps.py  (scikit-image-0.19.1):_warps.py  (scikit-image-0.19.2)
skipping to change at line 30 skipping to change at line 30
ProjectiveTransform ProjectiveTransform
) )
def _preprocess_resize_output_shape(image, output_shape): def _preprocess_resize_output_shape(image, output_shape):
"""Validate resize output shape according to input image. """Validate resize output shape according to input image.
Parameters Parameters
---------- ----------
image: ndarray image: ndarray
Image to be resized. Image to be resized.
output_shape: tuple or ndarray output_shape: iterable
Size of the generated output image `(rows, cols[, ...][, dim])`. If Size of the generated output image `(rows, cols[, ...][, dim])`. If
`dim` is not provided, the number of channels is preserved. `dim` is not provided, the number of channels is preserved.
Returns Returns
------- -------
image: ndarray image: ndarray
The input image, but with additional singleton dimensions appended in The input image, but with additional singleton dimensions appended in
the case where ``len(output_shape) > input.ndim``. the case where ``len(output_shape) > input.ndim``.
output_shape: tuple output_shape: tuple
The output image converted to tuple. The output image converted to tuple.
skipping to change at line 54 skipping to change at line 54
ValueError: ValueError:
If output_shape length is smaller than the image number of If output_shape length is smaller than the image number of
dimensions dimensions
Notes Notes
----- -----
The input image is reshaped if its number of dimensions is not The input image is reshaped if its number of dimensions is not
equal to output_shape_length. equal to output_shape_length.
""" """
output_shape = tuple(output_shape)
output_ndim = len(output_shape) output_ndim = len(output_shape)
input_shape = image.shape input_shape = image.shape
if output_ndim > image.ndim: if output_ndim > image.ndim:
# append dimensions to input_shape # append dimensions to input_shape
input_shape += (1, ) * (output_ndim - image.ndim) input_shape += (1, ) * (output_ndim - image.ndim)
image = np.reshape(image, input_shape) image = np.reshape(image, input_shape)
elif output_ndim == image.ndim - 1: elif output_ndim == image.ndim - 1:
# multichannel case: append shape of last axis # multichannel case: append shape of last axis
output_shape = output_shape + (image.shape[-1], ) output_shape = output_shape + (image.shape[-1], )
elif output_ndim < image.ndim: elif output_ndim < image.ndim:
skipping to change at line 82 skipping to change at line 83
Performs interpolation to up-size or down-size N-dimensional images. Note Performs interpolation to up-size or down-size N-dimensional images. Note
that anti-aliasing should be enabled when down-sizing images to avoid that anti-aliasing should be enabled when down-sizing images to avoid
aliasing artifacts. For downsampling with an integer factor also see aliasing artifacts. For downsampling with an integer factor also see
`skimage.transform.downscale_local_mean`. `skimage.transform.downscale_local_mean`.
Parameters Parameters
---------- ----------
image : ndarray image : ndarray
Input image. Input image.
output_shape : tuple or ndarray output_shape : iterable
Size of the generated output image `(rows, cols[, ...][, dim])`. If Size of the generated output image `(rows, cols[, ...][, dim])`. If
`dim` is not provided, the number of channels is preserved. In case the `dim` is not provided, the number of channels is preserved. In case the
number of input channels does not equal the number of output channels a number of input channels does not equal the number of output channels a
n-dimensional interpolation is applied. n-dimensional interpolation is applied.
Returns Returns
------- -------
resized : ndarray resized : ndarray
Resized version of the input. Resized version of the input.
skipping to change at line 1198 skipping to change at line 1199
def resize_local_mean(image, output_shape, grid_mode=True, def resize_local_mean(image, output_shape, grid_mode=True,
preserve_range=False, *, channel_axis=None): preserve_range=False, *, channel_axis=None):
"""Resize an array with the local mean / bilinear scaling. """Resize an array with the local mean / bilinear scaling.
Parameters Parameters
---------- ----------
image : ndarray image : ndarray
Input image. If this is a multichannel image, the axis corresponding Input image. If this is a multichannel image, the axis corresponding
to channels should be specified using `channel_axis` to channels should be specified using `channel_axis`
output_shape : tuple or ndarray output_shape : iterable
Size of the generated output image. When `channel_axis` is not None, Size of the generated output image. When `channel_axis` is not None,
the `channel_axis` should either be omitted from `output_shape` or the the `channel_axis` should either be omitted from `output_shape` or the
``output_shape[channel_axis]`` must match ``output_shape[channel_axis]`` must match
``image.shape[channel_axis]``. If the length of `output_shape` exceeds ``image.shape[channel_axis]``. If the length of `output_shape` exceeds
image.ndim, additional singleton dimensions will be appended to the image.ndim, additional singleton dimensions will be appended to the
input ``image`` as needed. input ``image`` as needed.
grid_mode : bool, optional grid_mode : bool, optional
Defines ``image`` pixels position: if True, pixels are assumed to be at Defines ``image`` pixels position: if True, pixels are assumed to be at
grid intersections, otherwise at cell centers. As a consequence, grid intersections, otherwise at cell centers. As a consequence,
for example, a 1d signal of length 5 is considered to have length 4 for example, a 1d signal of length 5 is considered to have length 4
 End of changes. 4 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)