【发布时间】:2019-03-04 12:25:59
【问题描述】:
我有两个尺寸为 100x100 的图像。每当我将它们展平为一维数组时,然后将它们堆叠起来,与堆叠它们时相比,我不会得到相同的输出,即展平它们。这两种方法有什么区别:
First_image = I1
Second_image = I2
I = np.hstack((I1.flatten(), I2.flatten()))
plt.imshow((I).reshape((100,2*100)));
First_image = I1
Second_image = I2
I = np.hstack((I1, I2)).flatten()
plt.imshow((I).reshape((100,2*100)));
【问题讨论】:
-
为什么要一样?
标签: python arrays numpy reshape