This task removes isolated classified pixels using blob grouping. Low pass or other types of filtering could be used to remove these areas, but the class information would be contaminated by adjacent class codes. The sieve classes method looks at the neighboring four or eight pixels to determine if a pixel is grouped with pixels of the same class. If the number of pixels in a class that are grouped is less than the value that you enter, those pixels will be removed from the class. When pixels are removed from a class using sieving, black pixels (unclassified) will be left. Use the ClassificationClumping task to remove the black pixels.
The following example performs an unsupervised classification, followed by a sieving, then clumping operation to remove the remaining black pixels.
e = ENVI()
File = Filepath('qb_boulder_msi', Subdir=['data'], $
Raster = e.OpenRaster(File)
ClassTask = ENVITask('ISODATAClassification')
ClassTask.INPUT_RASTER = Raster
DataColl = e.Data
View = e.GetView()
Layer = View.CreateLayer(ClassTask.OUTPUT_RASTER)
SievingTask = ENVITask('ClassificationSieving')
SievingTask.INPUT_RASTER = ClassTask.OUTPUT_RASTER
ClumpingTask = ENVITask('ClassificationClumping')
ClumpingTask.INPUT_RASTER = SievingTask.OUTPUT_RASTER
Layer2 = View.CreateLayer(ClumpingTask.OUTPUT_RASTER)
Portal = View.CreatePortal()
Portal.Animate, 2.0, /FLICKER
Result = ENVITask('ClassificationSieving')
Input properties (Set, Get): CLASS_ORDER, INPUT_RASTER, MINIMUM_SIZE, OUTPUT_RASTER_URI, PIXEL_CONNECTIVITY
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.
This task inherits the following methods from ENVITask:
This task inherits the following properties from ENVITask:
This task also contains the following properties:
Specify the order of class names in which sieving is applied to the classification image. If you do not specify this property, the classes are processed from first to last.
Specify a raster on which to perform classification clumping.
Specify the minimum size of a blob (in pixels) to keep. The default value is two pixels.
This is a reference to the output raster of filetype ENVI.
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.
Specify a value of 4 (four-neighbor) or 8 (eight-neighbor) indicating the regions around a pixel that are searched, for continuous blobs. The default is 8.
ENVITask, ENVISubsetRaster, ISODATAClassification Task, ClassificationSmoothing Task, ClassificationAggregation Task, ClassificationSieving Task