Lab Assignment 5

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

CVE - 572 – Satellite Remote Sensing

CONVOLUTION FILTERING AND BAND RATIONING


FALL 2024
Objectives:
The purpose of this lab assignment is to perform filtering and band ratioing on images.
Specific objectives include:
 The use of several kernels/filters in ERDAS IMAGINE and interpretation of the
Results of these filtered images.
 Performing a band ratio on an image and interpreting a band ratio image.

Introductions:
Filtering a digital image in the spatial domain is designed to enhance different scales of tonal or
digital number (DN) roughness, i.e., different spatial frequencies. Spatial filtering will modify the
pixel values based on the values of surrounding pixels (the neighboring pixels). In this regard,
spatial filtering is an area operation, whereas contrast stretching is a point operation. Spatial
filters are used to either emphasize or de- emphasize abrupt changes in pixel DNs, thereby
altering an image's textural appearance.

Convolution filtering is the process of averaging small sets of pixels across an image. A
convolution kernel is a matrix of numbers that is used to average the value of each pixel with the
values of surrounding pixels. The numbers in the matrix serve to weight this average toward
particular pixels. These numbers are often called coefficients, because they are used as such in the
mathematical equations.
To understand how one pixel is convolved, imagine that the convolution kernel is applied
to one layer of a hypothetical image (only one band), so that the pixel to be convolved is in the center
of the window. The figure below shows a 3x3 convolution kernel being applied to a 3-by-3 array
surrounding the pixel in the third column, third row of the hypothetical image. To obtain a new
value for the pixel at the center of the convolution kernel (Pctr), the pixel values are multiplied by
the values of the 3x3 convolution kernel and are summed, and the total is divided by the sum of
the values in the kernel, as shown in the equation below.

5 6 6 8 8 7

6 5 6 5 7 8

7 7 8 7 7 8

7 8 5 7 7 7

7 6 8 8 8 6

8 7 8 6 7 6

7 6 5 5 6 6

2
-1 -1 -1

-1 16 -1

-1 -1 -1

When this kernel is used, the relatively lower values become lower and the higher values
become higher, thus increasing the spatial frequency of the image. This filter serves as an edge
enhancer as the filter brings out the edges between homogenous groups of pixels. This filter
highlights edges and does not necessarily eliminate other features.
A low frequency filter decreases spatial frequency. This type of filter simply averages the values of
the pixels, causing them to be more homogeneous (homogeneity is a low spatial frequency). The
resulting image looks smoother or more blurred. An example of a low pass filter is:

1 1 1

1 1 1

1 1 1

Band Ratioing is a process where the brightness values of pixels in one band are divided by the
brightness values of their corresponding pixels in a second band to create a new output image.
These ratios may enhance or subdue certain attributes found in the image, depending on the
spectral characteristics in each of the two bands chosen. In this lab assignment, we will look at the
most commonly used band ratio known as Normalized Difference Vegetation Index (NDVI). The
equation below is used for calculating NDVI:

(𝑰𝑹−𝑹)
NDVI =
(𝑰𝑹+𝑹)
Where, IR is the infrared band and R is the red band. Note that these bands are different from
satellite to satellite.

3
For example, for Landsat 4-7:
NDVI = (Band 4 – Band 3) / (Band 4 + Band 3) and

And, for Landsat 8 or Landsat 9,


NDVI = (Band 5 – Band 4) / (Band 5 + Band 4).

Where IR is the % reflected Infrared, and R is the % reflected visible (or red spectrum only).
NDVI uses the spectral characteristics of vegetation, soil and water in the RED and NIR region
to separate these features and to evaluate the condition of vegetation. In general, healthy
vegetation has much higher reflectance in the IR region and lower reflectance in the red region.
The degree of reflectance in IR and absorption in R depends on the healthiness of the vegetation,
which is a result of chlorophyll concentration, biomass and leaf structure. Therefore, by using the
ratio between the IR and R, the condition of vegetation can be evaluated. NDVI values are always in
the range form (-1) to (+1). Values of NDVI close to zero (0) indicate no green leaves, and values
close to one (+1) indicate the highest possible density of green leaves.

Tutorial:
There are two general ways to go about spatial filtering in ERDAS. One changes the display values
(LUT) only (non-permanent change), and the other outputs new image files with new pixel DNs. You
will explore the use of both approaches. It is important to know that changes to the image at the file
level will permanently alter the image. Therefore, you should always keep the original image
and write any new image data to another file.

4
A. Spatial filtering using the Convolution dialog:
1. Start ERDAS IMAGINE.
2. On the Erdas Imagine menu bar, select Raster and click on Spatial. From the Spatial submenu
select Convolution. The Convolution dialog box will pop up.
3. For the input file, select the IKONOS image (lab5_image1.img).
4. For the output file, type in a filename (e.g. lab5_image1_lp) and save it in your own directory,
and make sure unsigned 16-bit is highlighted.
5. Under Kernel, select the 3x3 Low Pass.
6. To view the kernel used, click on edit. Note that in the Edit dialog box, the pointer will default to
the first value. Click anywhere outside the matrix to deselect the value, so that you can see the kernel
value. Record the weights used in this filter, then close this window.
7. Click OK to do the processing.
8. Repeat steps 3 to 7, but using 3x3 High Pass, 3x3 Edge Detect, and 3x3 Edge Enhance.
Click on the Viewer to open up new viewer windows.
Load the original, low pass, high pass, edge enhance, and edge detect images into individual viewer
windows. Now compare these images (your original and the filtered images), and examine the
histograms to see how they have changed for the output images and include your observations in
the lab report.
To see how the pixel values change across the filtered images, use the Spatial Profile tool to create
profiles.
In the main menu, click Multispectral, then click on Profile Tool, (the default is Spectral Profile)
and select Spatial Profile. In addition, you can also use Surface Profile under this option which
will give you an area view of the pixel values. Now, let's design your own filter. Again, select Raster
in the main menu and click on Spatial. From the Spatial submenu select Convolution. The
Convolution dialog box will pop up. Be sure to select the input image as lab5_image1.img and save
the output image in your directory under a name of your choice. Check Normalize the Kernel and
select New. Input the values you want to have in your 3x3 filter, select Librarian under File, save
your own filter as your_ name.klb file in your folder, click save, click Close to

exit out of the Kernel editor, and click OK to run your own filter. Compare the output image filtered
with your own filter to the original image.

B. Spatial filtering using the Filtering dialog:


Now, open the image (lab5_image2.img). Select Filtering from under Multispectral in the main
menu. The Filtering dialog will be launched. Note that this filtering method will not permanently
alter the image file. Note: To display the original image after applying a filter using this method, you
may select Reset Convolution from under the Filtering submenu.
1. Haze Reduction: Select a 3x3 Haze Reduction kernel. Describe the appearance of the image. For
what applications might a Haze Reduction filter be useful?

5
2. Sharpening: Select a 3x3 Sharpen kernel. Describe the appearance of the image? For what
applications might a sharpen filter be useful?

3. Edge Enhancement: Select a 3x3 Edge Enhance kernel. Describe the appearance of the image?
For what applications might an Edge Enhance filter be useful?

4. Edge Detection: Select a 3x3 Edge Detect kernel. Describe the appearance of the image? For what
applications might an Edge Detect filter be useful? Based on the result of the filtering you’ve seen
herein and in 3 above, what is the difference between Edge Enhance and Edge Detect filters?

5. Now, from under Multispectral in the main menu, select Filtering and then select Smooth in the
Standard filter. Describe the appearance of the image? For what applications might a smooth filter
be useful?

6. Now, from under Multispectral in the main menu, select Filtering and then select Sharpen in
the Standard filter. Describe the appearance of the image? For what applications might a sharpen
filter be useful? Compare the results of applying this Sharpen filter and that you have performed in
step B.2 above.

7. Now, from under Multispectral in the main menu, select Filtering and then select Find Edges in
the Standard filter.Describe the appearance of the image? For what applications might a find edges
filter be useful? Compare the results of applying this Sharpen filter and that you have performed in
step B.4 above.

C. Using NDVI to evaluate the seasonal change of vegetation:


The characteristics of vegetation cover follow the life cycle of plants and vary from season to season.
Using the condition of vegetation cover, one could determine the health of vegetation.
1. From under Raster in the menu, select Unsupervised, and click on Indices or NDVI. The Indices
dialog will pop up.
2. In the Indices dialog, select PUNE_B1_B7_12202021_COMP.tif as the Input File and in the Output
File field, type in a filename of your choice, say PUNE_B1_B7_12202021_COMP_NDVI.tif Be sure
that this output file is saved in your own drive.

3. Select Landsat 8 MS in the Sensor field. Under the category set ALL; In the Index select
NDVI- Normalized Difference Vegetation Index, and make sure the output data type is Float
Single (under the I/O Options). Click OK to perform the NDVI calculation.

4. Now, open a second 2D View from File > New and load PUNE_B1_B7_12202021_COMP.tif in
one viewer and PUNE_B1_B7_12202021_COMP_NDVI.tif in the second and compare the two

6
images. Does the brightness value of the fields change from image to image? Discuss.
5. Now, click on Link Views function from under Home in ERDAS main menu to link the two
images, and use the Inquire cursor compared the tow two images.

Lab Task:
Create NDVI for FUJ_12JUNE_2020.tif and answer the following questions
1. Record the NDVI values at three locations of your choice on the image, and include these values
in your report.
2. Create NDVI histogram form you’re out file and identify max and min NDVI
3. Identify the possible feature from the NDVI Range from the output you created above.
NDVI Range Feature Name Location (Latitude ,Longitude)
0.24 to 0.55
0.03 to 0.08
-0.01 to -0.06

You might also like