MATLAB: I cant display the image

multispectral

O have an image and its size 832x2016x8 uint16. It is a satellite image and i tried rgb combinations. But imshow figure is always black. What else i can do it? I resized the image but it is not a solutions? How can i display a multispectral image on matlab?

Best Answer

RGB images use 3 channels. You image has 8 channels. Therefor you have to consider how to reduce the channel size.
img = randi([0, intmax('uint16')], 832, 2016, 8, 'uint16'); % Test data
rgb = im2double(img(:, :, 1:3)); % For example
imshow(rgb)
Or perhaps:
img = double(img);
rgb = cat(3, sum(img(:, :, [1,2,3]), 3), ...
sum(img(:, :, [4,5,6]), 3), ...
sum(img(:, :, [7, 8]), 3));
rgb = rgb / max(rgb(:));