MixtureTunedRuleRasterClassification Task

This task applies threshold and infeasibility values and performs classification on mixture tuned rule raster.

Example

This example uses the default property settings:

; Start the application

e = ENVI()

 

; Open an input file

File = Filepath('AVIRISReflectanceSubset.dat', $

  SUBDIR=['data', 'hyperspectral'], $

  ROOT_DIR=e.Root_Dir)

Raster = e.OpenRaster(file)

 

; First run a Forward MNF on the data

task = ENVITask('ForwardMNFTransform')

Task.Input_Raster = Raster

Task.Execute

 

; Use the first 25 MNF bands to run a mixtured tuned matched filter

subset = ENVISubsetRaster(Task.Output_Raster, BANDS=Lindgen(25))

 

; Define three ROIs, each containing 9 pixels of a common material.

nSpectra = 9d

roi1 = EnviRoi(NAME='Green Field')

pixelAddr1 = [[77,182],[78,182],[79,182], $

  [77,183],[78,183],[79,183], $

  [77,184],[78,184],[79,184]]

roi1.AddPixels, pixelAddr1, SPATIALREF=Subset.SpatialRef

roi2 = EnviRoi(NAME='Soil')

pixelAddr2 = [[386,285],[387,285],[388,285], $

  [386,286],[387,286],[388,286], $

  [386,287],[387,287],[388,287]]

roi2.AddPixels, pixelAddr2, SPATIALREF=Subset.SpatialRef

roi3 = EnviRoi(NAME='Ground')

pixelAddr3 = [[296,326],[297,326],[298,326], $

  [296,327],[297,327],[298,327], $

  [296,328],[297,328],[298,328]]

roi3.AddPixels, pixelAddr3, SPATIALREF=Subset.SpatialRef

 

; Retrieve the spectra from the ROIs and use their mean as endmembers to

; the Mixture Tuned Matched Filter task.

spectra1 = subset.GetData(ROI=roi1)

mean1 = Total(spectra1,1) / nSpectra

spectra2 = subset.Getdata(ROI=roi2)

mean2 = Total(spectra2,1) / nSpectra

spectra3 = subset.GetData(ROI=roi3)

mean3 = Total(spectra3,1) / nSpectra

endmembers = [[mean1],[mean2],[mean3]]

 

; Get the task from the catalog of ENVITasks

Task = ENVITask('MixtureTunedMatchedFilter')

Task.INPUT_RASTER = subset

Task.Endmembers = endmembers

Task.Names = ['Green Field', 'Soil', 'Ground']

 

; Run the task

Task.Execute

mtmfRaster = Task.Output_Raster

 

; Get the data collection

dataColl = e.Data

; Add the output to the data collection

dataColl.Add, mtmfRaster

 

; Display the result

View = e.GetView()

Layer = View.CreateLayer(mtmfRaster)

 

Task = ENVITask('MixtureTunedRuleRasterClassification')

Task.INPUT_RASTER = mtmfRaster

Task.Execute

Layer = View.CreateLayer(Task.OUTPUT_RASTER)

Syntax

Result = ENVITask('MixtureTunedRuleRasterClassification')

Input properties (Set, Get): CLASS_COLORS, CLASS_NAMES, INFEASIBILITY, INPUT_RASTER, MINIMUM_RULE, OUTPUT_RASTER_URI, THRESHOLD

Output properties (Get only): OUTPUT_RASTER

Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.

Methods

This task inherits the following methods from ENVITask:

AddParameter

Execute

Parameter

ParameterNames

RemoveParameter

Properties

This task inherits the following properties from ENVITask:

COMMUTE_ON_DOWNSAMPLE

COMMUTE_ON_SUBSET

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

This task also contains the following properties:

CLASS_COLORS (optional)

Specify a (3,n) byte array with the RGB colors for the given ranges, where n is the number of classes

CLASS_NAMES (optional)

This is a string array of class names.

INFEASIBILITY (optional)

Specify a value or array of the infeasibilities. If only a value, it will be used for every band. Pixels higher than this value will be set to unclassified. If not given, the maximum infeasibility of every band will be used.

INPUT_RASTER (required)

Specify a raster on which to perform supervised classification.

MINIMUM_RULE (optional)

To use MINIMUM_RULE for the classification, set this value to 1. This uses the lowest score values of each pixel class for the final classification. If 0 (the default of MAXIMUM_RULE), the highest score values of each pixel class are used for the final classification.

For example, a rule image pixel with 3 bands could be classified into grass, water, or dirt when all meet the THRESHOLD. The pixel values are grass: 0.75, water: 0.63, and dirt: 0.46.

OUTPUT_RASTER

This is a reference to the output raster of filetype ENVI.

OUTPUT_RASTER_URI (optional)

Specify a string with the fully qualified filename and path of the associated OUTPUT_RASTER. If you do not specify this property, or set it to an exclamation symbol (!), a temporary file will be created.

THRESHOLD (optional)

Specify a value or array of the thresholds. If only a value, it will be used for every band. Pixels lower than this value will be set to unclassified.

Version History

ENVI 6.0

Introduced

API Version

4.2

See Also

ENVITask