将图像重塑(展平)为列向量排列

Reshaping (Flattening) Images into Column Vectors Arrangementt

假设我有一组 200 张 64x64 的胡萝卜图片。如果我要拍摄其中一张图像,比如 n1,并将 n1(n1 的形状为 (64,64,3))重塑为列向量。输出列向量是否按 n1 中存在的 RGB 值垂直排序。

(请检查 here 以了解我所说的按 RGB 垂直排序的意思)

请看,下面给出了我用来重塑胡萝卜图像的 python 代码的一部分:

n1Reshaped = n1.reshape((n1.shape[0]*n1.shape[1]*n1.shape[2]), 1)

找到解决方案作为解释。它是一个心智模型,又长又长。所以Here