Time for action – working with invisible spectrums

This time, we will not import just the bands belonging to the visible spectrum, but all seven bands. We will play around a little bit with the resulting images, trying to justify the importance of the bands. Let's start:

  1. First, we will import our image, but this time without specifying just three channels:
    >> multi = multibandread('rio.lan', [512, 512, 7],...
    'uint8=>uint8',128, 'bil', 'ieee-le'),

    To prove that we have indeed loaded all seven channels, let's check the size of our resulting matrix:

    >> size(multi)

    The output of the previous code is as follows:

    ans =
       512   512     7
  2. Since we have a matrix containing seven bands, let's make our RGB image using another method. We know the mirroring of color channels to bands is R:third, G:second, and B:first, so we will use an appropriate concatenation method, followed by the same contrast adjustment technique as before:
    >> rgb = cat(3,multi(:,:,3),multi(:,:,2),multi(:,:,1));
    >> for i=1:size(rgb,3)
    adjusted(:,:,i) = imadjust(rgb(:,:,i));
    end
  3. Now, what about the rest of the seven bands? To get a good idea of what they are, let's display them along with the visible bands and the adjusted RGB image we created. As you can see from the names assigned, the rest of the bands contain infrared spectral ranges, with the larger wavelength being the sixth band (thermal infrared):
    >> subplot(2,4,1),imshow(multi(:,:,1)),title('Band 1: Blue')
    >> subplot(2,4,2),imshow(multi(:,:,2)),title('Band 2: Green')
    >> subplot(2,4,3),imshow(multi(:,:,3)),title('Band 3: Red')
    >> subplot(2,4,4),imshow(adjusted),title('Contrast adjustedRGB')
    >> subplot(2,4,5),imshow(multi(:,:,4)),title('Band 4: Near-IR')
    >> subplot(2,4,6),imshow(multi(:,:,5)),title('Band 5: Short-IR1')
    >> subplot(2,4,7),imshow(multi(:,:,6)),title('Band 6: Thermal-IR')
    >> subplot(2,4,8),imshow(multi(:,:,7)),title('Band 7: Short-IR 2')
    Time for action – working with invisible spectrums
  4. The first practical way to use the invisible bands is to construct a near infrared color image, which in theory will make the vegetation appear reddish and the water appear dark. This can be achieved by creating an RGB image from the concatenation of the fourth, third, and second band:
    >> nearIR = cat(3, multi(:,:,4), multi(:,:,3), multi(:,:,2));
  5. Before showing our resulting image, let's create a shortwave infrared image as well. This kind of image emphasizes changes due to moisture and it is very important for scientists. It can be created by combining the seventh, fourth, and second bands:
    >> shortwIR = cat(3, multi(:,:,7), multi(:,:,4), multi(:,:,2));
  6. Now, let's see our results next to the adjusted RGB image:
    >> subplot(1,3,1),imshow(adjusted),title('Contrast adjusted RGB')
    >> subplot(1,3,2),imshow(nearIR),title('Near Infrared')
    >> subplot(1,3,3),imshow(shortwIR),title('Shortwave Infrared')
    Time for action – working with invisible spectrums

What just happened?

In this example, we worked on the manipulation of more than the visible bands. We loaded all seven bands of the file into one matrix and then mixed some of them to create resulting images that make valuable details more visible. The purpose of this section was not to make you a geospatial imagery expert, but to provide you with some insight into what the invisible layers of an image might be. Furthermore, we tried to offer an alternative solution to the analysis of geospatial data, since MATLAB can also be used for these applications. Since you got the idea on how to visualize these images, you can mix the techniques presented here with some of the methods described in previous chapters to enhance, filter, or even mask the results. The sky is the limit!

Tip

The characterization of the bands is based on information found here: http://landsat.usgs.gov/best_spectral_bands_to_use.php. You can visit the page to find a little more information about the usefulness of each band. Some more ideas on how to work with these images can be found at http://zulu.ssc.nasa.gov/mrsid/tutorial/Landsat%20Tutorial-V1.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset