python之叠加两个图片

我需要把图片叠加再一起成这种形式(batch,28,28,1)

可以使用numpy库的concatenate函数实现

a = np.array([[0,1]])
print(a.shape)
b = np.array([[0,1]])
print(b.shape)
print (np.concatenate((a,b),axis = 0).shape)

输出如下:

猜你喜欢

转载自blog.csdn.net/g0415shenw/article/details/87697990