skimage 0.17.2

NotesParametersReturnsBackRef
warp_coords(coord_map, shape, dtype=<class 'numpy.float64'>)

Notes

This is a lower-level routine that produces the source coordinates for 2-D images used by :None:None:`warp()`.

It is provided separately from warp to give additional flexibility to users who would like, for example, to re-use a particular coordinate mapping, to use specific dtypes at various points along the the image-warping process, or to implement different post-processing logic than warp performs after the call to :None:None:`ndi.map_coordinates`.

Parameters

coord_map : callable like GeometricTransform.inverse

Return input coordinates for given output coordinates. Coordinates are in the shape (P, 2), where P is the number of coordinates and each element is a (row, col) pair.

shape : tuple

Shape of output image (rows, cols[, bands]) .

dtype : np.dtype or string

dtype for return value (sane choices: float32 or float64).

Returns

coords : (ndim, rows, cols[, bands]) array of dtype `dtype`

Coordinates for scipy.ndimage.map_coordinates , that will yield an image of shape (orows, ocols, bands) by drawing from source points according to the :None:None:`coord_transform_fn`.

Build the source coordinates for the output of a 2-D image warp.

Examples

Produce a coordinate map that shifts an image up and to the right:

This example is valid syntax, but we were not able to check execution
>>> from skimage import data
... from scipy.ndimage import map_coordinates >>>
This example is valid syntax, but we were not able to check execution
>>> def shift_up10_left20(xy):
...  return xy - np.array([-20, 10])[None, :] >>>
This example is valid syntax, but we were not able to check execution
>>> image = data.astronaut().astype(np.float32)
... coords = warp_coords(shift_up10_left20, image.shape)
... warped_image = map_coordinates(image, coords)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.transform._warps.warp_coords

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/transform/_warps.py#560
type: <class 'function'>
Commit: