warp_coords(coord_map, shape, dtype=<class 'numpy.float64'>)
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`
.
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 of output image (rows, cols[, bands])
.
dtype for return value (sane choices: float32 or float64).
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.
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 dataThis example is valid syntax, but we were not able to check execution
... from scipy.ndimage import map_coordinates >>>
>>> def shift_up10_left20(xy):This example is valid syntax, but we were not able to check execution
... return xy - np.array([-20, 10])[None, :] >>>
>>> image = data.astronaut().astype(np.float32)See :
... coords = warp_coords(shift_up10_left20, image.shape)
... warped_image = map_coordinates(image, coords)
The following pages refer to to this document either explicitly or contain code examples using this.
skimage.transform._warps.warp_coords
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