mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-24 13:20:43 +08:00
Merge pull request #740 from ahojnnes/warp-fix
Fix doc string of warp functions
This commit is contained in:
@@ -962,8 +962,13 @@ def warp(image, inverse_map=None, map_args={}, output_shape=None, order=1,
|
||||
Shape of the output image generated. By default the shape of the input
|
||||
image is preserved.
|
||||
order : int, optional
|
||||
The order of the spline interpolation, default is 3. The order has to
|
||||
be in the range 0-5.
|
||||
The order of interpolation. The order has to be in the range 0-5:
|
||||
* 0: Nearest-neighbor
|
||||
* 1: Bi-linear (default)
|
||||
* 2: Bi-quadratic
|
||||
* 3: Bi-cubic
|
||||
* 4: Bi-quartic
|
||||
* 5: Bi-quintic
|
||||
mode : string, optional
|
||||
Points outside the boundaries of the input are filled according
|
||||
to the given mode ('constant', 'nearest', 'reflect' or 'wrap').
|
||||
|
||||
@@ -32,8 +32,8 @@ def resize(image, output_shape, order=1, mode='constant', cval=0.):
|
||||
Other parameters
|
||||
----------------
|
||||
order : int, optional
|
||||
The order of the spline interpolation, default is 3. The order has to
|
||||
be in the range 0-5.
|
||||
The order of the spline interpolation, default is 1. The order has to
|
||||
be in the range 0-5. See `skimage.transform.warp` for detail.
|
||||
mode : string, optional
|
||||
Points outside the boundaries of the input are filled according
|
||||
to the given mode ('constant', 'nearest', 'reflect' or 'wrap').
|
||||
@@ -116,8 +116,8 @@ def rescale(image, scale, order=1, mode='constant', cval=0.):
|
||||
Other parameters
|
||||
----------------
|
||||
order : int, optional
|
||||
The order of the spline interpolation, default is 3. The order has to
|
||||
be in the range 0-5.
|
||||
The order of the spline interpolation, default is 1. The order has to
|
||||
be in the range 0-5. See `skimage.transform.warp` for detail.
|
||||
mode : string, optional
|
||||
Points outside the boundaries of the input are filled according
|
||||
to the given mode ('constant', 'nearest', 'reflect' or 'wrap').
|
||||
@@ -172,8 +172,8 @@ def rotate(image, angle, resize=False, order=1, mode='constant', cval=0.):
|
||||
Other parameters
|
||||
----------------
|
||||
order : int, optional
|
||||
The order of the spline interpolation, default is 3. The order has to
|
||||
be in the range 0-5.
|
||||
The order of the spline interpolation, default is 1. The order has to
|
||||
be in the range 0-5. See `skimage.transform.warp` for detail.
|
||||
mode : string, optional
|
||||
Points outside the boundaries of the input are filled according
|
||||
to the given mode ('constant', 'nearest', 'reflect' or 'wrap').
|
||||
@@ -315,8 +315,8 @@ def swirl(image, center=None, strength=1, radius=100, rotation=0,
|
||||
Shape of the output image generated. By default the shape of the input
|
||||
image is preserved.
|
||||
order : int, optional
|
||||
The order of the spline interpolation, default is 3. The order has to
|
||||
be in the range 0-5.
|
||||
The order of the spline interpolation, default is 1. The order has to
|
||||
be in the range 0-5. See `skimage.transform.warp` for detail.
|
||||
mode : string, optional
|
||||
Points outside the boundaries of the input are filled according
|
||||
to the given mode ('constant', 'nearest', 'reflect' or 'wrap').
|
||||
|
||||
@@ -40,22 +40,18 @@ def _warp_fast(cnp.ndarray image, cnp.ndarray H, output_shape=None,
|
||||
"""Projective transformation (homography).
|
||||
|
||||
Perform a projective transformation (homography) of a
|
||||
floating point image, using bi-linear interpolation.
|
||||
floating point image, using interpolation.
|
||||
|
||||
For each pixel, given its homogeneous coordinate :math:`\mathbf{x}
|
||||
= [x, y, 1]^T`, its target position is calculated by multiplying
|
||||
with the given matrix, :math:`H`, to give :math:`H \mathbf{x}`.
|
||||
E.g., to rotate by theta degrees clockwise, the matrix should be
|
||||
|
||||
::
|
||||
E.g., to rotate by theta degrees clockwise, the matrix should be::
|
||||
|
||||
[[cos(theta) -sin(theta) 0]
|
||||
[sin(theta) cos(theta) 0]
|
||||
[0 0 1]]
|
||||
|
||||
or, to translate x by 10 and y by 20,
|
||||
|
||||
::
|
||||
or, to translate x by 10 and y by 20::
|
||||
|
||||
[[1 0 10]
|
||||
[0 1 20]
|
||||
@@ -69,12 +65,12 @@ def _warp_fast(cnp.ndarray image, cnp.ndarray H, output_shape=None,
|
||||
Transformation matrix H that defines the homography.
|
||||
output_shape : tuple (rows, cols), optional
|
||||
Shape of the output image generated (default None).
|
||||
order : {0, 1}, optional
|
||||
order : {0, 1, 2, 3}, optional
|
||||
Order of interpolation::
|
||||
* 0: Nearest-neighbour interpolation.
|
||||
* 1: Bilinear interpolation (default).
|
||||
* 2: Biquadratic interpolation.
|
||||
* 3: Bicubic interpolation.
|
||||
* 0: Nearest-neighbor
|
||||
* 1: Bi-linear (default)
|
||||
* 2: Bi-quadratic
|
||||
* 3: Bi-cubic
|
||||
mode : {'constant', 'reflect', 'wrap', 'nearest'}, optional
|
||||
How to handle values outside the image borders (default is constant).
|
||||
cval : string, optional (default 0)
|
||||
|
||||
@@ -6,11 +6,11 @@ from skimage.util import img_as_float
|
||||
|
||||
|
||||
def _smooth(image, sigma, mode, cval):
|
||||
"""Return image with each channel smoothed by the gaussian filter."""
|
||||
"""Return image with each channel smoothed by the Gaussian filter."""
|
||||
|
||||
smoothed = np.empty(image.shape, dtype=np.double)
|
||||
|
||||
if image.ndim == 3: # apply gaussian filter to all dimensions independently
|
||||
if image.ndim == 3: # apply Gaussian filter to all dimensions independently
|
||||
for dim in range(image.shape[2]):
|
||||
ndimage.gaussian_filter(image[..., dim], sigma,
|
||||
output=smoothed[..., dim],
|
||||
@@ -38,13 +38,13 @@ def pyramid_reduce(image, downscale=2, sigma=None, order=1,
|
||||
downscale : float, optional
|
||||
Downscale factor.
|
||||
sigma : float, optional
|
||||
Sigma for gaussian filter. Default is `2 * downscale / 6.0` which
|
||||
Sigma for Gaussian filter. Default is `2 * downscale / 6.0` which
|
||||
corresponds to a filter mask twice the size of the scale factor that
|
||||
covers more than 99% of the gaussian distribution.
|
||||
covers more than 99% of the Gaussian distribution.
|
||||
order : int, optional
|
||||
Order of splines used in interpolation of downsampling. See
|
||||
`scipy.ndimage.map_coordinates` for detail.
|
||||
mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
|
||||
`skimage.transform.warp` for detail.
|
||||
mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
|
||||
The mode parameter determines how the array borders are handled, where
|
||||
cval is the value when mode is equal to 'constant'.
|
||||
cval : float, optional
|
||||
@@ -92,13 +92,13 @@ def pyramid_expand(image, upscale=2, sigma=None, order=1,
|
||||
upscale : float, optional
|
||||
Upscale factor.
|
||||
sigma : float, optional
|
||||
Sigma for gaussian filter. Default is `2 * upscale / 6.0` which
|
||||
Sigma for Gaussian filter. Default is `2 * upscale / 6.0` which
|
||||
corresponds to a filter mask twice the size of the scale factor that
|
||||
covers more than 99% of the gaussian distribution.
|
||||
covers more than 99% of the Gaussian distribution.
|
||||
order : int, optional
|
||||
Order of splines used in interpolation of upsampling. See
|
||||
`scipy.ndimage.map_coordinates` for detail.
|
||||
mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
|
||||
`skimage.transform.warp` for detail.
|
||||
mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
|
||||
The mode parameter determines how the array borders are handled, where
|
||||
cval is the value when mode is equal to 'constant'.
|
||||
cval : float, optional
|
||||
@@ -137,7 +137,7 @@ def pyramid_expand(image, upscale=2, sigma=None, order=1,
|
||||
|
||||
def pyramid_gaussian(image, max_layer=-1, downscale=2, sigma=None, order=1,
|
||||
mode='reflect', cval=0):
|
||||
"""Yield images of the gaussian pyramid formed by the input image.
|
||||
"""Yield images of the Gaussian pyramid formed by the input image.
|
||||
|
||||
Recursively applies the `pyramid_reduce` function to the image, and yields
|
||||
the downscaled images.
|
||||
@@ -157,13 +157,13 @@ def pyramid_gaussian(image, max_layer=-1, downscale=2, sigma=None, order=1,
|
||||
downscale : float, optional
|
||||
Downscale factor.
|
||||
sigma : float, optional
|
||||
Sigma for gaussian filter. Default is `2 * downscale / 6.0` which
|
||||
Sigma for Gaussian filter. Default is `2 * downscale / 6.0` which
|
||||
corresponds to a filter mask twice the size of the scale factor that
|
||||
covers more than 99% of the gaussian distribution.
|
||||
covers more than 99% of the Gaussian distribution.
|
||||
order : int, optional
|
||||
Order of splines used in interpolation of downsampling. See
|
||||
`scipy.ndimage.map_coordinates` for detail.
|
||||
mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
|
||||
`skimage.transform.warp` for detail.
|
||||
mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
|
||||
The mode parameter determines how the array borders are handled, where
|
||||
cval is the value when mode is equal to 'constant'.
|
||||
cval : float, optional
|
||||
@@ -238,13 +238,13 @@ def pyramid_laplacian(image, max_layer=-1, downscale=2, sigma=None, order=1,
|
||||
downscale : float, optional
|
||||
Downscale factor.
|
||||
sigma : float, optional
|
||||
Sigma for gaussian filter. Default is `2 * downscale / 6.0` which
|
||||
Sigma for Gaussian filter. Default is `2 * downscale / 6.0` which
|
||||
corresponds to a filter mask twice the size of the scale factor that
|
||||
covers more than 99% of the gaussian distribution.
|
||||
covers more than 99% of the Gaussian distribution.
|
||||
order : int, optional
|
||||
Order of splines used in interpolation of downsampling. See
|
||||
`scipy.ndimage.map_coordinates` for detail.
|
||||
mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
|
||||
`skimage.transform.warp` for detail.
|
||||
mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
|
||||
The mode parameter determines how the array borders are handled, where
|
||||
cval is the value when mode is equal to 'constant'.
|
||||
cval : float, optional
|
||||
|
||||
Reference in New Issue
Block a user