我有一个形状为 (1120,1472,4) 的图像,我正在尝试将其更改为 (3000, 3000, 4) 我编写的代码是这样的。
pad_shape = (3000, 3000)
i = np.array('test.tif')
result = np.zeros(pad_shape,dtype=int)
result[:i.shape[0], :i.shape[1]] = i
print(result)
它生成
ValueError: could not broadcast input array from shape (1120, 1472, 4) into shape (3000, 3000)