标签: numpy matplotlib image-processing colors numpy-ndarray
我有一个RGB图像作为ndarray
print(img.shape) >>> (64, 64, 3)
我想将一堆图像存储到另一个ndarray中:
batch = np.empty((64, 64, 3, 2)) batch[...,0] = img
现在,如果我这样做
plt.imshow(img)
一切都很好看。但是如果我做的话
plt.imshow(batch[...,0])
颜色搞砸了!它看起来倒置了或者通道混合起来。发生了什么事?