This task performs a parallelepiped supervised classification. Parallelepiped classification uses a simple decision rule to classify multispectral data. The decision boundaries form an n-dimensional parallelepiped classification in the image data space. The dimensions of the parallelepiped classification are defined based upon a standard deviation threshold from the mean of each selected class.
Example
e = ENVI()
File1 = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File1)
File2 = Filepath('qb_boulder_msi_vectors.shp', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Vector = e.OpenVector(File2)
StatTask = ENVITask('TrainingClassificationStatistics')
StatTask.INPUT_RASTER = Raster
StatTask.INPUT_VECTOR = Vector
StatTask.Execute
class_names = ['Unclassified', StatTask.CLASS_NAMES]
num_classes = n_elements(StatTask.CLASS_NAMES)
lookup = bytarr(3, num_classes + 1)
lookup = bytarr(3,num_classes+1)
lookup[0,1] = StatTask.CLASS_COLORS
Task = ENVITask('ParallelepipedClassification')
Task.INPUT_RASTER = Raster
Task.MEAN = StatTask.MEAN
Task.STDDEV = StatTask.STDDEV
Task.Execute
DataColl = e.Data
DataColl.Add, Task.OUTPUT_RULE_RASTER
DataColl.Add, Task.OUTPUT_RASTER
View = e.GetView()
Layer = View.CreateLayer(Task.OUTPUT_RULE_RASTER)
Layer = View.CreateLayer(Task.OUTPUT_RASTER)
Syntax
Result = ENVITask('ParallelepipedClassification')
Input parameters (Set, Get): CLASS_COLORS, CLASS_NAMES, INPUT_RASTER, MEAN, OUTPUT_RASTER_URI, OUTPUT_RULE_RASTER_URI, STDDEV, STDWIDTH
Output parameters (Get only): OUTPUT_RASTER, OUTPUT_RULE_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)
This is an array of [3, number of classes] for RGB triplets representing the class colors.
CLASS_NAMES (optional)
This is a string array of [number of classes] for unclassified and class names.
INPUT_RASTER (required)
Specify a raster on which to perform supervised classification.
MEAN (required)
Specify an array that is [number of bands, number of classes].
OUTPUT_RASTER_URI (optional)
Specify a string with the fully qualified filename and path to export the associated OUTPUT_RASTER.
- If you do not specify this parameter, the OUTPUT_RASTER will not be created.
- If you set this parameter to an asterisk symbol (*), the OUTPUT_RASTER will be virtual and not written to disk.
- To force the creation of a temporary file, set this parameter to an exclamation symbol (!).
- 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.
OUTPUT_RULE_RASTER_URI (optional)
Specify a string with the fully qualified filename and path of the associated OUTPUT_RULE_RASTER.
- If you do not specify this parameter, the OUTPUT_RULE_RASTER will not be created.
- To force the creation of a temporary file set the parameter to an exclamation symbol (!).
- 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.
STDDEV (optional)
Specify an array that is [number of bands, number of classes].
STDWIDTH (required)
Specify the width around standard deviations within which the spectrum may fall and still be classified into that class. If an array is specified, each class is tested with its corresponding width.
Output Parameters
OUTPUT_RASTER
This is a reference to the output raster of filetype ENVI.
OUTPUT_RULE_RASTER
This is a reference to the output rule image of filetype ENVI.
This output will not be generated unless its associated URI input parameter is set.
Methods
Execute
Parameter
ParameterNames
Properties
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
Version History
See Also
ENVITask, Masking Support in ENVITasks