• No results found

Exploring ENVI 50 Manual

N/A
N/A
Protected

Academic year: 2021

Share "Exploring ENVI 50 Manual"

Copied!
195
0
0

Loading.... (view fulltext now)

Full text

(1)

Exploring ENVI

Copyright 2012

E3De, ENVI and IDL are trademarks of Exelis, Inc. All other marks are the property of their respective owners. ©2012, Exelis Visual Information Solutions, Inc.

Produced by Outreach Services Exelis Visual Information Solutions

4990 Pearl East Circle Boulder, CO 80301

(2)
(3)

Contents

Contents

INTRODUCTION ... 1

WHAT IS ENVI? ... 2

ENVIRESOURCES ... 2

ABOUT THIS TRAINING MANUAL ... 4

MASTERING THE BASICS ... 5

LEARNING OBJECTIVES ... 6

PREREQUISITES ... 6

REQUIRED TOOLS FOR COMPLETING THIS MODULE... 6

ASSOCIATED DATA ... 6

FUNDAMENTALS ... 6

SETTING PREFERENCES AND DISPLAY MANAGEMENT ... 8

EXPLORING THE ENVIINTERFACE ... 12

WORKING WITH A PORTAL, AND BLEND,FLICKER, AND SWIPE... 18

CHIPPING AND SAVING ... 19

SPECTRAL PROFILES ... 20

ENVIHELP ... 21

MORE ON SETTING PREFERENCES ... 22

SPATIAL AND SPECTRAL SUBSETTING ... 23

CLOSING FILES ... 26

SKILLS CHECK... 26

SELF TEST ... 26

RASTER DATA MANAGEMENT ... 27

LEARNING OBJECTIVES ... 28

PREREQUISITES ... 28

REQUIRED TOOLS FOR COMPLETING THIS MODULE... 28

ASSOCIATED DATA ... 28

READING RASTER IMAGE DATA ... 28

ENVI’S IMAGE FORMAT ... 29

THE ENVIHEADER FILE ... 29

MANAGING FILES ... 35

SKILLS CHECK... 36

SELF TEST ... 36

IMAGE DISPLAY CONCEPTS ... 37

LEARNING OBJECTIVES ... 38

PREREQUISITES ... 38

REQUIRED TOOLS FOR COMPLETING THIS MODULE... 38

ASSOCIATED DATA ... 38

STRETCHING IMAGE DATA ... 38

COLOR TABLES ... 42

RASTER COLOR SLICES ... 44

SKILLS CHECK... 48

SELF TEST ... 48

EXAMPLE APPLICATION: VEGETATION ANALYSIS ... 49

LEARNING OBJECTIVES ... 50

(4)

Contents

DARK SUBTRACTION ...53

TOPOGRAPHIC MODELING ...56

IMAGE TO IMAGE REGISTRATION ...57

BUILDING MASKS ...59

NORMALIZED DIFFERENCE VEGETATION INDEX (NDVI) ...61

STATISTICS ...62 3DSURFACEVIEW ...63 SKILLS CHECK ...68 SELF TEST ...68 VECTOR LAYERS ...69 LEARNING OBJECTIVES ...70 PREREQUISITES ...70

REQUIRED TOOLS FOR COMPLETING THIS MODULE ...70

ASSOCIATED DATA ...70

WORKING WITH VECTORS IN ENVI ...70

IMAGE REPROJECTION ...71

EDITING VECTOR LAYERS ...72

LINEAR FEATURE EXTRACTION ...74

SKILLS CHECK ...78

SELF TEST ...78

REGIONS OF INTEREST AND CLASSIFICATION TECHNIQUES ...79

LEARNING OBJECTIVES ...80

PREREQUISITES ...80

REQUIRED TOOLS FOR COMPLETING THIS MODULE ...80

ASSOCIATED DATA ...80

2DSCATTER PLOT AND REGIONS OF INTEREST ...80

SUPERVISED AND UNSUPERVISED CLASSIFICATION ...83

TERRAIN CATEGORIZATION ...100

SKILLS CHECK ...107

SELF TEST ...107

PRINCIPAL COMPONENTS ANALYSIS ...109

LEARNING OBJECTIVES ...110

PREREQUISITES ...110

REQUIRED TOOLS FOR COMPLETING THIS MODULE ...110

ASSOCIATED DATA ...110

INTRODUCTION ...110

SKILLS CHECK ...115

SELF TEST ...115

SPECTRAL LIBRARIES AND HYPERSPECTRAL PROCESSING TOOLS ...117

LEARNING OBJECTIVES ...118

PREREQUISITES ...118

REQUIRED TOOLS FOR COMPLETING THIS MODULE ...118

ASSOCIATED DATA ...118

INTRODUCTION ...118

SEQUENTIAL MAXIMUM ANGLE CONVEX CONE (SMACC) ...118

WORKING WITH SPECTRAL LIBRARIES ...123

SPECTRAL ANGLE MAPPER (SAM)CLASSIFICATION ...124

SKILLS CHECK ...131

SELF TEST ...131

EXTENDING ENVI ...133

(5)

Contents

PREREQUISITES ... 134

REQUIRED TOOLS FOR COMPLETING THIS MODULE... 134

ASSOCIATED DATA ... 134

INTRODUCTION ... 134

BAND AND SPECTRAL MATH ... 135

TIPS FOR WRITING EXPRESSIONS ... 136

BATCH PROCESSING IN ENVI ... 148

LIBRARY ROUTINES ... 151

ENVIEXTENSIONS ... 155

SKILLS CHECK... 161

SELF TEST ... 161

COLOR TRANSFORMS AND DATA FUSION TECHNIQUES ... 163

LEARNING OBJECTIVES ... 164

PREREQUISITES ... 164

REQUIRED TOOLS FOR COMPLETING THIS MODULE... 164

ASSOCIATED DATA ... 164

INTRODUCTION ... 164

COLOR TRANSFORMS ... 165

IMAGE TO IMAGE REGISTRATION ... 168

DATA FUSION USING COLOR TRANSFORMS ... 170

SKILLS CHECK... 171

SELF TEST ... 172

FEATURE EXTRACTION ... 173

LEARNING OBJECTIVES ... 174

PREREQUISITES ... 174

REQUIRED TOOLS FOR COMPLETING THIS MODULE... 174

ASSOCIATED DATA ... 174

FEATURE EXTRACTION WORKFLOW ... 174

EXTRACTING DARK ROOFTOPS WITH RULE-BASED CLASSIFICATION ... 175

SKILLS CHECK... 183

SELF TEST ... 183

MOSAICKING IN ENVI ... 185

LEARNING OBJECTIVES ... 186

PREREQUISITES ... 186

REQUIRED TOOLS FOR COMPLETING THIS MODULE... 186

ASSOCIATED DATA ... 186

INTRODUCTION ... 186

SKILLS CHECK... 189

(6)
(7)

Introduction

What is ENVI? ... 2 ENVI Resources ... 2 About this Training Manual ... 4

(8)

Introduction

What is ENVI?

ENVI® (the Environment for Visualizing Images) is the ideal software for the visualization, analysis, and presentation of all types of digital imagery. ENVI’s complete image-processing package includes advanced, yet easy-to-use, spectral tools, geometric correction, terrain analysis, radar analysis, raster and vector GIS capabilities, extensive support for images from a wide variety of sources, and much more.

ENVI can be used to perform numerous image analysis techniques, including multispectral classification, various types of spatial filtering, image registration, principal components transformations, band ratios, and image statistics. ENVI also has a unique suite of advanced spectral analysis tools designed specifically for working with hyperspectral data (although many are also appropriate for multispectral analysis) and a complete set of tools for working with radar data (both single band and fully polarimetric SAR). Furthermore, ENVI provides full access to the programming language in which it was written: the

Interactive Data Language (IDL)a powerful, yet easy to use, fourth-generation language whose programs can easily be incorporated into ENVI.

ENVI’s interactive analysis capabilities include:

 Multiple views capability allows you to easily compare images.

 Real-time extraction and linked spatial/spectral profiling from multi-band and hyperspectral data that provide you with new ways of looking at high-dimensional data.

 Interactive tools to view and analyze vectors and GIS attributes.  Standard capabilities, such as contrast stretching and 2D scatter plots.

ENVI + IDL, ENVI, and IDL

ENVI is enhanced by coupling it with Interactive Data Language (IDL®), a powerful structured

programming language that offers integrated image processing. The flexibility of ENVI is due largely to IDL’s capabilities.

There are two types of ENVI licenses:

ENVI + IDL — ENVI plus a full version of IDL ENVI — ENVI plus a runtime version of IDL

ENVI + IDL users can use IDL to customize their own command-line functions. Advanced ENVI + IDL users should find the flexibility offered by IDL’s interactive features helpful for their dynamic image analyses.

ENVI Resources

Exelis Visual Information Solutions has a team of Professional Services Group (PSG) consultants who provide custom software development; consulting services; and training to commercial, research, and government markets. The PSG team can either help you define requirements and lead your development cycle from prototyping to final installation, or they can join your project mid-stream and provide expert assistance.

Each PSG team member offers expertise in areas such as image processing; data analysis; visualization; software development; a broad range of scientific application areas; and government civilian, defense, and intelligence community requirements. If needed, some staff have the necessary security clearances to support classified projects.

(9)

Introduction

The PSG team is experienced in extending ENVI’s robust suite of user functions and batch programming capabilities, and it has up-to-date knowledge on recent product enhancements and future product direction. You can e-mail the Global Services Group at [email protected].

Contacting Exelis Visual Information Solutions

Call, email, or visit us online:

Exelis Visual Information Solutions 4990 Pearl East Circle

Boulder, CO 80301 USA Phone: 303-786-9900 Fax: 303-786-9909 Email: [email protected] Web: www.exelisvis.com

Training

Exelis Visual Information Solutions offers a full range of IDL and ENVI training courses for everyone from the beginning user to the experienced application developer. We teach courses on a rotating basis at our training facility in Boulder, Colorado. We also offer regional training classes every year at various locations in the United States, Europe, and Australia. For the latest training schedule, a detailed course outline, and/or the cost of a training course, call, send e-mail

([email protected]), or go online.

Tutorials

A number of ENVI tutorials are available on the ENVI website

(www.exelisvis.com/ProductsServices/ENVI/Tutorials.aspx) and on the data CDs that shipped with your ENVI software.

ENVI Support

If you experience a problem with ENVI, first verify that the issue is not a result of misinterpreting the expected outcome of a specific function or action. Double-check the ENVI Help, or check with a local expert. Make sure your system is properly configured with enough virtual memory and sufficient operating system quotas.

If the problem still occurs, report it to Technical Support quickly, so that the issue can be resolved, or a workaround can be provided. If you cannot find the information you need in the ENVI written guides or Help, report this to Technical Support as well, so that the documentation can be updated.

Contacting Technical Support

To report a problem, call, e-mail, or go online to submit a support incident: Phone: 303-413-3920

Email: [email protected]

Online Resources

There are two additional resources for ENVI support: the Exelis Visual Information Solutions website and the IDL newsgroup.

(10)

Introduction

support. The website includes access to user-contributed ENVI code, an ENVI user forum, an IDL user forum, and help articles. Go to www.exelisvis.com, select Support or User Community, then select an option.

ENVI tutorials and web seminars are also available on the ENVI website. Go to

www.exelisvis.com, then select an option.

IDL Newsgroup

The Usenet newsgroup comp.lang.idl-pvwave is dedicated to the discussion of IDL. Users post questions and answers and share information about their own IDL projects. Note that many Exelis Visual Information Solutions employees read this newsgroup, but they do not usually post messages to the group.

About this Training Manual

This is a training manual used to teach customers ENVI. It is designed to be a classroom training aid. However, if you cannot attend a training course, this manual is the next best tool for quickly learning and understanding ENVI.

We want you to learn ENVI and apply it successfully to your work. If you have any suggestions for improvements or additions to this manual, please let us know.

Most chapters in this manual are self-contained. In most cases you can pick up the manual in any particular functional area and start working with the exercise immediately.

Bold All ENVI menu options, dialog buttons, dialog fields, other dialog options, and values that you need to enter are bold.

Courier Filenames, directory paths, and IDL/ENVI programming variables are in a Courier font.

Numbered Steps Paragraphs beginning with a bold number designate commands that need to be performed for a particular exercise.

(11)

Chapter 1:

Mastering the Basics

Learning Objectives... 6

Fundamentals ... 6

Setting Preferences and Display Management ... 8

ENVI Help ... 21

More on Setting Preferences ... 22

Spatial and Spectral Subsetting ... 23

Closing Files ... 26

Skills Check ... 26

(12)

Mastering the Basics Learning Objectives

Learning Objectives

In this chapter you will learn how to:

 Use ENVI to display a multispectral image  Enhance, zoom, pan, and rotate the image

 Create a Portal and compare it to the original scene using blend, flicker, and swipe tools  Use Chip View To to take a screen capture of the image and save it to JPEG format  Change ENVI Preferences

Prerequisites

For this chapter it helps to have a basic understanding of remote sensing.

Required Tools for Completing This Module

 ENVI 5.0

Associated Data

 qb_boulder_msi – Quickbird image of Boulder, Colorado that comes with the ENVI installation.

 New_Zealand_WV2.dat – WorldView2 data set of New Zealand.

Fundamentals

The ENVI interface provides quick access to common display tools such as contrast stretching, brightness, sharpening, and transparency. You can work with multiple layers of data at one time and in several windows or views, using the Data Manager and Layer Manager to keep track of multiple data sets. ENVI’s Portal capability allows you to “punch through” layers to view and work with other layers below. In addition, ENVI will reproject and resample images on-the-fly. ENVI’s Toolbox contains many of the popular image processing tools.

Exercise #1: Starting ENVI and Exploring the Toolbox

1. In Windows, start a new ENVI session by clicking Start All Programs ENVI x.x ENVI+IDL. If you are working on a UNIX machine, then type envi at the UNIX prompt. 2. In ENVI + IDL, the IDL Workbench window (the control panel for the IDL session that is running

ENVI) is minimized at the bottom of the screen. This window (Figure 1) is only used for advanced techniques involved with customizing and extending ENVI but must be open to run ENVI + IDL. If you are running ENVI (vs. ENVI + IDL), access to the IDL Workbench is not provided, and therefore, the window is not displayed.

(13)

Fundamentals Mastering the Basics

(14)

Mastering the Basics Setting Preferences and Display Management

3. Once ENVI loads, you will see the single window interface (Figure 2). This is the primary control panel for working in ENVI, allowing you to do such things as open files and apply processing functions.

Figure 2: The ENVI Interface

4. Explore the options available in the ENVI Toolbox on the right side of the interface. There are literally hundreds of different tools available from this menu. Expand the categories by clicking on the plus symbol for them. Try to get an overview of what tools are available in each category. Note the location of the following tools:

 Edit ENVI Header is under the Raster Management menu  Building masks falls under Raster Management  Masking

 Principal Components Analysis (PCA) is under the Transform menu

5. At the top of the Toolbox list is Favorites. This is useful for quickly accessing tools you use often. To add a tool, click on it to select it and the large plus sign above the list will be clickable. Click on it to add that tool to your list of favorites. You can remove a tool from the list of favorites by selecting it and clicking the large minus sign.

Setting Preferences and Display Management

Opening files and displaying images is perhaps the most basic, yet fundamentally important task for image processing software. By default when you open a file, ENVI attempts to automatically display a true color or gray scale image based on your file type. In this exercise, you will change this preference. Displaying

(15)

Setting Preferences and Display Management Mastering the Basics

images in ENVI is simplified as much as possible by building in support for the most common data formats and by making a special control panel (Display Manager) dedicated to managing open files and creating layers of imagery. ENVI uses the red, green, blue (RGB) color display standard. This standard allows 256 levels of brightness (i.e., byte scale) in each channel (red, green, and blue) for each pixel. ENVI can display numeric data of any format (for example, floating-point temperature/thermal data), but to actually put those data on the screen as an image, it must be scaled to the 256 brightness values to be understood by the monitor. Fortunately, ENVI can do this with minimal user input.

Exercise #2: Setting Preferences and Displaying Images

Much of the ENVI interface and system-wide defaults are configurable. You can customize the ENVI configuration and save the changes as .sav files. For a Windows 7 installation, the ENVI preferences files are stored in this folder: C:\Users\username\.idl\envi\preferencesx_x-36-osname-bits\, where x_x is the software version osname is the operating system, and bits is 32 or 64.

1. From the ENVI menu bar, select File Preferences. The ENVI Preferences dialog appears. 2. On the left side of the dialog, select Data Manager.

3. On the right side of the dialog, click the Auto Display Method for Multispectral Files field and select CIR (color infrared) from the pull-down menu. This will cause image files to be displayed as color infrared by default.

4. Look at all the options for the Data Manager and ensure the following settings are selected: Auto Display Files On Open = True

Clear View When Loading New Image = False

Close Data Manager After Loading New Data = False.

5. Select Directories from the left side of the dialog and then click on the Output Directory field. Click on the pull-down menu and navigate to C:\ENVI_coursefiles\envidata\enviout and click OK to make this the output directory.

(16)

Mastering the Basics Setting Preferences and Display Management

6. Click OK to close the Preferences dialog.

7. From the ENVI main menu bar, select File Open.

8. With a default installation, ENVI looks for data in the Program

Files..\Exelis\ENVIxx\data directory, where xx is the software version number. Select the file qb_boulder_msi from the list, and click Open. The image is automatically displayed as color-infrared (CIR). You can also find data in the Program

Files..\Exelis\ENVIxx\classic\data directory.

9. Click on the Data Manager icon . The Data Manager lists the files that you have opened and allows you to select bands to display. When you open a file in ENVI, it is added to the top of the Data Manager list.

10. When you click on band names in the Data Manager, color assignments automatically cycle through red, green, then blue (in that order). Click the band name you want to assign to red. A red box appears next to the band name.

11. Select two other bands for green and blue. If one band is assigned multiple colors, a split box appears next to the band name, showing the colors. Click Load Data to see the new band combination.

(17)

Setting Preferences and Display Management Mastering the Basics

12. Right-click on the filename qb_boulder_msi and select Load True Color. ENVI looks for wavelength information in the header file to select which bands will make a true-color. The option to load a True Color or CIR image using the right-click menu requires that the bands in the file have wavelength information associated with them.

13. Right-click on one of bands of qb_boulder_msi and select Load GrayScale.

14. Click the Help icon at the bottom of the Data Manager. Scroll down a bit in Help and note that you can load a specific band as a grayscale image by right-clicking on that band and selecting Load Grayscale. Close the ENVI Help by clicking the X at the top right of the dialog window.

You will find quick access to helpful tips throughout ENVI. ENVI Help is also accessible via the Help menu.

15. Click on the File Information arrowhead in the Data Manager. Useful information found here includes file size and dimensions, data type, and map projection.

16. Click on Band Selection in the Data Manager. This is another tool you can use to select bands to display. The red button is currently the active one, so any band you click on will be placed there. Then the Green button will be active.

17. Position your mouse cursor over the toolbar buttons at the top of the Data Manager to view their pop-up labels. Note that you can open new files, expand and collapse files (experiment with these), close files, and pin the Data Manager to keep it on the screen or unpin it to have it automatically close when you load an image into the display. There is also a button to open a file in ArcMap. 18. Close the Data Manager by clicking the X on the top right of the dialog window.

(18)

Mastering the Basics Exploring the ENVI Interface

You can load multiple layers into ENVI at one time and manage those layers using the Layer Manager. By default, all layers in the Layer Manager are displayed in the Image window. You can temporarily hide the display of a layer so that you can work with other layers in the Image window. You can control the order of layers in the Image by dragging and dropping layers in the Layer Manager list or by using menu options.

1. Click and drag the CIR (bands 4,3,2) qb_boulder_msi to the top of the Layer Manager just below Overview. It should be visible as the top layer.

2. Click the check box for the top layer to deselect it. This hides the image from view. Click the check box again to display that layer again.

3. Right-click on one of the file names in the Layer Manager, and note the various options, including Display in Portal, change Order, and Send to ArcMap (you will not see Send to ArcMap if you are running in 64-bit mode). Select Remove.

4. From the ENVI menu select Views Create New View. The display is divided into two with one of the Views being empty. The new View is also listed in the Layer Manager.

5. Click the Data Manager icon to open it. Then right-click on one of the band names and select Load Grayscale. The band will be loaded into the empty View.

6. Experiment with other views by selecting Two Horizontal Views, 2x2 Views, etc.

7. Return to a 2x2 View. There will be four Views listed in the Layer Manager. Right click on the View at the bottom of the list and select Remove View. You will now have three Views with one of them extending across the bottom of the display. Use the Data Manager to place an image in any View that is empty. To select a View for updating, either click on it in the display or click on its listing in the Layer Manager.

8. Select Views One View and close the Data Manager.

Exploring the ENVI Interface

The ENVI interface includes a menu bar, toolbars, category bars, and a status bar. Much of the ENVI interface is customizable and provides options to make use of multiple monitors.

(19)

Exploring the ENVI Interface Mastering the Basics

Exercise #4: Working with ENVI’s Buttons and Sliders

1. Detach the Layer Manager panel by clicking the Detach button to the right of the Layer Manager category bar (see image above). Note that the Toolbox also has a detach button.

2. Reattach the Layer Manager panel by clicking the X on the top right of the Layer Manager window. 3. Close the entire Layer Manager panel by clicking on the collapse bar to the right of the categories

(see image above). This allows you to view a larger Image window. Now, open the Layer Manager panel by clicking again on the same bar (to the left of the Image window).

4. Collapse the Toolbox panel by clicking the arrow or collapse bar to the left of the Toolbox (see image above). Expand the Toolbox panel by clicking again on the same arrow or collapse bar. 5. Click the Cursor Value button . Then as you move your cursor around the display, you will see

the following information:

Geo: latitude/longitude coordinates are displayed if the image is georeferenced Map: coordinates are displayed if the image is georeferenced

Proj: projection name is displayed if the image is georeferenced File name

File: The cursor’s (sample, line) image coordinates (where the upper-left pixel in the image is the origin of the coordinate system)

(20)

Mastering the Basics Exploring the ENVI Interface

displayed.

6. Close the Cursor Value dialog. Then click the Crosshairs button . The Cursor Value dialog will appear again along with display Crosshairs. The Cursor Value dialog initially shows the

coordinates for the Crosshair. As you move your cursor around the image, the coordinates update to the cursor position.

7. Click somewhere in the display. The crosshairs will move to you and the Cursor Value dialog displays those coordinates. Move the cursor away from the crosshairs and the Cursor Value dialog will update. Now click on the arrow keys on your keyboard. The crosshairs will follow and the Cursor Value dialog will again display the coordinates of the crosshairs. Close the Cursor Value dialog and click the Crosshairs icon again to toggle it off.

8. The next button to the right is the Undo button . Click on this to undo the last change in the display. The next button redoes the change.

9. Click the Pan button then click and drag your cursor in the Image window to pan in the direction of the mouse. When in Select mode you can also use the middle mouse button to perform a pan. 10. Click the Fly button then click in the display and hold to continuously drift in the direction of

the cursor. Positioning the mouse further from the center of the display causes the drift to increase in speed.

11. The next four button icons are grayed-out. These are used for vector editing and are available when vector layers are displayed

12. The next several buttons are used for annotation. Experiment with them as you have time.

13. Click the Rotate button then click and drag the cursor in a clockwise or counter-clockwise direction to rotate the image. The degrees drop-down list near the middle of the upper toolbar interactively reports the current degree of rotation.

14. Click the Select button to exit the Rotate tool.

15. Click the degrees drop-down list on the toolbar and select 0°. Note that you can also use the North Up button instead of the 0° rotation to get the same orientation. The grayed-out Top Up button is used to orient the image when it contains Rational Polynomial Coefficient (RPC) information.

16. Click the Zoom button and then click and drag your cursor to draw a box around an area near the center of the image. This will zoom in to that area.

17. Click on the Fixed Zoom In and Fixed Zoom Out buttons. The current zoom factor and pixel scale are shown in the drop-down menu to the right. Click on the arrowhead for this menu and note the options for zoom factor (pixel scale). At the bottom of this list click on Use Map Scale. Now select some different map scales from the pull-down menu. Access the drop-down menu again and select Use Pixel Scale. This will return to the default behavior.

Note: Unless the contrast stretch tool is being accessed, the scroll bar on your mouse will also zoom in and out. You may have to click in the image display first to activate it.

(21)

Exploring the ENVI Interface Mastering the Basics

18. Click on the Zoom To Full Extent button . This is a useful button to view your entire image in the display.

19. In the Go To window, type in 660.5,390 and hit the ENTER key. This should center the image on a track near a large reservoir. If the Crosshairs are turned on, they will be placed on the location you specify. If you type in x, y locations and both values are integers or are outside the range used for Lat/Long, ENVI assumes they are pixel coordinates. If x and y values are greater than 30,000, append a "p" to one of the values to indicate it is a pixel coordinate, not a map coordinate. If the image is a subset, offsets are taken into account. Data coordinates are specified by appending an asterisk(*) after one of the coordinates.

20. Type 39 59 51N,105 12 28.5W in the Go To window. The display will be centered on a small beach jutting into the reservoir. Map coordinates (e.g., Easting and Northing in a UTM projection) can also be used with the Go To tool. Also, MGRS coordinates can be typed as an alphanumeric string. MGRS Northing and Easting values can have up to five digits of precision. Note that you can click on the arrowhead to access a pull-down list of previously used coordinates.

21. The next row of tools in the ENVI menu includes various sliders for Brightness, Contrast, Sharpen, and Transparency. Experiment with these. They can be manipulated in the following ways:

Click on the slider bar to the right or left of the indicator, or click the slider then use the Page Up or Page Down keys to move the slider up or down incrementally by ten percent.  Click on the icons at each end of the slider bar, or click the slider then use the arrow keys on

the keyboard to move the slider incrementally by one unit.

Click the slider then use the Home key on the keyboard to move the slider to 100 and the End key to move the slider to 0.

22. Click the Reset button on each slider to return them to their default values.

Exercise #5: Contrast Stretching and Other Tools

1. Experiment with different contrast stretches by selecting options from the drop-down list

. Once this tool is selected, you can use the mouse scroll button to access different stretches. If you choose Custom stretch, close the histogram window that appears; we will discuss this stretch below. The Stretch on Full Extent and Stretch on View Extent icons can be used to specify what part of the image is used to determine histogram statistics for the stretches. If you have multiple layers open, you can click on a specific layer to select it and have the sliders and contrast stretches operate on that layer. Click the Reset Stretch Type button to return to the default.

2. Access the Custom Stretch by either choosing it from the pull-down list or clicking on the icon. The pull-down menu of this tool is set to Linear to start. Type in a value of 0.05 in the Linear (Percent Value) window and hit the ENTER key. The display will update. Try values of 0.5 and 1.

(22)

Mastering the Basics Exploring the ENVI Interface

3. Select Gaussian from the Custom Stretch pull-down menu. For Gaussian (Standard Deviation) type in a value of 0.05. Try values of 0.5 and 1. Click on the Reset Dialog button to go back to the default.

4. Click on the Red button to view the histogram for the band displayed as red. You will see Black-Point and White-Black-Point values showing what data numbers (DN) values are set as upper and lower limits of the current stretch. If you are in Linear Stretch mode, typing in a Linear (Percent Value) will cause the Black-Point and White-Point bars to shift. You can also move the Black-Point and White-Point bars manually. This will automatically update the contrast stretch. If you move the bars to the end points, the Black-Point and White-Point windows will show the minimum and maximum values for the data set. Experiment with the other bands that are displayed by clicking on the Green button, and then the Blue button. When you are finished experimenting click on the Reset Dialog button to go back to the default. Close the Custom Stretch tool.

5. Click on the Mensuration tool . The Cursor Value tool will appear. Next click on the Polyline annotation button and click in the display to measure something of interest. Distances and headings between polyline nodes will be displayed in the Cursor Value dialog. If you want to keep the polyline, right click and choose Accept. If you wish to discard the polyline, right click and choose Clear. The Arrow annotation can also be used for calculating distance and heading. To clear all annotations still displayed, right click on the New Annotation layer in the Layer Manager and select Remove. Choose No to respond to the question about saving the annotation. To clear a single annotation, right click on it and choose Delete. When finished with annotation click on the Select button and close the Cursor Value dialog.

6. The Overview window provides a view of the full extent of the layers loaded into the display. To turn the Overview window on click in the check box for it in the Layer Manager . If you have multiple views in the display, each view has its own Overview. The view box is a smaller,

(23)

Exploring the ENVI Interface Mastering the Basics

partially transparent window inside the Overview window that shows the extent of the image visible in the main display.

7. Increase or decrease the size of the View box by clicking and dragging a corner of that box. This will zoom in or out on the displayed. The View box adjusts shape to maintain the proper aspect ratio of the display.

8. Click inside of the View box and drag it to any location within the Overview window to

dynamically update the Image window. Click outside of the View box in the Overview window to re-center the View box on the spot where you clicked.

9. As you move the View box around it leaves behind a “snail trail”. This helps by showing you which part of the scene you have viewed. To clear the snail trail right click Overview in the Layer Manager and select Clear Snail Trail. If you want to turn the snail trail off, right click on Overview and de-select Show Snail Trail.

10. Place your cursor in the display and note the information displayed in the Status bar at the bottom of the ENVI interface. You will see Latitude and Longitude in one block, and map projection and datum in the next. One block does not show anything currently. Right click in that block and you will see that NITF classification level is checked. This is not NITF data so nothing is displayed. You have the option to display anything on the list in any block during the current ENVI session. You can specify what you want for future ENVI sessions by changing ENVI Preferences. If a scene is not georeferenced you won’t see any map information in the Status bar.

Note: The Status bar always displays information about the base layer in the Layer Manager. For information on any other layer use the Cursor Value tool.

11. The right-most segment of the Status bar is the Process Manager. It displays the process name and status for the oldest running process, along with an option to cancel the process by clicking the Cancel Process button . When all processes finish, this segment becomes blank. As one or more processes are running, you can click the Process Description button to display a window that shows the name and status of each process, and the name of the input images.

(24)

Mastering the Basics Working with a Portal, and Blend, Flicker, and Swipe

Working with a Portal, and Blend, Flicker, and Swipe

A Portal is a window inside the display that allows you to view a layer below. A Portal is listed as a separate layer in the Layer Manager with a distinctive icon.

Exercise #6: Portals

1. Click on the Data Manager icon . Click on Band 3 to load it as Red, click on Band 4 to display it as green, and click on Band 1 for Blue. Then click Load Data to display the selected bands as a new layer. Recall you can also use the Band Selection tool at the bottom of the Data Manager to choose bands for display. Close the Display Manager

2. You will now see two images listed in the Layer Manager, and the Portal, Blend, Flicker, and Swipe icons above the display are now selectable. Click the Portal button on the toolbar. ENVI creates a Portal to display the lower layer and it is listed in the Layer Manager with the Portal icon

. If you have more than two layers open and you want to see one of the lower layers in a Portal, right click on that layer in the Layer Manager and choose Display in Portal.

3. Click and drag inside the Portal to move it around the Image window. 4. Click and drag on a corner or side of the portal to resize it.

5. Middle click in the display to access the Pan tool . As you pan around the image notice that the Portal stays in one spot while the image moves behind it.

6. You can attach (or pin) the Portal to the image so that the Portal moves with the main image. Place your cursor inside of the Portal near the top to display the Portal toolbar.

(25)

Chipping and Saving Mastering the Basics

7. Click the Pin button . The button changes to Unpin. Middle click and Pan around again. The Portal stays fixed to the image.

8. Place your cursor at the top inside of the Portal to display the Portal toolbar. Click the Unpin button on the Portal toolbar.

Exercise #7: Blend, Flicker, and Swipe

Blend, Flicker, and Swipe help you compare two different layers. You can use these tools for comparing entire images or you can use them inside of a Portal. These tools are enabled only when you have two or more layers open in the Layer Manager, and when you display at least one layer in the display.

1. Click on the green arrowhead at the top of the Portal. This starts Flicker. You can change the speed by clicking on the slower or faster buttons.

2. Click the Pause button on the Portal toolbar to stop Flicker.

3. Right-click inside of the Portal and select Blend. This adjusts the transparency of the top image. 4. Right-click inside of the Portal and select Swipe. Swiping automatically begins between the two

layers.

5. Click the Pause button on the Portal toolbar to stop the swipe.

6. Close the Portal by either clicking on the x button at the top of the Portal, right clicking on the Portal layer in the Layer Manager and choosing Remove, or right clicking in the Portal itself and choosing Close Portal.

7. Click on the View Flicker button at the top of the ENVI interface. This opens a new Portal that covers the entire display. Right click in the display and choose Close View Portal.

(26)

Mastering the Basics Spectral Profiles

Overview window, any enhancements, zooming, rotating, or Portals that are displayed in the image window are burned into the output image.

Exercise #8: Saving the Display

1. Click the Chip to File button on the ENVI toolbar. The Chip to File Parameters dialog appears. 2. From the Output File drop-down list, select JPEG. Next click the File Select button . The

Select Output Filename dialog appears.

3. Navigate to C:\ENVI_coursefiles\envidata\enviout, and type display_chip as the output filename. Click Open.

4. Click OK in the Chip to File Parameters dialog. The display chip will be listed in the Layer Manager and loaded into the display.

5. In the ENVI menu, click on File Chip View To and note the other options for output, which include Print, ArcMap, and PowerPoint.

6. Right click on the display_chip.jpg file in the Layer Manager and select Remove.

Spectral Profiles

In this step, you will open a spectral plot window and roam around the display. More will be done with this tool later.

Exercise #9: Opening a Spectral Profile Plot

1. From the ENVI menu bar, select Display Spectral Profile…. The Spectral Profile plot window appears. Click inside the display and drag your cursor around. The plot in the display updates to show the spectral profile for the pixel under your cursor.

2. Move your cursor into the plot. As you get near a specific band, the X and Y values at that wavelength will be displayed in the lower right corner of the plot window.

(27)

ENVI Help Mastering the Basics

3. Collect spectra in the plot by SHIFT clicking. Collect spectra from different land cover types to see how they compare.

4. Click on the arrowhead on the right side of plot window to show the plot key panel. All the spectra will be listed along with their pixel coordinates.

5. Right click in the plot and select Remove All.

6. Close the Spectral Profile plot. You will use the Spectral Profile tool again in a later chapter. 7. Right click on the View item in the Layer Manager and select remove All Layers.

ENVI Help

Extensive ENVI documentation is accessible from within ENVI, and printable documentation and tutorials are available on the ENVI web site (http://www.exelisvis.com/ProductsServices/ENVI.aspx). ENVI Help includes Contents, Index, Search, and Favorites tabs to help you find topics quickly and easily.

Exercise #10: Using ENVI Help

1. From the ENVI main menu bar, click on the Help→ Contents.

2. The Contents tab of Help is open by default. On the left side of this page, click the plus (+) sign next to Explore Imagery to expand this topic. Click on the Display Tools sub-topic. Information on many of the tools discussed in this chapter is shown in the right panel.

3. An even quicker way to find a topic in the Help is to use the Index tab to conduct a search of the index. Click the Index tab, then search for information on how to custom-configure ENVI by typing Preferences in the text window near the top, then hitting the ENTER key. You will set some preferences in the next section.

(28)

Mastering the Basics More on Setting Preferences

5. Under Title you should see Preferences listed with a Rank of 1. Click on the Star button to add it to Favorites.

6. Click the Favorites tab. You will see Preferences listed as a Favorite Topic. Clicking on this shortcut allows you to quickly access this section of ENVI Help.

Note: Many of ENVI’s tools, including the Data Manager, have the Help icon you can click for more information on that tool.

More on Setting Preferences

Exercise #11: Changing the Output Directory and Other Options

1. From the ENVI main menu bar, select File Preferences. The Preferences dialog appears.

2. Click on Directories. This is the most commonly customized part of ENVI. For this class, all of the data you will be using are contained here C:\ENVI_coursefiles\envidata. Click on Default Input Directory then click on the black arrowhead to browse for this folder. After you navigate to it and select it, click OK.

3. Make sure that your Output Directory still says ENVI_coursefiles\envidata\enviout. All of the output files produced during the class will go into this subdirectory.

4. Click on the Display General listing. Note that you can change the Middle Mouse Action in the display, Mensuration Units, and Geographic Coordinate Format. You can also specify what item goes into each of the three Status Bar Segments.

(29)

Spatial and Spectral Subsetting Mastering the Basics

5. Click on the Annotation listing. Note that you can set up properties for the various types of annotation.

6. Click the OK button to close the Preferences dialog.

Spatial and Spectral Subsetting

For many applications, it is helpful to think about multispectral data sets as a 3D cube with all of the bands stacked on top of one another (as in the figure below).

Visualizing image data in this manner makes it easy to see that multispectral images provide information in two distinct domains: spatial and spectral. The spatial domain of the data represents an area within any one band (in sample/line space), while the spectral domain of the data represents the response of any one pixel in all of the bands (in band space).

Many processing algorithms can be categorized as either spatial or spectral, depending on the domain from which the data are extracted for processing. For example, image registration is a spatial function, while image classification is a spectral function. When applying routines such as these, it is convenient to define the part of the image that you would like to work on at the time the processing is being set up. In ENVI, you can easily do this through the use of the standard file input selection dialog.

samples

li

n

(30)

Mastering the Basics Spatial and Spectral Subsetting

Exercise #12: Defining Subsets

1. From the ENVI Toolbox, expand Raster Management and double click on Resize Data. The Resize Data Input File dialog appears.

2. To open up the data set you will subset, click Open→ New File. Then browse to C:\ENVI_coursefiles\envidata\WorldView2 and double click on New_Zealand_WV2.dat. In the Resize Data Input File dialog, notice that:  The right side of the dialog window lists a summary of the image characteristics.  If your processing function allows for image subsetting, then the Spatial Subset and/or

Spectral Subset buttons appear at the bottom of the dialog.

3. Click the Spatial Subset button. The Select Spatial Subset dialog appears, allowing you to define spatial subsets in several different ways:

 The sample and line ranges can be explicitly typed using the fields provided.

Clicking the Subset Using Image button allows you to drag and re-size a box on a thumbnail picture of the image to define a subset.

If the image is georeferenced, clicking the Subset Using Map button allows the subset to be defined by entering map coordinates.

 You can subset your image using the area of another image, or you can subset your image based on the area encompassing selected regions of interest (ROIs) or ENVI Vector Files (EVFs).  The Open drop-down button allows you to open an ROI File, or EVF File. The Previous button

automatically applies the last spatial subset used to the current selection (this can save time when the same subsets are being applied to multiple images).

(31)

Spatial and Spectral Subsetting Mastering the Basics

4. Click the Subset Using Image button and define an area that captures only the left half of the image, similar to the image shown at right (the exact subset is not important for this exercise).

 To resize the box, click on the corner of the box and drag.

 To move the box, click inside the box and drag to the new location.  Click with the left or middle mouse button to center the box on the cursor.

(32)

Mastering the Basics Closing Files

Click OK. The Select Spatial Subset dialog reappears with the sample and line ranges from your selection entered into the corresponding fields. You can make additional changes to the subset here if you want.

5. Click OK. You are back to the Resize Data Input File dialog. Click OK again.

6. The Resize Data Parameters dialog appears with the output file dimensions. You have the option to change the pixel size here.

7. Click Choose and browse to the output directory if necessary. Type in an output file name of NZ_WV2_sub.dat and click Open. Click OK to perform the process.

8. The subset will be displayed on top of the input file. Inspect your subset result by adjusting the zoom level and panning around.

9. When finished, right click on the View listing in the Layer Manager and select Remove All Layers.

Closing Files

Once a file is opened in ENVI, it always remains open until the session is ended or you manually choose to close the file. However, because data from the files are only read when needed, having many files opened does not consume any memory. Nonetheless, sometimes it is useful to remove an opened file from the ENVI session.

Exercise #13: Close Files

1. Open the Data Manager and click on Close File button or Close All Files button. You can also close files by right clicking on a file in Data Manager and selecting either Close File or Close All Files.

2. Close the Data Manager.

Skills Check

At this point you should:

 Know how to create RGB or Gray Scale displays  Know how to find and use ENVI Help

 Understand how to change ENVI Preferences  Know how to spatially subset an image.

Self Test

1. From this point forward, when you write a new file to disk from ENVI, where is it written by default?

(33)

Chapter 2:

Raster Data

Management

Learning Objectives... 28 Prerequisites ... 28 Required Tools for Completing This Module ... 28 Associated Data ... 28 The ENVI Header File ... 28 Reading Raster Image Data ... 28 ENVI’s Image Format ... 29 The ENVI Header File ... 29 Managing Files ... 35 Skills Check ... 36 Self Test ... 36

(34)

Raster Data Management Learning Objectives

Learning Objectives

In this chapter you will learn how to:

 Read various types of raster image data into ENVI  What ENVI standard image file format means  What ENVI header files are and how to edit them  Useful file management techniques

Prerequisites

For this chapter it helps to have a basic understanding of remote sensing. You should also know how to display an image in ENVI.

Required Tools for Completing This Module

 ENVI 5.0

Associated Data

 FlKeys.tif – Quickbird image of Florida. This data set is a high-resolution (2.8 m pixel size) multispectral image from DigitalGlobe’s QuickBird satellite. It is a subset of a scene acquired in 2002. It covers an area in the Florida Keys, USA (Cudjoe and Cedar Keys). It has been

geometrically corrected to a UTM projection and distributed in GeoTIFF format. ENVI

automatically reads the information from the GeoTIFF tags embedded in the file and can easily import the data and map information.

Note: Image courtesy of DigitalGlobe (www.DigitalGlobe.com). The data is to be used for class exercises only and any other use of the data including resale, distribution or reproduction, or for purposes other than noted above without the prior written permission of DigitalGlobe is strictly prohibited.

 bldr_tm.dat - Landsat TM scene over Boulder, CO, which does not currently have an ENVI header.

Reading Raster Image Data

There are hundreds of different formats for storing image data, which can often make working with remote sensing data difficult. ENVI uses a very flexible method for importing raster data that allows virtually any type of image data to be imported. ENVI also includes custom readers for common remote sensing formats, as well as for generic and special image formats produced by other image processing software. The custom readers are found under the File  Open As option in the ENVI menu bar.

Image files open in ENVI almost instantaneously regardless of size. When roaming around the image the display refreshes rapidly. The reason for this is that ENVI uses pyramid files which are copies of the data file at various reduced resolutions. ENVI only builds pyramids for a data file the first time you open it. When you open the data file thereafter, it displays more quickly because it accesses the previously built pyramid file. For some compressed data formats, ENVI does not need to create a pyramid file.

Pyramids are used to speed image display by reducing the resampling required when displaying large portions of an image at low resolution. The Process Manager in the Status bar shows the progress of building pyramids when you first open a data file.

(35)

ENVI’s Image Format Raster Data Management

By default, pyramid files are created in the directory containing the original data file. If this directory is unavailable (due to write permission, for example), ENVI attempts to write the pyramid file in directory set in the Alternate Header Directory preference. If this is not available, ENVI uses the IDL temporary

directory.

ENVI’s Image Format

ENVI image files (those generated by ENVI) are stored in the simplest possible generalized raster format, which consists of a binary stream of bytes without embedded non-image data or structural elements of any type. This format is typically referred to as a flat-binary file and is commonly described as a “lack of format” because of its simplicity.

Because the image file does not contain embedded non-image data, each file has an accompanying ASCII file called the ENVI header file which contains all of the information needed to read the data in as an image.

Exercise #1: Reading Image Formats and Header File Input

1. From the ENVI menu bar, select File Open As and examine the list of supported formats. ENVI’s numerous custom readers make it possible to read very complicated formats, such as the 10-bit compressed AVHRR Level 1B, RADARSAT, or TOPSAR data. Other file types in the list are flat binary but contain embedded binary data that describe the image; or they have special format header files which specify the image dimensions, wavelengths, or map information. In addition, ENVI can read formats from other vendors, such as Multi-Resolution Seamless Image Database (MrSID) compressed format single-band or three-band files, or Enhanced Compressed Wavelet (ECW) images.

When using one of the custom readers for file import, ENVI automatically extracts all of the information contained in the input file and enter its image bands into the Available Bands List. In some cases, the image format being read includes not only the information required for reading the data itself but also ancillary information such as georeferencing data, wavelengths, or band names. You are not required to know any details about data files to import them into ENVI.

With each new ENVI release, and as more instruments are developed, the list of supported formats with special custom readers in ENVI is expanded.

2. From the ENVI Toolbox, expand Raster Management and double click on Edit ENVI Header. 3. In the Edit Header Input File dialog, click on the Open tab and select New File. Then navigate to

the envidata\QuickBird directory, select FlKeys.tif, and click Open. Note the

dimensions, interleave, data type, and file size listed in the File Information panel. Click OK. The Header Info dialog appears.

The ENVI Header File

Image files opened in ENVI have an ENVI header file associated with them. This is true even for images that are stored in memory only or that are imported into ENVI in their native format (without being

converted into ENVI image format). The ENVI header file is a small ASCII text file that contains the basic information that ENVI must know in order to read the image data (such as the number of samples, lines, and bands), as well as any other ancillary information available (such as band names and wavelengths). When importing a file using one of ENVI’s custom readers, ENVI extracts the necessary information from the files and then automatically generates an ENVI header file. When reading an image without a custom reader in

(36)

Raster Data Management The ENVI Header File

Header files are always named with the same root name as the image data file but with a.hdr extension. Thus, in most cases, after a file has been read by ENVI, you end up with a pair of files for each image - the image file and the ENVI header file.

When reading an image in its native format (for example, a TIFF file), ENVI only creates a header file in memory. However, if you add any more information to the file that cannot be stored in the image’s native format (for example, adding band names to a TIFF image), ENVI creates a.hdr header file.

Required Information

The Header Info dialog provides access to the editable fields in the ENVI header file. The fields that are required are shown in the main Header Info view. The required image descriptor fields are:

 Number of samples per band  Number of lines per band

 Number of bands in the entire file

 Offset (in bytes) of embedded header data before the image data begins  Data type (i.e., number of bytes per image pixel)

 Byte order (related to the type of operating system that wrote the data)

 File type (a list of ENVI categories; ordinary raster images are ENVI standard)  Interleave (the storage format for multi-band images)

The two remaining fields, xstart and ystart, are not technically required. These two values define the image coordinates to use for the first pixel in the image (i.e., the upper-left pixel). By default, the upper-left pixel is assigned a value of (1,1). Changing these values introduces an offset in the image coordinates reported by tools like the Cursor Value. However, it does not in any way change or subset the actual image data.

Optional Information

The header file can also contain a wealth of ancillary information about the image, ranging from a simple text description to detailed map projection information, band wavelengths, associated DEM file, and

(37)

The ENVI Header File Raster Data Management

instructions for how to display the image. All of the optional fields are accessed using the Edit Attributes drop-down button.

4. In the Header File dialog, click the Edit Attributes drop-down button and examine the optional fields available. Some fields are only appropriate for special file types so they are unavailable (grayed out).

5. Select Wavelengths. The Edit Wavelength values dialog appears. If the wavelengths for the bands do not appear, then first click on Band 1, then in the text edit window that appears type in 0.485 and hit the ENTER key.

6. Band 2 will be selected now. For Band 2 type in a value of 0.560 and hit the ENTER key. 7. For Band 3 use a wavelength value of 0.660 and for Band 4, a value of 0.830.

8. Click on the drop-down menu for Wavelength/FWHM Units and choose Micrometers. Then click OK.

9. In the Header File dialog, click the Edit Attributes drop-down button and select the Map Info option. The Edit Map Information dialog appears.

The Map Information header field defines georeferencing information for the image by specifying the projection into which the image is geometrically corrected, as well as a reference pixel for which a map coordinate and pixel size are defined.

The Map Information for the Florida QuickBird image was filled out automatically by ENVI’s custom QuickBird reader when the image was opened.

10. Click Cancel to return to the main Header Info dialog, then click OK again to exit the Header Info dialog. The Data Manager and the Layer Manager will now show wavelength values. You may see the display update as well with this new header information.

11. In the Layer Manager, right click on the View listing and select Remove All Layers.

About Header Values

Data Types

ENVI currently supports nine different IEEE data types, each defined in the table below. When defining the ENVI header for a new file that contains integer data, it is critical that you know the number of bytes per image pixel and whether or not the integer is signed (can have negative values) or unsigned (only positive values)

Table 1: ENVI Data Types

ENVI Data Type Bytes-per-pixel Range of values

Byte 1 0 to 255

Integer (signed) 2 -32768 to +32767

Unsigned integer 2 0 to 65535

Long integer (signed) 4 Approx +/- 2 billion Unsigned long integer 4 Approx 0 to 4 billion

Floating point 4 +/- 10

Double precision 8 +/- 10

Complex (floating point) 8 Real and imaginary are floats Complex (double precision) 16 Real and imaginary are doubles

(38)

Raster Data Management The ENVI Header File

interleaves: band sequential (BSQ); band interleaved by line (BIL); and band interleaved by pixel (BIP). Even though we often visualize a multi-band image as a cube, in the computer’s memory the entire image is really just a continuous stream of bytes. The interleave describes how this stream of bytes for the multi-band image are ordered in memory.

For BSQ images, the stream of bytes runs through each full image band sequentially (from the upper-left pixel to the lower-right pixel), then begins again at the first pixel of the next band. Thus, the data for any given image band are next to each other in memory, allowing very fast access for extracting spatial data or displaying images. BIP images are stored in the opposite order, where each pixel spectrum is next to each other in memory (i.e., each band’s value for pixel 1, then each band’s value for pixel 2, etc.). This

arrangement allows very fast access to spectral data but relatively slow access to spatial data. BIL images use a storage order that is a compromise between BSQ and BIP. In BIL images, the same line from each band is stored next to each other in memory (i.e., line 1 of all bands, then line 2 for all bands, etc.). See the figure on the next page for an illustration of the three interleaves.

Byte Order

DEC workstations and PCs read and write binary data in a slightly different manner than older Macintosh and UNIX operating systems. Because ENVI can run on all of these platforms, it is important to know which type of operating system wrote the image data that is being imported. The two byte orders are called Host (Intel), which reads the least significant byte first (for the DEC workstations and PCs) and Network (IEEE), which reads the most significant byte first (UNIX and older Macintosh). If the file was created in ENVI, then this header field is automatically set so that the file can be read into ENVI on any of its supported platforms.

(39)

The ENVI Header File Raster Data Management

Exercise #2: Defining an ENVI Header

If the image does not have an ENVI header file — that is, if it has never been opened in ENVI before — a header file can be generated. After defining the required header information, ENVI writes the header file to disk and uses it whenever the file is read into ENVI in the future. Because the data for this exercise have been subset into a small scene, the original Landsat header information no longer applies and the custom readers cannot be used.

1. From the ENVI Toolbox, expand Raster Management and double click on Edit ENVI Header. 2. In the Edit Header Input File dialog, click on the Open tab and select New File. Then navigate to

the envidata\boulder directory, select the bldr_tm.dat file, and click Open. After the file is opened, ENVI searches for a file called bldr_tm.hdr, the name the associated ENVI header file would have if it exists. If an ENVI header does not currently exist, an empty Header Info dialog appears.

3. Given the following information about this image file, if the needed parameters are missing, type them in.

Note: Because ENVI is a cross-platform application, the Windows TAB key to move between fields is disabled. However, it is best to get into the habit of hitting the ENTER key when filling in ENVI

(40)

Raster Data Management The ENVI Header File

Samples 702 Lines 863 Bands 6 Offset 0 bytes

File Type ENVI Standard Byte Order Host (Intel)

Data Type Floating Point (i.e., 4-bytes per pixel) Interleave BIP

Band Names = Band 1, Band 2, Band 3, Band 4, Band 5, Band 7

4. To enter the band names, click the Edit Attributes drop-down button, and select Band Names. Make sure there is a Band 6 but no Band 7 in the list. If necessary you would click on Band 6 and change that to read Band 7, and hit the ENTER key. Click OK.

5. Unlike the Florida QuickBird image, the Boulder TM image is not georeferenced. The image has been geometrically corrected; however, the Map Info has not been entered into its ENVI header file. Click the Edit Attributes drop-down button, and select Map Info. The Edit Map Information dialog appears.

6. Use the pixel with an image coordinate of (526,645) for the reference pixel. In the Image X field, type 526. In the Image Y field, type 645.

7. The Boulder image is in a UTM projection, Zone 13 N. Click the Change Proj button. Select UTM and type 13 in the Zone field. Keep the datum at its default setting of North America 1927. Click OK to set the new projection.

8. Enter the following UTM map coordinate values for the reference pixels: in the E (easting) field, type 480168.67; in the N (northing) field, type 4427572.69.

9. The Landsat TM image pixel size is 30 m. In both the X Pixel Size and Y Pixel Size fields, type 30.0.

(41)

Managing Files Raster Data Management

11. Next, you will define the wavelengths for the six bands. Click the Edit Attributes drop-down button, and select Wavelengths. The Edit Wavelength values dialog appears.

12. ENVI allows wavelength values to be read directly from an ASCII file (this is particularly convenient for hyperspectral data sets where you may have hundreds of bands). Click the Import ASCII button, navigate to the envidata/boulder directory, select the twave6.asc file, and click Open. This file contains both the wavelengths for the six TM bands and also the full-width-half-maximum values (FWHM) for these bands.

13. The Input ASCII File dialog appears. In the Wavelength Column field, type 1. In the FWHM Column field, type 2, then click OK to return to the Edit Wavelength Values dialog.

If the ASCII file contained only wavelengths, you could leave the FWHM Column empty; it is convenient to import it with the wavelengths if it is available.

14. Click OK in the Edit Wavelength Values dialog then click OK in the Header Info dialog to accept the ENVI header file information. The image will now be displayed.

15. Close the Edit Header Input File dialog.

16. Ensure that the Boulder TM image listing in the Layer Manager now specifies band wavelengths.

Managing Files

There is no limit to the number of files that can be opened simultaneously in ENVI; therefore, you may find yourself with so many bands available that you can’t find the one you are looking for. This problem can be

(42)

Raster Data Management Skills Check

Exercise #3: Additional File Management Tools

Folding Images

When several multi-band images have been opened, the Data Manager List can become quite crowded. One solution for this problem is to temporarily collapse all of the bands in a multi-band file into a single entry in the list.

1. Open the Data Manager by clicking on its icon just to the right of the Open folder icon. At the top of the Data Manager are plus (+) and minus (-) icons. To collapse the bands so that only the filename is listed, click on the Collapse All (-) icon. The individual bands are no longer displayed.

2. To expand all files, click on the Expand All (+) icon.

3. You can collapse or expand individual files by click on the or icons next to each file listing in either the Data Manager or the Layer Manager.

4. Close the Data Manager.

5. Collapse and expand the listings in the Layer Manager by clicking on the Collapse All and Expand All icons at the top of the Layer Manager.

6. When you are finished with this exercise, right-click on bldr_tm.dat in the Layer Manager, and select Remove.

Skills Check

At this point you should:

 Know how to open specific file formats in ENVI  Know how to edit ENVI headers

Self Test

1. What are the items in the header file that ENVI needs to know in order to display an image? 2. How can you collapse and expand file listings in the Data Manager?

(43)

Chapter 3:

Image Display Concepts

Learning Objectives... 38 Prerequisites ... 38 Required Tools for Completing This Module ... 38 Associated Data ... 38 Stretching Image Data ... 38 Color Tables ... 42 Raster Color Slices ... 44 Skills Check ... 48 Self Test ... 48

References

Related documents