[英]3D double Array to RGB in MATLAB
我有 256 x 256 x 3 雙陣列。 如何在 Mat-lab 中從中創建(RGB)圖片。 值類似於 (3091, 986, 1003, 1699)。 提前致謝..
您可以將矩陣中的值歸一化,使它們介於 0 和 1 之間,然后使用命令imshow
:
// create a random example of a matrix
I = 4000*rand(256, 256, 3);
// normalise the values in I
for i = 1:3
I(:, :, i) = I(:, :, i)/max(max(I(:, :, i)));
end
// display as image
imshow(I, 'InitialMagnification', 'fit')
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.