GISC 7365: Remote Sensing Digital Image Processing

Dr. Fang Qiu

Lab 7: Image Enhancement

Objective:

  • To introduce several common spectral filtering enhancement techniques.
  • Use band ratioing.

Part I. Image Filtering.

Quickview / Filedfwa-spot-m00.img
/ SPOT Multispectral
Band 1 = 0.50-0.59
Band 2 = 0.61-0.68
Band 3 = 0.79–0.89

Create a separate directory (Yourname_output_lab07) so that you can save all the files you will create in this part of the exercise.

  • You will select a subset (portion) of dfwa-spot-m00.img and apply a series of filters to it.
  • To best appreciate the effects of these techniques you should choose an area that has a variety of lines or edges present.
  • Open dfwa-spot-m00.img and select Inquire Box from the Inquire tool dropdown menu in the Information tab group under the Home tab. In the Inquire Box window, change the type from map to file.
  • The white box (it is not so easy to be found, you can make it more visible by selecting other colors for BoxColor in Inquire Box window) that Imagine places over the image shows the extent of the area that will be subseted.
  • Try to change the location and size of the box by dragging it with the left mouse button and resizing it by the corners.
  • Position your box in the area to be subseted, and select Create Subset Image from the Subset & Chip tool dropdown menu in the Geometry tab group under the Raster tab.
  • In the Subset window, Use the following directions to fill in the appropriate menu choices.We will make an individual subset for each band.

1)Select dfwa-spot-m00.img as the input file.

2)Name the output file (it might be helpful in keeping track with each of the many subsets you will do by using output filenames that are descriptive, i.e. dfwa-b1.img, dfwa-b2.img and dfwa-b3.img).

3)Select Coordinate Type equal to File then click on the button that says "From Inquire Box". Notice that your inquire box coordinates have been automatically included in the spaces that determine the boundary of the subset.

4)In the lower part of the window find the words Select Layers. In the space to the right you will find the entry "1:3". This means layers 1 through 3 will be included in the subset. We want to extract each individual layer as a separate file, so change this entry to read only the desired layer only (i.e. if you want to extract only layer 2, type 2 in the entry).

5)Select OK and the subset process will begin.

6)Do this for each of the three bands.

  • Now you will select the filter type to use on the subsets. Select Convolution from the Spatial tool dropdown menu in the Resolution tab group under the Raster tab. This opens a window that allows you to select from a variety of existing convolution matrices or create your own. The size of the matrix (3x3, 5x5, 7x7 etc.) is also chosen here. To filter an image subset do the following:

1)Select the input file for convolution (start with dfwa-b1.img).

2)Enter an output file name for the resulting filtered image (it might help you to include in the filename the type of filter that was used i.e. - dfw1hpf7x7.img meaning dfwa-spot-m00.img, band1 subset, hpf for high pass filter, and 7x7 for the matrix size).

3)Under Kernel you have some default filter types and sizes available for use. Most of the kernels you will need can be found under this menu. To create your own filter (you will need to do this for both the Laplacian and the Compass Gradient filter), select New below the Kernel window. An empty Kernel will open that has the title "(untitled)". Under File, in the Kernel window, select Librarian. The Kernel Librarian window should appear. Scroll to your directory if it is not already there (it probably is not) and type in the Library filename space a name for your own kernel library. An example would be Istudy.klb. When you have created your own kernel library make sure you give it a name and a description then click Save. Make it the active kernel library by selecting it. The kernel should automatically receive the name you specify into the Kernel Editor. You can modify the kernel simply by typing in the cells in the Kernel Editor. When you are done with your changes select Save in the Kernel Librarian window and Close the window.

4)Select the Fill option for Handle Edges By.

5)Select the OK button and the filtering process will begin.

Below are six types of filters that need to be run on each of the three bands. Choose a feature of interest in the image and see how it changes with the passing of each filter. Use your knowledge of spectral reflectance characteristics to answer the questions below.

  1. A 3x3 Low-Pass filter
  2. A 7x7 Low-Pass filter
  3. A 3x3 Edge Enhancement filter
  4. A Laplacian filtered image using the following matrix values: (Notice the similarity to a high-pass filter)

1 / -2 / 1
-2 / 4 / -2
1 / -2 / 1
  1. Any size High-Pass filter
  2. Design a Directional Compass Gradient filter to enhance southeast slope direction (see the textbook for help). Filter values on page: 281

Homework

To answer the following questions it might be helpful to have each of the filtered images and the composite image in viewers for quick reference.

1)Which of the following would make an image blurrier, a 3x3 or a 7x7 Low-Pass filter? Why?

2)What edges are highlighted with the 3x3 Edge Enhancer? Is anything else enhanced as well?

3)What does the Laplacian filter tend to enhance and/or suppress in the scene?

4)What is the result of performing a High-Pass filter on an image?

Create a new map composition containing four images: choose any of the three filtered images you created as well as an example of the image you filtered with your uniquely designed filter. Save this map composition as an Image file by choosing File - Print and name it as yourname_filter_Lab07.img. Be sure your map composition has appropriate annotation. The items identified in the previous labs should be used as a guide for how this composition will be graded.

Part II - Band Ratioing

Band ratioing is a process by which brightness values of pixels in one band are divided by the brightness values of their corresponding pixels in a second band in order 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. Begin by displaying the santee.img image using standard CIR band choices (RGB = 4(NIR), 3(Red), 2(Green)); then open the Model Maker button from the Common tab group under the Toolbox tab.

Quickview / File - santee.img
/ Landsat TM Data
Band 1 = Blue (.45-.52)
Band 2 = Green (.52-.60)
Band 3 = Red (.63-.69)
Band 4 = NIR (.76-.90)
Band 5 = MIR (1.55-1.75)
Band 6 = MIR (2.08-2.35)
  • In the model window, create two raster objects and one function. Use the connection tool to connect one raster object to the functionsymbol, and then to the other raster object.
  • Double click the first raster object, andselect santee.img as the input file of the model.
  • Double click the second raster object, and input a name for the output file of the model and save it to your working directory. Set the Data Type to Float Single.
  • Double clickthe function symbol, and choose Arithmetic from the Function dropdown menu. You should be able to see different arithmetic operators in the list box.
  • From the Available Inputs, select the bands you want to use for band ratio, and connect them using the division operator. For a 4/3 band ratio, your formula should be like this: $n1_santee(4) / $n1_santee(3).
  • Run the modeland wait the process to be completed.
  • Do this for each of the ratios listed below, being sure to give them an easily distinguishable name.

1)Band 4 / Band 3

2)Band 5 / Band 2

3)Band 7 / Band 4 (remember layer 6 is really band 7)

  • Now to combine these into one file so that they can be viewed as a three-layer image.
  • Select Layer Stack from the Spectral tool dropdown menu in the Resolution tab group under the Raster tab. Place the first ratio image (4/3) that you created in the Input File space by clicking on the open file button and give the Output File a name such as santeeratiolayers.img. Now click on the Add button and you should see the path and name of the first ratio image in the window (e.g. c:\usr\yourname\santee4-3.img(1) ). DON'T click OK until you have entered all three images. Continue going to the Input File again but this time add the name of the second ratio image (5/2). Select Add and complete the process by adding the last ratio image (6/4). If you mess up, just click the clear button and start over. Leave all other fields in their default settings. Once you see all three files in the window you may now click OK.
  • You can now display the new ratio layer stack image as a color composite as well as viewing the three individual ratio layers.
  • Select File - Open - Three Layer Arrangement.
  • Select the ratio layer stack output file you created and choose 1,2,3 true color.
  • Select the OK button. In the three smaller 2D Views that display the gray scale results of the band ratios, look in the title bar of the 2D View to determine the layer. If you ordered them correctly in the Layer Stack section the layers should correspond to the ratios listed above, i.e. layer 1 should be the 4/3 ratio.
  • A roving box should also appear in you color composite window. This box can be resized with the mouse and corresponds with the area displayed in the three small 2D Views. The box can be dragged around the color composite window as an additional query method.

Homework

5)Turn in a brief statement of what information specifically is highlighted in each of the band ratios.

4 / 3 Ratio (NIR/Red):

5 / 2 Ratio (MIR/Green):

6 / 4 Ratio (MIR/NIR):

6)Using band ratioing techniques, does a high or low correlation between bands extract the most information? Why?

7)Based on the band ratios you have just performed, which one enhances vegetation and vegetation differences?

Create a map composition using the images derived from band ratioing and include the composite image of the derived image and the original image for comparison purposes. Save this map composition as an image file by selecting File - Print and save it as yourname_bandratioing_lab07.img.

NOTE:

You have to turn in

1)A word file with answers to the seven questions (Yourname_answers_lab_07.doc).

2)The composed map in the form of an image file with the name Yourname_filter_lab07.img.

3)Another map in the form of an image file with the nameYourname_bandratioing_lab07.img

Please open them in a different machine to make sure you can see the images.

1