mango.image.rotate

mango.image.rotate(input, angle, axis=0, offset=None, interptype=mango.image._mango_open_filters.InterpolationType.CATMULL_ROM_CUBIC_SPLINE, fill=None)

Applies a rotation transformation to an image. This is the forward transform so that (conceptually):

idx  = scipy.array((i,j,k), dtype="int32")
tidx = matrix.dot((idx-offset).T) + offset
out[tuple(tidx)] = input[tuple(idx)]

This differs from the scipy.ndimage.interpolation.rotate() function which does (conceptually, ignoring shift):

idx  = scipy.array((i,j,k), dtype="int32")
tidx = matrix.dot((idx-offset).T) + offset
out[tuple(idx)] = input[tuple(tidx)]
Parameters:
  • input (mango.Dds) – Image to be transformed.
  • angle (float) – Rotation angle in degrees.
  • axis (int) – The axis of rotation.
  • offset (3-sequence) – The centre-point of the rotation transformation (relative to input.origin). If None, the centre of the image is used as the centre of rotation. Elements can be float.
  • interptype (mango.image.InterpolationType) – Interpolation type.
  • fill (numeric) – The value used for elements outside the image-domain. If None uses the input.mtype.maskValue() or 0 if there is no input.mtype attribute.
Return type:

mango.Dds

Returns:

Rotated mango.Dds image.

Previous topic

mango.image.affine_transform

Next topic

mango.image.histogramdd

This Page