문제

I have 256 x 256 x 3 double Array. How to create (RGB) picture from it in Mat-lab. The values are like (3091, 986, 1003, 1699). Thanks in advance..

도움이 되었습니까?

해결책

You can normalise the values in the matrix so that they lie between 0 and 1 and then use the command 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 ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top