在进行分类任务时,我对如何使用scipy.ndimage.interpolation的移位功能感到困惑。你能帮我一下吗?
答案 0 :(得分:0)
您可以使用scipy.ndimage.interpolation模块中的shift()函数。例如, shift(image,[2,1],cval = 0)将图像向下移动2个像素,向右移动1个像素。
from scipy.ndimage.interpolation import shift
shifted_digit_image=shift(some_digit_image,[2,1])
希望这会有所帮助:)