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. File dfwa-spot-m00.img Quickview 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. Right click on viewer and display Inquire Box, change the map coordinates to file coordinates. The white box (it is not so easy to be found, you can make it more visible by selecting other colors from BoxColor) 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, click on the Interpreter button in the Imagine icon panel. Select Utilities option and in the Utilities menu and then select the Subset option. Use the following directions to fill in the appropriate menu choices. We will make an individual subset for each band. 1 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. Under the Interpreter menu, select the Spatial Enhancement option and then the Convolution option. 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-spotm00.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 gradiant 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. a. A 3x3 Low-Pass filter b. A 7x7 Low-Pass filter c. A 3x3 Edge Enhancement filter 2 d. A Laplacian filtered image using the following matrix values: (Notice the similarity to a high-pass filter) 1 -2 1 -2 4 1 -2 -2 1 e. Any size High-Pass filter f. 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 find and select the Image Interpreter button on the Imagine icon panel. 3 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) Select Utilities – Operators Select santee.img as both Input File #1 and Input File #2 Input the output name and set the path to your working directory. Under the input files, select the bands (layers) you wish to use. For a 4/3 band ratio, select layer 4 for input file #1 and layer 3 for input file #2. Select the Operator to be used, in this case the division symbol. Leave all other fields in their default values. Select OK in the Two Input Operators window for the process to be complete. 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 the Layer Stack option in Image Interpreter's Utilities menu. The Utilities menu should already be open from the previous work. 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\santee3-4.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. In the viewer 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 Imagine viewers that display the gray scale results of the band ratios, look in the title bar of the viewer to determine the layer. If you ordered them 4 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 window can be resized with the mouse and corresponds with the area displayed in the three small viewers. The box can be dragged around the larger viewer 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 name Yourname_bandratioing_lab07.img Please open them in a different machine to make sure you can see the images. 5