scipy.ndimage.interpolation.shift使用示例
第一个参数为输入,应为数组,
第二个shift参数表示各个维度的偏移量[1,1]表示第一个第二个维度均偏移1,
第三个参数cval表示偏移后原来位置以什么值填充。
from scipy.ndimage.interpolation import shift
a = np.array([[1,2],[3,4]])
array([[1, 2],
[3, 4]])
shift(a,shift=[1,1],cval=1)
array([[1, 1],
[1, 1]])