Exercise #1 Name: _______________________________ Geography 475 Digital Image Processing Image Display/Initial Statistics Extraction/Evaluation of Multivariate Image Statistics Due: Feb. 1, 2010 Part I: Image Display Start ERDAS by double-clicking its desktop icon or by selecting it from the Start Menu. After the software loads, an icon panel and viewer are displayed. The icon panel organizes Imagine tools into broad categories. The viewer is where data are displayed. Find the directory Z:\geog475\exercise1\. Inside that directory is a raw Landsat 7 ETM+ (Enhanced Thematic Mapper Plus) data. The data set is band sequential (BSQ) and each band is in tagged image file (TIF) format. Landsat ETM+ has 8 spectral bands with varying spatial resolutions (see Table 1). You have the first 4 bands on the hard drives. Table 1: Landsat 7 and ETM+ Characteristics Band No. Band Name Spectral Range (nm) 1 Blue-Green 450-515 2 Green 525-605 3 Red 630-690 4 Near Infrared 750-900 5 Middle Infrared 1 1,550-1,750 6 Thermal Infrared 10,400-12,500 7 Middle Infrared 2 2,090-2,350 8 Panchromatic 520-900 Spatial Resolution (m) 30 x 30 30 x 30 30 x 30 30 x 30 30 x 30 60 x 60 30 x 30 15 x 15 Although TIF is not the native format of Imagine, the software can display TIF files. There are several ways to load data into the viewer. For example, you can select File/Open/Raster Layer. As an alternative, you can simply click on the yellow folder icon below “File.” Lastly, you can press Ctrl+R on the keyboard. Chose one method, and load the band named “L71033026_02620000728_b40.tif.” Note that you must change the “File of type:” selection to “TIFF (*.tif)” before the files will appear. In case you are wondering, the characters in the file name mean: L7 = Landsat 7 033 = Row Number 026 = Path Number 2000 = Year of Acquisition 07 = Month of Acquisition 28 = Day of Acquisition b4 = Band 4 Once the image is loaded, the viewer still appears to contain no data. This is because the data set does not extend to the full extent of the viewer. You can “find” the image using the pan tool (it looks like a hand) or the scroll bars at the bottom and along the right-hand side of the viewer. Pan across the viewer until you find the image data. Use the zoom in tool (either click repeatedly or draw a zoom box) to zoom in on an area until you can see individual pixels. 1. Considering the instrument and band, how large of an area on the Earth’s surface is represented by each individual pixel? Remember that each pixel contains one, and only one, digital number (DN). You can examine the DN for individual pixels using the inquire cursor (the icon that looks like a crosshair). Note that you can move the inquire cursor around the image and get information on DN (file pixel) and gray scale value (LUT Value). You are also given the row (y) and column (x) location of the cursor (in this case the values are UTM coordinates). 2. Scroll the cursor across a single pixel. Does the DN value change within the pixel? Why or why not? 3. Considering the band, what do these DNs represent? 4. Why do DN and LUT value differ? Now, zoom back out. There are a few ways to do this. The slow way is to use the zoom out tool, or you can use a special command. Let’s use a special command. First, close the inquire cursor. Next, maximize the area of the viewer (by clicking the middle icon on the upper right corner of the viewer window). Then, select View/Scale/Image to Window. The image extent should now fit within the viewer. The area shown is of North Central North Dakota. Using one of the 1:250,000-scale USGS maps provided for reference, complete Table 2 by providing an approximate row, column (UTM) coordinate for each of the following images features (zoom into each to have a closer look and use the inquire cursor): Table 2: UTM Coordinate of Selected Image Features Feature X Coordinate Center of the City of Minot Minot AFB Bottineau Round Lake Carpenter Lake Y Coordinate Reduce the size of the viewer and open a second viewer by clicking on the viewer icon on the icon panel. Into this viewer load ETM+ bands 1 and 3, one at a time. In general terms, describe any similarities and/or differences in appearance between Band 4 and each of these other bands (e.g., gray tones of different features, clarity, spatial resolution, etc.). To assist in this task, it is beneficial to “link” viewers. First, select View/Tile Viewers. This puts the viewers side by side. Next, select View/Link-Unlink Viewers/Geographical. Read the instructions in the box that appears carefully, and left click inside of the viewer you want to link to. The viewers are now linked geographically. Pan around, zoom in and out, and use inquire tool to explore this handy feature. Band 1: Band 3: O.K. … enough of the gray scale. Let’s make some color composites! We first need to “stack” the imagery into one file. Click on the Interpreter icon on the icon panel. This loads several options. Next, click on Utilities. Finally, click on Layer Stack. The layer stack dialog box is similar to most dialog boxes in Imagine. You are prompted for an input file or files, and asked to name the output file. Click the yellow folder icon under “Input File (*.img). Navigate to the directory in which the data are stored. Change “Files of type:” to “TIFF (*.tif)” and select Band 1. Click OK. Now look at the dialog box. The term “Unsigned 8 bit” has been inserted to describe the input data set. This means the data are 8-bit (DNs contained are between 0 and 255). Next, click Add. This adds Band 1 to the stack we are creating. Repeat the process to add Bands 2-4 to the stack. The next step is to supply an output name. Use your own zip disk to save your files. Your zip disk will be your working directory. Back in Imagine, click on the yellow folder icon to send the output to the directory you just created (e.g., D:\Rundquist) and call the file 072800_ncnodak. Note that the output file is now an Imagine Image (*.img). IMG is the native (and proprietary) format for ERDAS. Click OK to start the process (it will take some time to run … these are large files!). When the processing completes, load the file into a viewer. Maximize the viewer and fit the image to the window. To display a true color composite, select Raster/Band Combinations. Using the information from Table 1, assign proper ETM+ bands to appropriate monitor color guns to produce a true color composite. Now, spend some time looking at features on the image. In general terms, describe the appearance of the following features: Water: Agricultural Fields: Turtle Mountains: Clouds: Urban or Built-Up Areas: Even though it is only possible to display three bands at a time, you can get DNs for each pixel across all bands using the inquire cursor. Use the inquire cursor to get DNs for one sample pixel in the vicinity of each of the following features to complete Table 3. Table 3: DNs on Multi-Color Composites Feature X Y Cloud Minot North Carpenter Lake South Carpenter Lake Green Ag. Field Brown Ag. Field B1 B2 B3 B4 5. Do sample pixel DNs in Table 3 closely predict the color of each feature on the true color composite? Explain. Now, create a standard false-color composite (display NIR reflectance as red, red reflectance as green, and green reflectance as blue). For this view, in general terms and in relation to the true color composite, describe the appearance of the following land cover types: Water: Agricultural Fields: Turtle Mountains: Clouds: Urban Areas: Because the image file size and geographic extent is so large, let’s pare it down some. Reduction in the geographical extent of an image is called subset. To create a subset, select Utility/Inquire Box. A small box is placed within the image. Using the arrow tool, move and resize the box so it contains Minot AFB, the City of Minot, and Buffalo Lodge, Mud, and Rock lakes. Once the extent is set, click Apply. From the icon panel, select Interpreter, Utilities, and then Subset. The input file is the stacked image you created (072800_ncnodak). Save the output file in your working directory and call it “minot_area”. For “Subset Definition” make sure you next click From Inquire Box. Then, click OK. After processing is complete, load the new file into your viewer. We now have an image file that is much more manageable. Change the image to display a standard false color composite. Close the image. Part II: Initial Statistics Extraction / Evaluation of Multivariate Image Statistics Open the new image Z:\geog475\exercise1\minot_area_072800.img. The file is a preprepared subset of the same scene you worked with earlier. The file should load in standard false color composite form. Maximize the viewer and fit the image to window. Gather univariate statistical information for each band in the image stack to complete Table 4. Do this by selecting Utility/Layer Info. This loads a window that contains a lot of useful information about your image. Note there are four tabs in the window. The first provides general information about each band, the second describes the map projection, the third displays band histograms, and the fourth shows pixel data. Table 4: General Statistical Information for Minot Area Image Band Min Max Mean Median Mode 1 (Blue) 2 (Green) 3 (Red) 4 (NIR) 5 (MIR1) 6 (TIR) 7 (MIR2) 8 (Pan) Std. Dev. 6. Which image band shows the greatest amount of statistical variance (i.e., has the highest standard deviation)? Which image band shows the least? Open a second viewer. Load the same image file into the second viewer. Display the gray scale image of the band with the greatest variance in one viewer, and the gray scale image of the band with the least variance in the other. 7. Which band has the greatest contrast? Based upon this exercise, what do you conclude concerning the relationship between standard deviation and image contrast? 8. In relative terms, do all image bands in the stack have closely-related means, medians, and modes? If not, which band or bands show the greatest disparity between the three measures? 9. Display the histograms for those bands. Is there evidence that each is multimodal? Are the histograms skewed? If so, is the skew positive or negative? Multivariate statistics often are used to examine redundancy between image bands. Although important in multispectral remote sensing, such techniques are especially important in the analysis of hyperspectral data (which often have 200+ spectral bands). The section also introduces ERDAS’s Spatial Modeler, a powerful tool worth learning. Unfortunately, ERDAS does not have a “button” to push to produce variance-covariance and correlation matrices. You must write a simple “program” to do it. Click on Modeler on the icon panel. Then, click on Model Maker to open a new model and the tool bar. Programs created with the Spatial Modeler require inputs, functions, and outputs. This exercise will walk you through this model, and you will gain a better understanding of how it works. First, you need an input file. The Modeler accepts raster or vector inputs. In this case, the input is raster. So, click on the tool that looks like this: . Now, click anywhere in the blank area of the modeler window. Your window should now contain the symbol for an input raster stack with a question mark underneath it. The second step is to create a function symbol. Click on the icon and then click in the modeler window somewhere below the raster stack symbol. Your model should now contain symbols for a raster input and a function. Next, you need an output. In this case, you want a matrix as your output (since you will create variance-covariance matrix). Click on the icon in the tool bar and drop the symbol in the modeler window somewhere below the function icon. You must now indicate the “data flow” through the model. Click on . Use this tool to “connect” the input raster stack to the function, and then connect the function to the output matrix (“drag” the arrow between the first symbol and the next). At this point, your model should look something like this: Double-click on the input file in the modeler. This loads a dialog box that asks for the name of the input file. Click on the yellow folder icon under “File Name:” and select the file H:\geog475\exercise1\minot_area_072800.img. Click OK. Note that the file name is now shown under the input raster symbol. Next, double-click on the function icon. This opens another dialog box. Make sure “Functions:” is set to Analysis. Then, click once on the selection COVARIANCE ( <raster> ). This inserts the covariance function into the bottom portion of the dialog box. You must define the <raster> variable. Using the mouse, “highlight” the word <raster> in the function and then hit the Delete key on the keyboard. Next, click on the “Available input:” called $n1_minot_area_702800. This indicates that you want to run covariance on the entire image stack. Click OK. Finally, double-click the matrix symbol. In this dialog box, select Output (as you wish to create a matrix). Under “Write to File:” go to your working directory and call the output file “minot_covar”. Click O.K. Click the red lightning bolt icon at the top of the modeler window to run the program. When complete, use MS Excel to look at the matrix. Place the values from the Excel file into the variance-covariance matrix (Table 5 below). You can shorten each value to 2 decimal places. Table 5: Variance-Covariance Matrix 1 2 3 4 1 2 3 4 5 6 7 8 5 6 7 8 Now, run a correlation analysis. Go back to the model and add another function symbol. Then, add another output matrix. Connect the new symbols to your data flow with arrows. Your model should now look something like this: Double-click on the new function icon. Again, make sure “Functions:” is set to Analysis. Then, click once on the selection CORRELATION ( <covariance_matrix> ). This inserts the correlation function into the bottom portion of the dialog box. Now, however, you must define the <covariance_matrix> variable. Your input matrix is the covariance matrix calculated in the previous step. Using the mouse, “highlight” only the word <covariance_matrix> and then hit Delete. Next, click on the “Available input:” called n3_Output (or whatever the program is calling your covariance matrix). Click OK. Double-click on the new output matrix symbol. Select Output. Under “Write to File:” go to your working directory and call the file “minot_corr”. Click O.K. Click the red lightning bolt icon at the top of the modeler window to run the program. When complete, use Excel to view the file. Place the values from the Excel file into the correlation matrix (Table 6) below (shorten each value to 2 decimal places). Table 6: Correlation Matrix 1 2 3 1 1.00 2 1.00 3 1.00 4 5 6 7 8 4 5 6 7 8 1.00 1.00 1.00 1.00 1.00 10. Which bands are highly correlated (r greater than 0.85)? Why? 11. Which band or bands show little correlation with any other? Why? 12. What is the practical application of this type of correlation analysis? The optimum index factor (OIF) is often used to determine the band combination that will display at once maximize variance and minimize correlation (and thus maximize information content). Calculate OIF for the following band combinations (show your work): 1,2,3 = 1,4,5 = 3,4,5 = 3,4,7 = 3,5,7 = In the viewer, display the color composite for the band combination with the highest OIF. 13. In terms of the types of energy detected by each of the bands in your combination, discuss why this combination maximizes information content. Unless you want to explore the data further, please delete the contents of your working directory.