matlab和caffe中RGB图像存储顺序

xiaoxiao2021-02-28  65

MATLAB中RGB图像是存储在H*W*CH的三维矩阵中,其中H表示hight(即rows),W表示width(即cols),CH即channel。

caffe使用的图像是BGR格式,且矩阵维度为W*H*CH。

因此matlab读取的图像要经过以下处理再送入caffe网络。

    Img = permute(Img, [2,1,3]);%flip width and height      Img = Img(:,:,[3,2,1]);%permute channels from RGB to BGR

转载请注明原文地址: https://www.6miu.com/read-64417.html

最新回复(0)