Fix doc string of warp functions

This commit is contained in:
Johannes Schönberger
2013-09-28 14:23:15 +02:00
parent 610b22b4a9
commit a17a1395c3
2 changed files with 15 additions and 14 deletions
+7 -2
View File
@@ -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').
+8 -12
View File
@@ -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)