This task applies threshold and infeasibility values and performs classification on mixture tuned rule raster.
Example
This example uses the default parameter settings:
e = ENVI()
File = Filepath('AVIRISReflectanceSubset.dat', $
SUBDIR=['data', 'hyperspectral'], $
ROOT_DIR=e.Root_Dir)
Raster = e.OpenRaster(file)
task = ENVITask('ForwardMNFTransform')
Task.Input_Raster = Raster
Task.Execute
subset = ENVISubsetRaster(Task.Output_Raster, BANDS=Lindgen(25))
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
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]]
Task = ENVITask('MixtureTunedMatchedFilter')
Task.INPUT_RASTER = subset
Task.Endmembers = endmembers
Task.Names = ['Green Field', 'Soil', 'Ground']
Task.Execute
mtmfRaster = Task.Output_Raster
dataColl = e.Data
dataColl.Add, mtmfRaster
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 parameters (Set, Get): CLASS_COLORS, CLASS_NAMES, INFEASIBILITY, INPUT_RASTER, MINIMUM_RULE, OUTPUT_RASTER_URI, THRESHOLD
Output parameters (Get only): OUTPUT_RASTER
Parameters marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Parameters marked as "Get" are those whose values you can retrieve but not set.
Input Parameters
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.
-
If the value is 1 (MINIMUM_RULE), dirt will be classified because has the lowest value at 0.46.
-
If the value is 0 (MAXIMUM_RULE), grass will be classified because it has the highest value at 0.75.
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 parameter, or set it to an exclamation symbol (!), ENVI creates a temporary file.
- If you set it to the hash symbol (#), ENVI creates a file in the temporary directory, but this file will not be deleted when ENVI closes.
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.
Output Parameters
OUTPUT_RASTER
This is a reference to the output raster of filetype ENVI.
Methods
Execute
Parameter
ParameterNames
Properties
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
Version History