I do not quite understand the parameter axes
in the following rotate function:
scipy.ndimage.interpolation.rotate(input, angle, axes=(1, 0), reshape=True, output=None, order=3, mode='constant', cval=0.0, prefilter=True)
The explanation given in the doc is as following:
axes : tuple of 2 ints, optional
The two axes that define the plane of rotation. Default is the first two axes.
Can two axes define a plane of rotation?
Ndimage is for working with multidimensional images. An n-dimensional image will have n axes. To do a rotation, you need to pick two axes to define a plane in which to do the rotation. This is what the axes parameter lets you specify.
The axes are numbered from 0 onwards. It's not 100% explicit in the documentation, but my interpretation is that "axis" here means the same thing as it does in Numpy in general, namely a dimension of the n-dimensional data structure, where zero is rows, one is columns, etc.. So (1, 0) means "the first and zeroth dimensions".
Passing (1, 1) would be meaningless, since that specifies the same axis twice. Passing (0, 1) would be the same as pasing (1, 0), but by passing the axes in the opposite order you would change the direction of the rotation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With