如何使用matlab将图像的所有像素值存储在数组或向量中

时间:2016-08-29 07:09:59

标签: matlab

我想使用matlab将图像的所有像素值存储在数组或向量中。请建议我怎么做?

1 个答案:

答案 0 :(得分:0)

Probably what seems is you want to store the image in 1D, which can be done as:

I = imread('cameraman.tif');
I_1D = I(:);

you also take the transpose of this vector as I_1D = I(:)';