skimage2.transform.warp_polar#

skimage2.transform.warp_polar(image, center=None, *, radius=None, output_shape=None, scaling='linear', channel_axis=None, **kwargs)[source]#

Remap image to polar or log-polar coordinates space.

Parameters:
image(M, N[, C]) ndarray

Input image. For multichannel images channel_axis has to be specified.

center2-tuple, optional

(row, col) coordinates of the point in image that represents the center of the transformation (i.e., the origin in Cartesian space). Values can be of type float. If no value is given, the center is assumed to be the center point of image.

radiusfloat, optional

Radius of the circle that bounds the area to be transformed.

output_shapetuple (row, col), optional
scaling{‘linear’, ‘log’}, optional

Specify whether the image warp is polar or log-polar. Defaults to ‘linear’.

channel_axisint or None, optional

If None, the image is assumed to be a grayscale (single channel) image. Otherwise, this parameter indicates which axis of the array corresponds to channels.

Added in version 0.19: channel_axis was added in 0.19.

**kwargskeyword arguments

Passed to transform.warp.

Returns:
warpedndarray

The polar or log-polar warped image.

Examples

Perform a basic polar warp on a grayscale image:

>>> from _skimage2 import data
>>> from _skimage2.transform import warp_polar
>>> image = data.checkerboard()
>>> warped = warp_polar(image)

Perform a log-polar warp on a grayscale image:

>>> warped = warp_polar(image, scaling='log')

Perform a log-polar warp on a grayscale image while specifying center, radius, and output shape:

>>> warped = warp_polar(image, (100,100), radius=100,
...                     output_shape=image.shape, scaling='log')

Perform a log-polar warp on a color image:

>>> image = data.astronaut()
>>> warped = warp_polar(image, scaling='log', channel_axis=-1)