Professional Documents
Culture Documents
Finding Vegetation in A Multi Spectral Image
Finding Vegetation in A Multi Spectral Image
Variations in the reflectivity of surface materials across different spectral bands provide a
fundamental mechanism for understanding features in remotely-sensed multispectral imagery.
This example shows how differences between the visible red and near-infrared (NIR) bands of a
LANDSAT image can be used to identify areas containing significant vegetation. It uses a
LANDSAT Thematic Mapper image covering part of Paris, France, made available courtesy of
Space Imaging, LLC. Seven spectral bands are stored in one file in the Erdas LAN format.
Contents
Step 1: Import CIR Bands from a BIL Image File
Step 2: Enhance the CIR Composite with a Decorrelation Stretch
Step 3: Construct an NIR-Red Spectral Scatter Plot
Step 4: Compute Vegetation Index via MATLAB® Array Arithmetic
Step 5: Locate Vegetation -- Threshold the NDVI Image
Step 6: Link Spectral and Spatial Content
Step 1: Import CIR Bands from a BIL Image File
The LAN file, paris.lan, contains a 7-band 512-by-512 Landsat image. A 128-byte
header is followed by the pixel values, which are band interleaved by line (BIL) in order
of increasing band number. They are stored as unsigned 8-bit integers, in little-endian
byte order.
The first step is to read bands 4, 3, and 2 from the LAN file using the MATLAB®
functionmultibandread.
Thematic Mapper 4, 3, and 2 bands cover the near infrared (NIR), the visible red, and
the visible green parts of the electromagnetic spectrum. When they are mapped to the
red, green, and blue planes, respectively, of an RGB image the result is a standard
color-infrared (CIR) composite. The final input argument to multibandread specifies
which bands to read, and in which order, so that you can construct a composite in a
single step.
figure
imshow(CIR)
title('CIR Composite (Un-enhanced)')
text(size(CIR,2), size(CIR,1) + 15,...
'Image courtesy of Space Imaging, LLC',...
'FontSize', 7, 'HorizontalAlignment', 'right')
Much of the image appearance is due to the fact that healthy, chlorophyll-rich vegetation has a
high reflectance in the near infrared. Because the NIR band is mapped to the red channel in our
composite, any area with a high vegetation density appears red in the display. A noticeable
example is the area of bright red on the left edge, a large park (the Bois de Boulogne) located
west of central Paris within a bend of the Seine River.
By analyzing differences between the NIR and red bands, you can quantify this contrast in
spectral content between vegetated areas and other surfaces such as pavement, bare soil,
buildings, or water.
NIR = im2single(CIR(:,:,1));
red = im2single(CIR(:,:,2));
Viewing the two bands together as grayscale images, you can see how different they look.
figure
imshow(red)
title('Visible Red Band')
figure
imshow(NIR)
title('Near Infrared Band')
With one simple call to the plot command in MATLAB, you can create a scatter plot displaying
one point per pixel (as a blue cross, in this case), with its X-coordinate determined by its value
in the red band and its Y-coordinate by the value its value in the NIR band.
figure
plot(red, NIR, '+b')
set(gca, 'XLim', [0 1], 'XTick', 0:0.2:1,...
'YLim', [0 1], 'YTick', 0:0.2:1);
axis square
xlabel('red level')
ylabel('NIR level')
title('NIR vs. Red Scatter Plot')
The appearance of the scatter plot of the Paris scene is characteristic of a temperate urban area
with trees in summer foliage. There's a set of pixels near the diagonal for which the NIR and red
values are nearly equal. This "gray edge" includes features such as road surfaces and many
rooftops. Above and to the left is another set of pixels for which the NIR value is often well
above the red value. This zone encompasses essentially all of the green vegetation.
Variable ndvi is a 2-D array of class single with a theoretical maximum range of [-1 1]. You
can specify these theoretical limits when displaying ndvi as a grayscale image.
figure
imshow(ndvi,'DisplayRange',[-1 1])
title('Normalized Difference Vegetation Index')
The Seine River appears very dark in the NDVI image. The large light area near the left edge of
the image is the park (Bois de Boulogne) noted earlier.
threshold = 0.4;
q = (ndvi > threshold);
The percentage of pixels selected is thus
5.2204
or about 5 percent.
The park and other smaller areas of vegetation appear white by default when displaying the
logical (binary) image q.
figure
imshow(q)
title('NDVI with Threshold Applied')
Step 6: Link Spectral and Spatial Content
To link the spectral and spatial content, you can locate above-threshold pixels on the NIR-red
scatter plot, re-drawing the scatter plot with the above-threshold pixels in a contrasting color
(green) and then re-displaying the threshold NDVI image using the same blue-green color
scheme. As expected, the pixels having an NDVI value above the threshold appear to the upper
left of the rest and correspond to the redder pixels in the CIR composite displays.
See also decorrstretch, im2single, ipexlanstretch, multibandread.