Image Filters

For this exercise you will apply convolution filtering to the registered Landsat TM image you created in the last exercise. Convolution is a form of filtering that produces an output image in which the brightness value at a given pixel is a function of some weighted average of the brightness of the surrounding pixels. Convolution of a user selected kernel with the image array returns a new, spatially filtered image.

Your first task is to produce the following filtered images;

  1. High pass,
  2. Low pass,
  3. Laplacian,
  4. Median,
  5. Sobel,
  6. Roberts,
  7. A filter in which you will modify the convolution kernel, and
  8. A user defined filter (use your imagination).

Then you will be required to interpret the results based on a visual examination of the filtered images and the kernel that was used to create them. To begin, open ENVI and display a standard false colour composite of the registered Kowloon - Hong Kong Island Landsat TM image.

Methods to produce 1 to 6 ....

All convolution filters can be accessed by selecting Filters - Convolutions from the ENVI main menu. The specifics of producing a paticular filtered image are described below. Rather than using the entire 6 band image file for filtering we will select only a single band, the red band (band 3). So the filtering output will only be a single band greyscale image.

Information

NOTE: All convolution filter results will first be output to memory. You will then be expected to display the result (a single band greyscale image) and output the display to a JPEG format image file in your 'RSData' directory. You were shown how to do this in the ENVI Tutorial. If you have forgotton refer back to the instruction page at any time by clicking here.
1. High Pass Filter: Select High Pass from the Convolutions menu. In the dialog that pops up select the image to filter, in this case Kowloon_HK.img. Rather than filter the entire file (all 6 bands) we will just select a single band, so click the Spectral Subset button. From the resulting dialog window select the red band (band 3) then click the OK button and to complete the input file selection click OK again.

The Convolution Parameters dialog window opens (Figure i.). We will be content to use the default parameters so click OK. Finally, choose to save the output to memory and click the OK button. Display and save the filtered image as 'Kowloon_HK_HP.jpg'. When you have successfully saved the file (check your 'RSData' directory using the windows file manager to make sure it is there), remove (close) the filtered image from the available bands list.

The convolution parameters dialog window showing a high pass kernel
i. Convolution parameters dialog (High Pass)

2. Low Pass Filter: Select Low Pass from the Convolutions menu. Use the same process as above to select the red band (band 3) as the input image for filtering. Accept the default convolution parameters and output the processed file to memory. Display and save the filtered image as 'Kowloon_HK_LP.jpg'. When you have verified that the file was output successfully, remove (close) the filtered image from the available bands list.

3. Laplacian Filter: Select Laplacian from the Convolutions menu. Use the same process as in 1. above, to select the red band (band 3) as the input image for filtering. Accept the default convolution parameters and output the processed file to memory. Display and save the filtered image as 'Kowloon_HK_L.jpg'. When you have verified that the file was output successfully, remove (close) the filtered image from the available bands list.

4. Median Filter: Select Median from the Convolutions menu. Use the same process as in 1. above, to select the red band (band 3) as the input image for filtering. Accept the default convolution parameters and output the processed file to memory. Display and save the filtered image as 'Kowloon_HK_M.jpg'. When you have verified that the file was output successfully, remove (close) the filtered image from the available bands list.

5. Sobel Filter:  Select Sobel from the Convolutions menu. Use the same process as in 1. above, to select the red band (band 3) as the input image for filtering. Accept the default convolution parameters and output the processed file to memory. Display and save the filtered image as 'Kowloon_HK_S.jpg'. When you have verified that the file was output successfully, remove (close) the filtered image from the available bands list.

6. Roberts Filter:  Select Roberts from the Convolutions menu. Use the same process as in 1. above, to select the red band (band 3) as the input image for filtering. Accept the default convolution parameters and output the processed file to memory. Display and save the filtered image as 'Kowloon_HK_R.jpg'. When you have verified that the file was output successfully, remove (close) the filtered image from the available bands list.

Method to produce the user defined filters (7 and 8) ....

The basic process of creating user defined filters is very simple. All that is required is to alter (edit) the kernel by changing the values it contains and/or altering its size.

7. Modified High Pass Filter: Select High Pass from the Convolutions menu. Use the same process as in 1. above, to select the red band (band 3) as the input image for filtering. You are required to alter the kernel slightly from the original default kernel displayed in the Convolution Parameters dialog window (refer to Figure i.). For the moment all that you are required to do is to change the weighting value of the central pixel from 8 to 9.

Click the Edit Kernel button. In the dialog that opens, change the central value to 9 and click the OK button. You should now notice that the kernel has been updated accordingly in the Convolution Parameters dialog window. Now click OK and output the file to memory. Display and save the filtered image as 'Kowloon_HK_EE.jpg'. When you have verified that the file was output successfully, remove (close) the filtered image from the available bands list.

8. User Defined Filter: Select User Defined from the Convolutions menu. Use the same process as in 1 above, to select the red band (band 3) as the input image for filtering. You are then confronted with the Convolution Parameters dialog window (Figure ii.).

Now feel free to do as you wish. Make your own kernel size and then input any values you wish. To alter the kernel size change the number of Rows and Columns using the arrow increment buttons at the top of the window. Editing the kernel is the same method you used previously in 7. Click the Edit Kernel button and alter the values as you wish.

When you are satisfied with the kernel you have chosen, record it on paper. You will need it to explain the appearance of your convolved image. Then go ahead and output the image to memory.

The convolution parameters dialog window showing a user defined kernel
ii. Convolution parameters dialog (User Defined)

Display and save the filtered image as 'Kowloon_HK_UD.jpg'. When you have verified that the file was output successfully, remove (close) the filtered image from the available bands list.

Finishing up your ENVI session

Use the windows file manager to check your 'RSData' directory. You should have the following files.

From THIS Lab session:
  • Kowloon_HK_HP.jpg,
  • Kowloon_HK_LP.jpg,
  • Kowloon_HK_L.jpg,
  • Kowloon_HK_M.jpg,
  • Kowloon_HK_S.jpg,
  • Kowloon_HK_R.jpg,
  • Kowloon_HK_EE.jpg, and
  • Kowloon_HK_UD.jpg
From PREVIOUS Lab sessions:
  • hkeast.img,
  • hkeast.hdr,
  • hkeast.pts,
  • kowloon-10.img,
  • kowloon-10.hdr,
  • Kowloon_HK_2.img, and
  • Kowloon_HK_2.hdr

If you are missing ANY of these files go back and create the file(s) in question. For the remainder of the exercise you don't need to use ENVI so close the program and proceed to the next page ...


  move on to the next page