skimage 0.17.2

NotesOther ParametersParametersReturnsBackRef
rotate(image, angle, resize=False, center=None, order=None, mode='constant', cval=0, clip=True, preserve_range=False)

Notes

Modes 'reflect' and 'symmetric' are similar, but differ in whether the edge pixels are duplicated during the reflection. As an example, if an array has values [0, 1, 2] and was padded to the right by four values using symmetric, the result would be [0, 1, 2, 2, 1, 0, 0], while for reflect it would be [0, 1, 2, 1, 0, 1, 2].

Other Parameters

order : int, optional

The order of the spline interpolation, default is 0 if image.dtype is bool and 1 otherwise. The order has to be in the range 0-5. See skimage.transform.warp for detail.

mode : {'constant', 'edge', 'symmetric', 'reflect', 'wrap'}, optional

Points outside the boundaries of the input are filled according to the given mode. Modes match the behaviour of numpy.pad .

cval : float, optional

Used in conjunction with mode 'constant', the value outside the image boundaries.

clip : bool, optional

Whether to clip the output to the range of values of the input image. This is enabled by default, since higher order interpolation may produce values outside the given input range.

preserve_range : bool, optional

Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float . Also see https://scikit-image.org/docs/dev/user_guide/data_types.html

Parameters

image : ndarray

Input image.

angle : float

Rotation angle in degrees in counter-clockwise direction.

resize : bool, optional

Determine whether the shape of the output image will be automatically calculated, so the complete rotated image exactly fits. Default is False.

center : iterable of length 2

The rotation center. If center=None , the image is rotated around its center, i.e. center=(cols / 2 - 0.5, rows / 2 - 0.5) . Please note that this parameter is (cols, rows), contrary to normal skimage ordering.

Returns

rotated : ndarray

Rotated version of the input.

Rotate image by a certain angle around its center.

Examples

This example is valid syntax, but we were not able to check execution
>>> from skimage import data
... from skimage.transform import rotate
... image = data.camera()
... rotate(image, 2).shape (512, 512)
This example is valid syntax, but we were not able to check execution
>>> rotate(image, 2, resize=True).shape
(530, 530)
This example is valid syntax, but we were not able to check execution
>>> rotate(image, 90, resize=True).shape
(512, 512)
See :

Back References

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

skimage.transform._warps.rotate

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#296
type: <class 'function'>
Commit: