We will use the file rio.lan
for this example and try to manipulate its visible spectrum bands. The file contains seven bands, from which the third contains red color, the second green one, and the first blue one. Let's use the following steps to import and process just these three bands in MATLAB:
First, we load the multiband image using
multibandread
(imread
could still be used, in the possible case, where the multiband image is of type.tif
):>> image = multibandread('rio.lan', [512, 512, 7],... 'uint8=>uint8',128, 'bil', 'ieee-le', {'Band','Direct',[3 21]});
The previous step saves the red, green, and blue bands of the image in a matrix with 8-bit integer values, which can be now displayed as a RGB image, in the usual way:
>> figure,imshow(image),title('Original RGB image')
However, the image derived from step 2 has very little contrast and its color bands are highly correlated with each other. This is why, the...