私は形が (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)