This task clusters pixels in a dataset based on statistics only, without requiring you to define training classes. It uses the ISODATA unsupervised method for classification.
The ISODATA method starts by calculating class means evenly distributed in the data space, then iteratively clusters the remaining pixels using minimum distance techniques. Each iteration recalculates means and reclassifies pixels with respect to the new means. This process continues until the percentage of pixels that change classes during an iteration is less than the change threshold or the maximum number of iterations is reached.
Example
e = ENVI()
File = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
Task = ENVITask('ISODATAClassification')
Task.INPUT_RASTER = Raster
Task.Execute
DataColl = e.Data
DataColl.Add, Task.OUTPUT_RASTER
View = e.GetView()
Layer = View.CreateLayer(Task.OUTPUT_RASTER)
Syntax
Result = ENVITask('ISODATAClassification')
Input properties (Set, Get): INPUT_RASTER, CHANGE_THRESHOLD_PERCENT, ITERATIONS, NUMBER_OF_CLASSES, OUTPUT_RASTER_URI
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:
CHANGE_THRESHOLD_PERCENT (optional)
The change threshold percentage that determines when to complete the classification. When the percentage of pixels that change classes during an iteration is less than the threshold value, the classification completes. The default value is 2.0.
INPUT_RASTER (required)
Specify a raster on which to perform unsupervised classification.
ITERATIONS (optional)
The maximum iterations to perform. If the change threshold percent is not met before the maximum number of iterations is reached, the classification completes. The default value is 10.
NUMBER_OF_CLASSES (optional)
Specify the number of classes to generate. The default value is 5.
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.
Version History
API Version
4.3
See Also
ENVITask, ClassificationAggregation Task, ClassificationSmoothing Task