You are on page 1of 3

Load the classified image you created earlier

1 Click the Edit Algorithm toolbar button. Notice that this algorithm has one layer of the
type Class Display. The Class Display layer is designed to display images created with ER
Mappers classification functions. 2 In the process diagram, click the Load Dataset button. 3
From the Directories menu, select the path ending with the text \examples. 4 Doubleclick on the Miscellaneous directory to open it. 5 In the directory Tutorial, double-click on the
image max_like_class you created earlier to load it. Each pixel in the original Landsat image is
assigned to one of the six training classes you defined earlier. The class colors are those you
defined for the training region polygons. 6 From the Edit menu (on the main menu), select
Edit Class/Region Color and Name. The Edit Class/Region Details dialog opens
showing the name and color assigned to each class. If desired, you could change them here. 7
Click Cancel on the Edit Class/Region Details dialog to close it. Close all
image windows and dialog boxes 1 Click Close on the Algorithm
window to close it. 2 Close all image windows using the window system controls: Select
Close from the window control-menu. 3 Click Close on the Algorithm window to close it.
Only the ER Mapper main menu should be open on the screen.Chapter 19 Supervised
classification 4: Generating Confusion Matrices ER Mapper Tutorial 329

4: Generating Confusion Matrices


Overview The ER Mapper Confusion Matrix facility tests a classified image against a
reference dataset, and then generates the following types of matrices: Row counts Users
accuracy Producers accuracy It also displays the Overall accuracy and the Kappa statistics. All
of these can give a good indication of the classification accuracy. For more information on these
matrices refer to Chapter 25, Supervised and Unsupervised Classification in the ER Mapper
User Guide. Obviously, the reference data is crucial in creating the matrices. One method of
obtaining this reference data is to establish sample ground truth points on the image, and then
to physically go to where the points are located in the field to verify the actual class to which they
belong. The information from these points can then be collated into an ASCII XYZ text file in
which each line represents a single sample point. The information for each point includes the X
and Y coordinates of the location of the point, and the number and label of the class to which the
point belongs. This file can be imported as an ER Mapper vector dataset via the Utilities /
Import Vector and GISformats / ASCII Points with Attributes menu
option. You can then enter this vector file as the reference dataset to generate confusion matrices.
This reference should be very accurate because the sample points been physically verified in the
field. The accuracy of the confusion matrices depends on the number of sample points and how
they are distributed over the classes. Another source of reference data is the actual training
regions that were used to classify the image under test. This will provide you with a very good
indication of how accurate the classification was, and the effectiveness of the training regions.
The ER Mapper Confusion Matrix facility accepts only classified images or vector images with
points and attributes as reference datasets. Training regions are neither of these, so it is necessary
to create a classified image that includes only the areas within the training regions. This exercise

describes how this is done. Load and display the practice image 1 On
the ER Mapper Standard Toolbar, click the Open button to open the file chooser. 2
From the Directories menu, select the path ending with the text \examples.
Objectives Learn how to use the ER Mapper Confusion Matrix facility to test
the accuracy of the Supervised Classification, using the original training
regions as a reference.330 ER Mapper Tutorial Chapter 19 Supervised
classification 4: Generating Confusion Matrices 3 Open the Miscellaneous
directory. 4 In the directory tutorial, double-click on the image named Landsat_practice.ers.
The original Landsat MSS practice image will be displayed with Bands 1, 2 and 3 in Blue, Green
and Red bands respectively. 5 If necessary, you can click on the 99% Contrast
Enhancement button to make the image visible. 6 Click the Edit Algorithm toolbar
button to open the Algorithm window. Add a formula to each layer We
will add a formula to each layer that excludes those parts of the image that do not fall within the
training regions that were previously added to this image. 1 On the Algorithm window, click
on the Red layer to highlight it. 2 Click the Edit Formula button in the process diagram to
open the Formula Editor dialog. 3 In the Generic formula window, edit the formula text to
read: if inregion(region1) or inregion(region2) or inregion(region3) or
inregion(region4) or inregion(region5) or inregion(region6) then
INPUT1 else null This formula tells ER Mapper to process and display the image data
inside the regions. Areas that fall outside the regions are not displayed. 4 Click the Apply
changes button. Notice that the Inputs and Regions buttons above the Relations
window are now active. Image band 3 is assigned to generic INPUT1 by default. 5 Click the
Regions button, select different Region names from the drop-down list next to REGION1,
REGION2 etc. The formula will cause ER Mapper to display in the Red layer only the parts of
Band 3 that fall within the regions. 6 On the Formula Editor dialog, click on the Green layer
button to edit the formula in the Green Layer. 7 In the Generic formula window, edit the formula
text to read: if inregion(region1) or inregion(region2) or
inregion(region3) or inregion(region4) or Chapter 19 Supervised
classification 4: Generating Confusion Matrices ER Mapper Tutorial 331
inregion(region5) or inregion(region6) then INPUT1 else null This
formula tells ER Mapper to process and display the image data inside the regions. 8 Click the
Apply changes button. Notice that the Inputs and Regions buttons above the
Relations window are now active. Image band 2 is assigned to generic INPUT1 by default. 9
Click the Regions button, select a different Region names from the drop-down list next to
REGION1, REGION2 etc. The formula will cause ER Mapper to display in the Green layer
only the parts of Band 2 that fall within the regions. 10 On Formula Editor dialog, click on the
Blue layer button to edit the formula in the Green Layer. 11 In the Generic formula window, edit
the formula text to read: if inregion(region1) or inregion(region2) or
inregion(region3) or inregion(region4) or inregion(region5) or
inregion(region6) then INPUT1 else null This formula tells ER Mapper to process
and display the image data inside the regions. 12 Click the Apply changes button. Notice
that the Inputs and Regions buttons above the Relations window are now active. Image
band 1 is assigned to generic INPUT1 by default. 13 Click the Regions button, select a
different Region names from the drop-down list next to REGION1, REGION2 etc. The
formula will cause ER Mapper to display in the Blue layer only the parts of Band 2 that fall

within the regions. 14 Close the Formula Editor by clicking on the Close button. Save

as a Virtual Dataset We now save the algorithm as a virtual dataset, so that it can
be used to create a classified image. 1 On the Standard toolbar, click on the Save As
button. 2 In the Files of Type: field, select ER Mapper Virtual Dataset (.ers). 3 From the
Directories menu, select the path ending with the text \examples. 4 Double-click on the
directory Miscellaneous to select it. 5 Double-click on the directory Tutorial to open it. 332
ER Mapper Tutorial Chapter 19 Supervised classification 4: Generating
Confusion Matrices 6 In the Save As: text field, type a name using your initials at the
beginning, followed by the text land_use_region_vds. Separate each word with an underscore
(_). For example, if your initials are KA, type in the name: KA_land_use_regions_vds
7 Click OK or Save to save the virtual dataset. 8 Answer Yes to the Delete final transforms
for virtual dataset? query. Add

the Region layer to the virtual

dataset We now need to add the region layer from the Landsat_practice.ers dataset to the
newly created virtual dataset. 1 On the Algorithm window, select Edit / Add Vector
Layer / Region Layer. This will add a new Region Layer to the algorithm. 2 In the Region
layer process diagram, click the Load Dataset button. 3 From the Directories menu,
select the path ending with the text \examples. 4 Double-click on the Miscellaneous
directory to open it. 5 In the directory Tutorial, double-click on the image Landsat_practice to
load it. The Regions will now be displayed over the image. The areas of the image displayed
should be bounded by the Region polygons. 6 In the process diagram, click the Annotate
Vector Layer button to open the Tools dialog. 7 On the Tools dialog, click on the Save As
button. This will open the Map Composition Save As dialog. 8 In the Save As box,
select Raster Region. 9 Click on the file chooser button in the Save To File: field. 10
From the Directories menu, select the path ending with the text \examples. 11 Doubleclick on the directory Miscellaneous to select it. 12 Double-click on the directory Tutorial to
open it. 13 Select the name of the virtual dataset you created; e.g. KA_land_use_regions_vds
and click OK. 14 Click OK on the Map Composition Save As dialog to save the
region layer to the Virtual Dataset. 15 Answer Yes to overwriting the file.

You might also like