This task allows you to extract segments only without performing classification. Segmentation is the process of partitioning an image into objects by grouping neighboring pixels with common values. The objects in the image ideally correspond to real-world features. Output includes a single-band label raster with an optional segmentation raster.
You must have an ENVI Feature Extraction license in order to use this routine.
e = ENVI()
File = Filepath('qb_boulder_msi', Subdir=['data'], $
Raster = e.OpenRaster(File)
Task = ENVITask('FXSegmentation')
Task.INPUT_RASTER = Raster
DataColl = e.Data
View = e.GetView()
Layer = View.CreateLayer(Task.OUTPUT_RASTER)
Result = ENVITask('FXSegmentation')
Input properties (Set, Get): INPUT_RASTER, KERNEL_SIZE, MERGE_ALGORITHM, MERGE_BANDS, MERGE_VALUE, OUTPUT_MEANS_RASTER_URI, OUTPUT_RASTER_URI, SEGMENT_ALGORITHM, SEGMENT_BANDS, SEGMENT_VALUE
Output properties (Get only): OUTPUT_MEANS_RASTER, OUTPUT_RASTER
Properties marked as (Init) can be set during the initial creation of the object. Properties marked as (Get) can be retrieved. Properties marked as (Set) can be set after initial creation.
This task inherits the following methods from ENVITask:
This task inherits the following properties from ENVITask:
This task also contains the following properties:
Specify a raster on which to perform segmentation and merging.
Specify a texture kernel size, in pixels, around a given pixel that will be used to compute texture attributes. Use an odd number between 3 and 19 (e.g., 9 = 9x9 pixels). Specify a higher kernel size if you are segmenting large areas with little texture variance such as fields. Specify a lower size if you are segmenting smaller areas with higher variance such as urban neighborhoods. The default value is 3.0000000.
Specify the merge method used to combine adjacent segments with similar spectral attributes.
- Full Lambda Schedule (default): Merges small segments within larger, textured areas such as trees or clouds, where over-segmentation may be a problem.
- Fast Lambda: Merges adjacent segments with similar colors and border sizes.
Specify the bands for applying the merge settings.
Specify the merge level to combine segments with similar colors (Fast Lambda) or to merge over-segmented areas (Full Lambda Schedule). Increasing the value results in more merging. The default value is 0.000000 (no merging).
This is a reference to the output for a multispectral image in ENVI raster format that shows the regions defined by segmentation.
Specify a string with the fully qualified filename and path of the associated OUTPUT_RASTER. If you do not specify this property, the associated OUTPUT_RASTER will not be created. To force the creation of a temporary file set the property to an exclamation symbol (!).
This is a reference to the output for a single band label raster in ENVI format.
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.
If you do not specify this property, the output raster is only temporary. Once the raster has no remaining references, ENVI deletes the temporary file.
Specify the segmentation method to use:
- Edge (default): Best for detecting edges of features where objects of interest have sharp edges. Set an appropriate SEGMENT_VALUE and MERGE_VALUE to effectively delineate features.
- Intensity: Best for segmenting images with subtle gradients such as digital elevation models (DEMs) or images of electromagnetic fields. When selecting this method, do not set the MERGE_VALUE property. Merging is used primarily to combine segments with similar spectral information. Elevation and other related attributes are not appropriate for merging.
Specify an array of zero-based band numbers on which to apply the segmentation settings. For example, [0,1,2] indicates Band 1, Band 2, and Band 3.
Specify the scale level used to effectively delineate features of interest in segmentation. Increasing the value results in fewer segments; decreasing the value results in more segments. You should ensure that features of interest are not grouped into segments represented by other features. The default value is 50.0000.