gpt4 book ai didi

python - scipy.ndimage.interpolation.rotate 中的“轴”参数

转载 作者:太空狗 更新时间:2023-10-30 02:22:11 27 4
gpt4 key购买 nike

我不太明白下面旋转函数中的参数axes:

scipy.ndimage.interpolation.rotate(input, angle, axes=(1, 0), reshape=True, output=None, order=3, mode='constant', cval=0.0, prefilter=True)

文档中给出的解释如下:

axes : tuple of 2 ints, optional

The two axes that define the plane of rotation. Default is the first two axes.

两个轴可以定义一个旋转平面吗?

最佳答案

Ndimage 用于处理多维图像。 n 维图像将有 n 个轴。要进行旋转,您需要选择两个轴来定义进行旋转的平面。这是轴参数允许您指定的内容。

轴从 0 开始编号。它在文档中不是 100% 明确的,但我的解释是这里的“轴”与它在 Numpy 中的一般含义相同,即 n 维数据结构的维度,其中 0 是行,1 是列,等等。所以 (1, 0) 表示“第一个和第零个维度”。

传递 (1, 1) 将毫无意义,因为它指定了同一轴两次。传递 (0, 1) 与传递 (1, 0) 相同,但以相反的顺序传递轴会改变旋转方向。

关于python - scipy.ndimage.interpolation.rotate 中的“轴”参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12113869/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com