Apply an arbritrary geometric transform.
The given mapping function is used to find, for each point in the output, the corresponding coordinates in the input. The value of the input at those coordinates is determined by spline interpolation of the requested order.
Parameters : | input : array_like
mapping : callable
output_shape : tuple of ints
output : ndarray or dtype, optional
order : int, optional
mode : str, optional
cval : scalar, optional
prefilter : bool, optional
extra_arguments : tuple, optional
extra_keywords : dict, optional
|
---|---|
Returns : | return_value : ndarray or None
|
See also
Examples
>>> a = np.arange(12.).reshape((4, 3))
>>> def shift_func(output_coords):
... return (output_coords[0] - 0.5, output_coords[1] - 0.5)
...
>>> sp.ndimage.geometric_transform(a, shift_func)
array([[ 0. , 0. , 0. ],
[ 0. , 1.362, 2.738],
[ 0. , 4.812, 6.187],
[ 0. , 8.263, 9.637]])