GISC 7365: Remote Sensing Digital Image Processing Dr. Fang Qiu Lab Two: Image Profiling, Band Combination and Data Format Objectives of this lab: In part I, you will learn how to interpret imagery using profiling tools. In part II, you will learn how to extract information from the displayed image by creating different color composite of multispectral images and become familiar with the feature’s signature. In part III, you will learn how to convert image to different image format. Part I. Image Profiles ERDAS Imagine also offers some image profiling tools that may be helpful in interpreting and analyzing imagery. In this section we will work through the Spectral, Spatial, and Surface profiling tools. Open ERDAS Imagine In the Viewer #1, open the TM image of Charleston, SC (i.e., charleston_11-9-82tm.img). Set Red = band 4, Green = band 3 and Blue = band 2. Select Raster and then select Profile Tools. Select Spectral and OK. The Spectral Profile Viewer is displayed. Select the Create New Profile Point Tool (+). Place the tool in Viewer #1 and select a target for each of the four features, i.e., water, wetland, vegetation, and urban, of the Landsat TM image. File Name charleston_11-9-82tm.img Quick View Location Charleston, SC Sensor Landsat TM Spatial 30 m x 30 m Temporal November, 1982 Band 1 = Blue (0.45-.52) Band 2 = Green (.52-.60) Band 3 = Red (.63-.69) Spectral Band 4 = NIR (.76-.90) Band 5 = MIR (1.55-1.75) Band 6 = MIR(2.08-2.35) Band 7 = TIR(10.4-12.5) 1 RGB=4,3,2 Altitude 705 km From what is displayed in the Spectral Profile Viewer, describe what the x and y axis stand for? Which band or bands are the best to separate the four features based on you spectral profiles? ERDAS Imagine also provides a data bank of spectral profiles that can be accessed in the Spectral Profile Viewer as well. In the Spectral Profile Viewer window, select View and then SpecView. Scroll through the different spectrums of the individual minerals. The first data bank is provided by the JPL (NASA Jet Propulsion Lab). Two other banks are available from the USGS (United States Geological Survey) and ERDAS. To access them, you just need to change the Source in the Spec View Viewer. The USGS provides mineral spectra, while ERDAS only has a few profiles for basic land covers from Landsat TM data. How might the data banks of spectral profiles be useful to a remote sensing analyst? When finished, close the Spec View Viewer (File > Close). Also, close the Spectral Profile Viewer (File > Close). Homework: The Spatial Profile tool is a powerful utility that allows you to draw transect across an image and follow how the image reflectance varies across transect. Leave the image displayed in Viewer #1. In the Viewer #1 window, select Raster and then Profile Tools. Select Spatial and OK. The Spatial Profile Viewer is displayed. Use the Create New Polyline Tool and draw a transect that starts from the water, across the wetland and ends in forest. The profile of that transect will be displayed in the Spatial Profile Viewer. Q1. Go through each band's profile. Which band best describes the change of the three land cover across the transect based on your judgment? When finished, close the Spatial Profile Viewer (File > Close). The last profiling tool we will look at is the Surface Profile. It allows you a quasi-threedimensional view across the spectral plane of a delimited area. Leave the image displayed in Viewer #1. In the Viewer #1 window, select Raster and then Profile Tools. Select Surface and OK. The Surface Profile Viewer is displayed. Using the Create Box Tool, draw a box which contains water, wetland and vegetation. The spectral profile across of the box should be displayed in the Surface Profile Viewer. 2 Draw additional boxes which contain boundaries between water and land. Compare the surface profiles of those boxes for each band. Q2. Which band contrasts the water and land best? When finished, close the Surface Profile Viewer (File > Close). Part II. Band Combination Open six viewers by repeatedly clicking on the viewer icon in the main panel. Place all viewers adjacent to one another by using the View > Tile Viewers. Open charleston_11-9-82tm.img in Gray Scale, Layer: 1, Fit to Frame in the first Viewer. Repeat the same procedure in Viewers 2 through 6, for Landsat TM Bands 2, 3, 4, 5 and 6. Each band displayed has unique spectral signatures for the different features on the image. Answer the following questions. Which two bands provide more water penetration? Why is vegetation dark in band 1 and 3? Which band(s) provides more detail on wetlands and why? In which bands is vegetation more bright and why? File Name charleston_11-9-82tm.img Location Charleston, SC Sensor Landsat TM Spatial 30 m x 30 m Temporal November, 1982 Spectral Band 1 = Blue (0.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) Band 7 = TIR(10.4-12.5) Quick View RGB=1,2,4 Altitude 705 km In Viewer #1, select File > Close Other Viewers to close viewers 2 through 6. In Viewer #1, Open charleston_11-9-82tm.img Landsat TM Band 7 in Gray Scale as layer 7. Why does band 7 looks fuzzy compared with the other six bands? 3 Now open charleston_11-9-82tm.img as True Color. Red-4; Green-5; Blue-3. This is a color composite of TM Bands 4, 5, 3 (R, G, B). Below, list next to the feature the color(s) shown on the screen. Water: Wetland: Vegetation: Urban/Developed Areas: What does this tell you about the spectral information in the different bands and the color guns used for monitor display? In the same image, select Raster - Band Combinations. Change Layer Combinations to Red4, Green-3, Blue-2. Click Apply. Below, list next to the feature the color(s) shown on the screen. Water: Wetland: Vegetation: Urban/Developed Areas: What does this tell you about the spectral information in the different bands and the color guns used for monitor display? For example, why vegetation appears red in this layer combination? Experiment! Experiment with other band combinations by applying the same techniques. True Color is seen as Red-3, Green-2, Blue-1. Click on Close when finished. Homework: File Name mi-FL_10-21-88spot.img Location Marco Island, FL Sensor SPOT XS Spatial 20 m x 20 m Temporal October 21, 1988 Spectral Band 1 = Green (.50-.59) Band 2 = Red (.61-.68) Band 3 = NIR (.79-.89) Band 4 = Panchromatic (.51.73) Quick View Altitude 832 km Open mi-fl_10-21-88spot.img as True Color. Red-3; Green-2; Blue-1. This is a color composite of XS Bands 3, 2, 1 (R, G, B). Q3. Below, list next to the feature the color(s) shown on the screen. Water: Vegetation: Urban/Developed Areas: 4 Q4. What does this tell you about the spectral information in the different bands and the color guns used for monitor display? Changing band combinations. While still in Viewer #1, select Raster then select Band Combinations. Change Layer Combinations to Red-3, Green-4, Blue-1. Click Apply. Q5. Why does this band combination provide more detail than the previous one? Open the four individual bands in four different viewers. Q6. Which band is the best for road extraction by your judgment? Part III: Data Formats and Import/Export. Beginning with this exercise we will use images in formats other than IMAGINE’s .img, such as .bil format. The .bil suffix signifies that the files were stored in one of the generic binary image formats. In this lab, we will learn how to import and export images through IMAGINE’s Import/Export facilities. Click on the Import Icon on the main panel. This will bring up the Import/Export dialog. Make sure the Import option is on. Specify file Type as Generic Binary and specify Media as File. Navigate to T:\QIU\RSDIP\data and select mi_8-2-97cams as the input file. After you have specified the input file, a file with the same name but with an .img extension should automatically be named in the Output File column. Make sure the file is going to output to the correct directory, click OK and wait for another pop-up dialog to appear. In this dialog, you need specify the # of rows, # of cols, and # of bands. Use word pad to open mi_8-2-97cams.hdr for these information. When you are ready to import the image click OK. When the import job has completed, click OK from the job state dialog (the OK will be active when it is done) and then click Close button in the Import/Export dialog. Now display the imported mi_8-2-97cams.img image in the Viewer. Set RGB as band 6, 4, and 2 respectively. Homework: Most web browser and image display software can display neither .img nor .lan files. In order to display an image in those software, we need to export an image in .img or .lan format to a more common image format, such as .jpg file. Next, we will use IMAGINE’s Import tool to do this. Click on the Import/Export Icon on the main panel. This will bring up the Import/Export dialog. Make sure the Export option is on. Specify file Type as JFIF(JPEG) and specify Media as File. 5 Navigate to T:\QIU\RSDIP\data and select charleston_12-8-90tm.img as the input file. After you have specified the input file, a file with the same name but with a .jpg extension should automatically be named in the Output File column. Make sure the file is going to be output to the correct directory, click OK and wait for another pop-up dialog to appear. In the Export JFIF Data dialog, click on the Export Options button. Set Select Layers as 4, 2, 1. The JPEG image will be a false color composite image of the TM band 4, 2, 1. Click OK. Click OK in Export JEPG Data dialog. Wait until the exporting finished. Then click Ok in the job state window. Use either web browser (simply open Internet Explore, and drag the .JPEG file into the window), or image display software, such as Paint under Accessories, to view the exported .jpg file. Q7. Paste the .jpg file on your word file. Q8. Briefly describe (you may want to use simple illustrations) the logic and differences between the three common generic binary data storage formats and any advantages or disadvantages of each including: band sequential (BSQ), band interleaved by line (BIL), band interleaved by pixel (BIP). GISC 7365: Remote Sensing Digital Image Processing Dr. Fang Qiu Introduction to ENVI- Optional Part I: Zoom in/out, pan, scale, rotate and magnify an Image To start ENVI. Select Start All Programs ENVI 4.6.1 ENVI. The main ENVI menu bar appears when the program has successfully loaded and executed. Open an img file. Select File open image file select charleston_12-8-90tm.img, then an available bands list will pop up. 6 From Available Bands List, select RGB Color. 3 radio buttons appear with “R”, “G”, and “B” illustrated next to each radio button. The “R” radio button should be selected (if it is not already selected then select it). From Available Bands List select “Band 4”. Notice that the text box next to “R” is filled in with Band 4 and the “G” radio button is automatically selected. From Available Bands List select “Band 3” and then “Band 2” to complete the RGB 4-32 band assignments. Designate a “new display” and click “Load RGB” at the bottom of the Available Bands List window to display a true color image. Three display windows appear. These three windows are called display group. They are Main Image window, Zoom window, and Scroll window. The individual image windows of a display group can be re-sized, moved to anywhere on the screen. The Main Image window consists of a portion of an image displayed at full resolution. This window is automatically displayed the first time you load an image. In the Main Image window (or Image window), the Display menu bar contains five pulldown menus that control all of the ENVI interactive display functions. The Scroll window is a small image display window that appears when an image is larger than can be displayed in the Main Image window at full resolution. The image in the Scroll window is displayed at subsampled resolution. The Scroll window controls what portion of the image is displayed in the Main Image window. The Zoom window is a small image display window that displays a portion of the Main Image window at a user-defined zoom factor based on pixel replication or interpolation. 7 The zoom window size, location and the default zoom factor are initially set in the envi.cfg file and can be modified. The Zoom window provides unlimited zoom capabilities, and the zoom factor is displayed as a number in parentheses in the window's title bar. Zoom In and Out and Pan the Zoom Window Move the mouse cursor in the Zoom window and click the left mouse button to reposition the magnified area by centering the zoomed area on the selected pixel. Clicking and holding the left mouse button in the Zoom window while dragging causes the Zoom window to pan within the Main Image display. Clicking the left mouse button on the – (minus) graphic zooms down by a factor of 1. Clicking the middle mouse button on this graphic zooms down by a factor of 2. Clicking the left mouse button on the + (plus) graphic zooms up by a factor of 1. Clicking the middle mouse button on this graphic zooms doubles the Zoom factor. To reset the zoom factor to 1, click in the Zoom window with the right mouse button to display the shortcut menu and select Set Zoom Factor to 1. Click the left mouse button on the far right graphics box to toggle the Zoom window crosshair cursor on and off. Click the middle mouse button on this graphic to toggle the Main Image crosshair cursor. Click the right mouse button on this graphic to toggle the zoom box in the Main Image window on or off. Scroll the Image A red box in the Scroll window indicates what portion of the entire image is currently displayed in the Main Image window. You can move the selected area by clicking inside the scroll indicator box with the left mouse button and dragging the box to a new position. The displays in the Main Image is updated when you release the mouse button. You can also reposition the scroll indicator box by clicking at the desired location outside of the box using the left mouse button (as for the Zoom window box). If you click, hold, and drag the left mouse button, the Main Image window is updated as you drag (the speed depends on your computer resources). Finally, you can move the scroll indicator box by clicking in the Scroll window and pressing the arrow keys on your keyboard. To move in larger increments, hold the Shift key while pressing the arrow keys. Resize the Windows You can resize the display windows the same way you would resize windows in other applications, by dragging any of the corners. Note, however, that you cannot make the Main Image window larger than the image size. When the Main Image window is large enough to display the entire image, the Scroll window is unnecessary and is automatically removed from your screen. The Scroll window reappears if the Main Image window is resized smaller than the full image. Scroll Bars 8 The Main Image and Zoom windows can also have optional scroll bars, which provide an alternate method for moving through the image. To toggle scroll bars on or off in either window, right-click in the window and select Toggle Display Scroll Bars or Toggle Zoom Scroll Bars To set whether scroll bars are automatically displayed in either window by default, select File Preferences from the ENVI main menu, click the Display Defaults tab, and use the arrow toggle buttons to change the setting. Part II. Information Extraction from Landsat TM. File Name charleston_11-9-82tm.img Location Charleston, SC Sensor Landsat TM Spatial 30 m x 30 m Temporal November, 1982 Spectral Band 1 = Blue (0.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) Band 7 = TIR(10.4-12.5) Quick View RGB=1,2,4 Altitude 705 km Displaying Gray Scale Images Select File open image file select charleston_11-9-82tm.img. From available bands list, select Gray Scale. Click band_1 and click new display at the bottom of the window click load band. The same process is for band_2 and band_3 till band_6. Remember every time click new display. Otherwise the new loaded band will overwrite the previous one. You can do similar work as that in Erdas Imagine. Right click charleston_11-9-82tm.img in Available Bands List window and select Close Selected File. An ENVI Question dialog will appear indicating that the image file is open in listed display windows. Select yes to close the displays and corresponding file. Displaying Color Images Select File open image file select charleston_11-9-82tm.img. From Available Bands List, select RGB Color. Select “Band 3”, “Band 2” and then “Band 1” to complete the RGB 3-2-1 band assignments. Designate a “new display” and click “Load RGB” at the bottom of the Available Bands List window to display a true color image. Repeat the process to open a 4-2-1 false color image in a new set of Image/Scroll/Zoom windows. 9 Linking Image Displays In one of either the True Color or False Color image display menu bars, select Tools Link Link Displays… to open the Link Displays dialog Leave the x and y offsets alone, make sure Dynamic Overlay is set to “on”, and Transparency is set to 0 and click “OK”. The two display windows are now linked. Move around either image scene using the left mouse button in the either of the two “Scroll” windows. Notice that the two image displays move together. Left mouse click in either of the two image (or zoom) windows to dynamically flicker between the true and false color images. Middle mouse click to change the size of your dynamic overlay. Hold down the left mouse button and drag in either the image or zoom window to pan the dynamic overlay. Right click in any of the windows to open the quick menu. Select “Adjust Transparency” and set the value to 50. Flicker between the two images with the left mouse button and observe the transparent overlay capability. Part III. Image Format and Processing Storage Format Right click charleston_11-9-82tm.img in Available Bands List window and select “Edit Header…” The Header Info dialog displays the format of the image stored on disk. Note the Interleave field. This exercise will change the storage format of the image. Go back to ENVI main menu to select Basic Tools Convert Data (BSQ, BIL, BIP) Select charleston12-8-90tm.img as input file, press Ok. Select BIL as Output Interleave type and Enter Output File name Press Ok and Display the output Bil File in a new Display Window. Processing Example – Contrast Stretching The brightness distribution of an image can be adjusted to highlight particular features of interest. The image histogram is a statistical tool used to understand the brightness, contrast, and other statistical measures of an image. This example will use “interactive stretching” on the image histogram to illustrate brightness level adjustment. Load the charleston_11-9-82tm.img 4-2-1 false color image as explained in the previous exercise. Click Enhance Interactive Stretching… to open the interactive histogram stretching dialog. There are 6 options under the menu bar (File, Stretch_Type, Histogram_Source, Defaults, Options, and Help). Be sure to select “Image” under Histogram_Source as this will give you statistics for the entire image. Left mouse click the dashed lines on the “Input Histogram” and drag them across the histogram. Observe the output result under “Output Histogram”. Click apply to see the result on the input image. 10 The Stretch_Type menu provides a list of mathematical functions that can be applied to the input histogram. The Defaults menu provides a list of default, commonly used, operations to adjust brightness levels on the input image. Select Defaults [Image] Linear 2%. Observe the brightness change in the image output window. Apply the skills learned in the earlier exercises to experiment with other default brightness adjustments on both color and gray scale images. Try flickering between a gray scale and color image. Saving results to a file In the Image window click File Save Image As Image File… to bring up the Output Display to Image File dialog. Here you can change the radiometric resolution of the output file, save spatial subset image chips, and specify the file type to output (e.g. JPEG, BMP, etc) Alternatively a processing result can be saved to memory if you don’t want to output images at each step of your processing chain. (BE AWARE: The result is stored in internal memory and further processing can become slow if too many images are stored). Experiment with saving an image to your “My Documents” as a jpg and reloading the image using File Open External File Generic Formats JPEG. Choose UTM Zone 17. Also experiment with saving the file as a default ENVI .img file. Notice that a .hdr file is also saved at the same location containing the storage format information for the img file. When moving the .img file from one computer to another make sure the .hdr file is moved with it. Otherwise you will have to remember the storage format of the image data. Homework (extra credit 10) Q9. Open charleston_11-9-82tm.img (RGB=432) and save it as .JPEG (Resolution: 24-bit color BSQ). Paste the .JPEG file on your word file. Convert the charleston_11-9-82tm.img to BIP format and save the file as charleston_11-9-82tm.bip. Open .hdr file with wordPad. Copy its contents and paste them on the word file. GISC 7365: Remote Sensing Digital Image Processing Dr. Fang Qiu Using Image Analysis for ArcGIS -Optional Open ArcMap, then click Image Analysis under Windows menu Add and Display Images Click the Add Data button. In the Add Data dialog, select the dallas_etm_1.tif, dallas_etm_2.tif, dallas_etm_3.tif, dallas_etm_4.tif, dallas_etm_5.tif, dallas_etm_6.tif, and dallas_etm_7.tif. Click Add to display the images in the view. 11 Layer Stack The downloaded Landsat ETM+ data is a multispectral dataset with individual bands in separate files. You can consolidate the bands of data into one file using Composite. Select all the currently open layers in Image Analysis window, and click Composite Bands icon to include them in the layer stack. Rename the output image as dallas_etm_layerstack.img. Display Image with Different RGB Composites Right click on the dallas_etm_layerstack.img layer in TOC, click on Properties to open Layer Properties dialog. Click Symbology tab, select RGB Composite under Shows, and make RGB = Band_4, Band_3, and Band_2. Click Apply and OK. A NIR false color composite image will be displayed. You can also click on the RGB color box of the legend for color composite image to change band combination. Set RGB = Band_3, Band_2, and Band_1 to display a natural color composite image. Subset Image Subset image function allows you to copy a portion (a subset) of an input data file into an output data file. With this function, you can create a subset from the image to include only the area of your interest (i.e. spatial subset). You can also generate a subset of your selected bands from an image with multiple bands (such as Landsat ETM+ data) (i.e. spectral subset). The subset image function can be used to subset an image either spatially or spectrally, or both. Subsetting an image spectrally: Open ArcToolBox, and Navigate to Data Management tools\Layers and Table views\Make Raster Layer For Input raster, click dallas_etm_layerstack.img. Navigate to your working directory, and name the output image as dallas_etm_subset_spectral_layer. For bands, select 1:5, 7 (select band 1, 2, 3, 4, 5, 7). Click OK. Select dallas_etm_subset_spectral_layer, right click and select Data> Export Data … Set location to your personal folder, Format as IMAGINE Image, and Name as dallas_spec_sub.img. Press Save button to complete. Subsetting an image spatially: Select dallas_etm_layerstack.img in Image Analysis window Click the Zoom In tool, and draw a rectangle over the area you want to subset (such as Downtown Dallas). Click Clip Icon in Image Analysis window. 12 Homework (Extra credit 10) Q10. Subset the dallas_etm_layerstack.img both spatially (DFW airport) and spectrally (bands 2, 3, 4) and save the output as dfw_etm_234.img. Turn in a word file containing all answers for Q1-Q10 and dfw_etm_234.img file into eLearning drop box. 13