lab #2 manipulating files in envi ii · 1 lab #2 manipulating files in envi ii name: lab #2: for...

12
1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce the student to the options and commands in ENVI in order to: Use ROIs to create class images Perform post classification analysis Manipulate color display and make annotations The questions provided within this lab are designed to help the student better understand the practical details of programming in IDL and are recommended but are not for assessment. Location: RS/GIS Lab Login: XXXX Password: XXXX

Upload: others

Post on 24-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lab #2 Manipulating Files in ENVI II · 1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce

1

Lab #2 Manipulating Files in ENVI II Name:

Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce the student to the options and commands in ENVI in order to:

• Use ROIs to create class images • Perform post classification analysis • Manipulate color display and make annotations

The questions provided within this lab are designed to help the student better understand the practical details of programming in IDL and are recommended but are not for assessment. Location: RS/GIS Lab Login: XXXX Password: XXXX

Page 2: Lab #2 Manipulating Files in ENVI II · 1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce

2

Before you start: Double click the ENVI icon on the desktop: This starts both ENVI (The Environment for Visualizing Images) and the IDL (Integrated Development Language) programming interface Ignore IDL but don’t close it as this closes ENVI as well.

Task # 1 Creating a Class Image Using ROIs 1.1 Viewing the Images With your mouse pointer, select File/Open image file and by using Browse select the file IKON_mscmtn_texture from the C:\ATRS directory and press ok. This will open the available bands list. Double clicking on Resize (Layer_1) will load the image in Display. This is the panchromatic band of an IKONOS image of Moscow Mountain. The spatial-resolution of the image is 1m. This image was selected for this exercise as it contains many nice textures. Now select File/Open image file and by using Browse select the file IKON_mscmtn_NRGB. This file is the 4m IKONOS data that has been resampled to (i) cover the same area as the 1m data AND to (ii) simulate the 1m-pixel size (i.e. 16 pixels all have the same value).

ENVI 4.0.lnk

Page 3: Lab #2 Manipulating Files in ENVI II · 1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce

3

Using the instruction form lab session 3, create three ROIs in covering the areas A, B, and C. Using your knowledge of imagery, guess what each of A, B, and C are: A) B) C) Now following the instructions in lab 3, create and then choose suitable names for ROIs in each of these areas and then select File/Save ROIs from the ROI Tool window menu bar. Select all the ROIs, choose a suitable file name, and press ok. Task #2 Producing the Reference Image In this task, you are going to use these saved ROIs to produced a supervised classification, which we will then use a reference or ground-truth image in our analysis. From the Main ENVI menu bar select Classification/Supervised /Maximum Likelihood and select the file IKON_mscmtn_NRGB and press ok. Then as in lab 3, press Select all Items to choose all the ROIs, give the output a suitable file name, select no to Output Rule Images, and press ok. Now display the classified image a new window. What do you think of the classification; does it appear to accurately capture the three different surface types? Are there any areas that are particularly misclassified?

A

B

C

Page 4: Lab #2 Manipulating Files in ENVI II · 1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce

4

Although, this image is by no means perfect, for the sake of this exercise we are going to assume that it accurately represents the ‘truth’ on the ground. Now in the ROI Tool window press delete until all the ROIs have disappeared (otherwise they will come back to haunt us, even if the ROI Tool window is closed), and then close the ROI Tool window. Task #3 Classifying the 1m Data For this task, we are going to produce a classification of the 1m data. Firstly, lets tidy up the computer screen and close the displays that we are not using. Only keep displayed the IKON_mscmtn_texture. [Note although we will explore classifications in more detail in lab 8, we briefly cover a couple of methods here] From the Main ENVI menu bar, select Classification/Unsupervised/Isodata and with keeping all the default options chose a suitable filename and press ok.

Page 5: Lab #2 Manipulating Files in ENVI II · 1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce

5

You can notice that the image is recognizable. To determine how many classes the ISODATA routine produced, select Enhance/Interactive Stretching from the Main Image menu bar of the ISODATA classified image. The maximum value of the input histogram tells you how many classes are present. Now open a new display with the RGB IKONOS image and then link the two displays using the Tools/Link/Link Displays option from one of the Main Image window menu bars (any one) and press ok. Now double left click on the Main Image window of the ISODATA image to bring up the Cursor Location/Value window. Now move the mouse pointer around and look at what ISODATA values have been assigned to different areas of the image. Now, bring up the ROIs that we saved earlier by selecting Tools/Region of Interest/ROI Tools from the Main Image Window of the ISODATA image.

- In the ROI Tools menu bar select File/Restore ROIs and select your saved ROI file and press ok.

- Once the ROIs have loaded, delete the first ROI, which you will notice contains no points. This is a default ROI, which we don’t need.

- Next select OFF so that you don’t accidentally create any new ROIs Now to determine which ISODATA classes are best to assign to each region, lets look at the min, max, mean and standard deviation of the values within each ROI. This is done by selecting Options/Stats for all Regions from the ROI Tool menu bar:

Page 6: Lab #2 Manipulating Files in ENVI II · 1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce

6

You will notice that if we assign values based on the mean ± 1 standard deviation, this would result in (with my values): Forest = 2.22 ± 1.6327 = ISODATA Values ~ 1-4 Grass = 5.34 ± 0.8942 = ISODATA Values ~ 5-6 Soil = 6.94 ± 0.2482 = ISODATA Values ~ 7 Task #4 Producing a Class Map of the ISODATA Image To assign these classes, we need to use the ROI Tool again. Firstly, delete all the existing ROIs and close all the windows except the ROI Tool window and the ISODATA image. From the ROI Tool menu, select Options/Band Threshold to ROI. Select the ISODATA Image and Press ok. In the Band Threshold to ROI Parameters window, select 1 as the Min Thresh Value and 4 as the Max Thresh Value. Call this ROI Name Forest and press ok. For the Forest, choose a green color, by clicking on ROI color and searching until you find green. Press yes when it tells you the number of pixels. Repeat these steps for both the grass (Yellow: min = 5; max = 6) and the Soil (Magenta: min = 7; max = 7). Your entire ISODATA image will now be colored in. To make these ROIs into a classed image that we can compare with the supervised classification we made earlier you need to select Options/Create Class Image from ROIs from the ROI Tool menu bar. When prompted, press Select All Items and press ok. Next, save the file with a suitable file name (i.e. IKON_class_image) and press ok. Now before, looking at the image, delete all the ROIs and close all the display windows.

Page 7: Lab #2 Manipulating Files in ENVI II · 1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce

7

Task #5 Comparison of the Classed and Reference Image Display and Link the reference and classes images:

In this task, we will assess the accuracy of the classed image, through using the assumption that the reference image represents the truth. From the Main ENVI menu bar select Classification/Post Classification/Confusion Matrix/Using Ground Truth Image. [Note this can also be done just using ground truth ROIs, which you could have obtained by matching pixels to GPS coordinates] For the classification input file select the ‘classed’ image and for the ground truth file select the ‘reference’ image. In the Match Classes Parameters window just click on the matching classes and press Add Combination. Once each of these are done press ok. Finally, press No for Error Images and press ok. This will produce a confusion matrix.

Page 8: Lab #2 Manipulating Files in ENVI II · 1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce

8

Questions: 1. From a visual comparison between the classed and reference imagery, how good to you think the classification is?

Page 9: Lab #2 Manipulating Files in ENVI II · 1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce

9

2. What pixels are particularly misclassified [Hint: Display the RGB or NIR/R/G images and using the link option compare all three images]? Explain why this might be? 3. Is the Overall Accuracy value good or bad? Please explain your answer: 4. Is the Kappa value good or bad? Please explain your answer: 5. Can you think of any general ways to produce more accurate reference imagery in future exercises?

Page 10: Lab #2 Manipulating Files in ENVI II · 1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce

10

Task #6 Color Displays and Annotations Close all the files by selecting File/Close All Files form the Available Bands List menu. Now open and display the file Bots_npp. This is a Net Primary Productivity map of northern Botswana created using SPOT vegetation data and is in units of kg ha-1. Now, in this task we are going to play around with how this image ‘looks’ so that the data can be interpreted more easily. In the Main image Window, select Tools/Color Mapping/ENVI Color Tables. Now, left click on a color table to see what it does to the image. Once you have chosen a color you like close the color table window and your choice will be saved in the computers memory. Currently, this map had no geographic information. However, say you have a arc shape file and you want to overlay this information onto this image. This can be very helpful when displaying your results.

In the Main Image window, select Overlay/Vectors. In the Vector Parameters: Cursor Query window box, select File/Open Vector File/Shape File and select the filename arcv-b.shp and press Open. Choose the file Projections that matched the information in the Map Info section of the Available Bands list (WGS-84) and press ok.

Page 11: Lab #2 Manipulating Files in ENVI II · 1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce

11

You will notice that a vector map has appeared on the Main Image window To change the color of the vectors, press the white box beside Current Layer in the Vector Parameters: Cursor Query window box and choose another color. Then press Apply. To view the whole scroll image without the red box, shrink the Main image window until only the menu bar is visible. Lets, now make the data mean something to another person by selecting Overlay/Annotation.

This window box allows you to scale bars, color ramps, map keys, etc. In this exercise we will add a scale bar:

- Select Object/Scale bar. - Select Scroll (as this is where the scale-bar is going) - Choose a black background - Make length 100 km with 4 increments - Left click on the Scroll window and drag the scale-bar into place - Once you are satisfied with its position right click.

Page 12: Lab #2 Manipulating Files in ENVI II · 1 Lab #2 Manipulating Files in ENVI II Name: Lab #2: FOR 504 Advanced Topics in Remote Sensing Objectives of this laboratory exercise: Introduce

12

Repeat this task with other annotations.