This task performs feature classification using a text prompt to guide the analysis. It uses deep learning models to classify features in the input raster based on the provided text prompt.
Example
This example uses the qb_boulder_msi raster in the INSTALL_DIR\ENVIxx\data folder.
e = ENVI()
filename = FILEPATH('qb_boulder_msi', $
ROOT_DIR=e.ROOT_DIR, SUBDIRECTORY = ['data'])
Raster = e.openraster(filename)
Task = ENVITask('FeatureAssistantClassification')
Task.Input_Raster = Raster
Task.Input_Prompt = ['water']
Task.Resolution = 2.8
Task.Score_Threshold = 0.5
Task.Max_Width = 800
Task.Max_Height = 800
Task.Output_Vector_URI = e.GetTemporaryFilename('.shp', /CLEANUP_ON_EXIT)
Task.Execute
OutputVector = Task.Output_Vector
View = envi.GetView()
Layer1 = View.CreateLayer(Raster)
Layer2 = View.CreateLayer(OutputVector)
Syntax
Result = ENVITask('FeatureAssistantClassification')
Input parameters (Set, Get): CLIP_TO_BOX, INPUT_PROMPT, INPUT_RASTER, IOU_THRESHOLD, MAX_AREA, MAX_HEIGHT, MAX_WIDTH, MIN_AREA, OUTPUT_VECTOR_URI, OVERLAP_PERCENTAGE, POLYGON_RADIUS, POLYGON_SCALE, POLYGON_SHAPE, RASTER_BRIGHTNESS, RASTER_INTERPOLATION, RASTER_SHARPEN, RASTER_STRETCH, RESOLUTION, SCORE_THRESHOLD, SEGMENT_FEATURES, SIZE_FACTOR, ZOOM_FACTOR
Output parameters (Get only): OUTPUT_VECTOR
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
CLIP_TO_BOX (optional)
Specify whether to clip contour features to the predicted bounding boxes. When enabled, this ensures that only the portions of contour features that fall within the bounding boxes are included in the classification results. The default is true.
INPUT_PROMPT (required)
The text prompt to guide the feature classification process.
INPUT_RASTER (required)
Specify the input raster to be classified, ensuring compatibility with the model for accurate per-object analysis.
IOU_THRESHOLD (optional)
Specify the Intersection Over Union (IOU) threshold used for Non-Maximum Suppression in object detection. This value measures the overlap between predicted bounding boxes and actual bounding boxes, ensuring accurate identification by suppressing redundant detections. The minimum is 0.0, the maximum is 1.0. The default is 0.5.
MAX_AREA (optional)
Specify the maximum area (in pixels) for contour features. This helps to filter out excessively large detections that may be false positives, ensuring that only relevant features within a reasonable size range are included in the classification results. The minimum is 0 (the default), which disables this parameter.
MAX_HEIGHT (optional)
Specify the maximum height (in pixels) for predicted bounding boxes. This helps to filter out excessively large detections that may be false positives, ensuring that only relevant features within a reasonable size range are included in the classification results. The minimum is 5. The default is 400.
MAX_WIDTH (optional)
Specify the maximum width (in pixels) for predicted bounding boxes. This parameter helps to filter out excessively large detections that may be false positives, ensuring that only relevant features within a reasonable size range are included in the classification results. The minimum is 5. The default is 400.
MIN_AREA (optional)
Specify the minimum area (in pixels) for contour features. This parameter helps to filter out small detections that may be false positives, ensuring that only relevant features within a reasonable size range are included in the classification results. The minimum is 0 (the default), which disables this parameter.
OUTPUT_VECTOR_URI (optional)
Specify an ENVIURI representing the fully qualified path and filename where classification results will be saved to disk as a .shp file.
OVERLAP_PERCENTAGE (optional)
Specify the overlap between adjacent raster tiles during processing. This parameter helps to mitigate edge effects and ensure that features located near the borders of tiles are accurately classified by allowing a certain percentage of overlap between tiles. The default is 0.18.
POLYGON_RADIUS (optional)
Specify the radius for smoothing contours. This parameter defines the size of the neighborhood used for contour smoothing, with larger values resulting in smoother contours. The minimum is 1. The maximum is 10. The default is 1.
POLYGON_SCALE (optional)
Specify the number of pixels to expand (positive value) or shrink (negative value) the predicted contours. This parameter allows for fine-tuning of the contour dimensions to better capture the extent of detected features. The minimum is -10. The maximum is 10. The default is 0.
POLYGON_SHAPE (optional)
Specify the shape of the predicted contours. This parameter helps to define the geometric structure of the detected features. The choices are round (the default) and square.
RASTER_BRIGHTNESS (optional)
Specify the brightness adjustment to apply to the input raster during processing. This parameter allows for enhancing or reducing the brightness of the image, which can help to improve classification results by making features more distinguishable for the model. The minimum is 0, the maximum is 100. The default is 50.
RASTER_INTERPOLATION (optional)
Specify the type of interpolation to apply to the input raster during processing. This parameter allows for smoothing of the input image, which can help to improve classification results by reducing noise and providing a more continuous representation of the data. The options are:
- Nearest Neighbor
- Bilinear
- Bicubic
- Optimized Bicubic (default)
RASTER_SHARPEN (optional)
Specify the sharpening adjustment to apply to the input raster during processing. This parameter allows for enhancing the edges of features in the image, which can help to improve classification results by making features more distinguishable for the model. The minimum is 0, the maximum is 100. The default is 10.
RASTER_STRETCH (optional)
Specify the type of stretch to apply to the input raster during processing. This parameter allows for enhancement of image contrast, which can help to improve classification results by making features more distinguishable for the model. The options are:
- ENVI Default (default)
- No Stretch
- Linear
- Optimized Linear
- Equalization
- Gaussian
- Square Root
- Logarithmic
- Bipolar
- Linear 1%
- Linear 2%
- Linear 5%
RESOLUTION (optional)
Specify the resolution for the input raster (in meters) used during processing. If set, this requires a spatial reference defined by the input raster and overrides the value set for ZOOM_FACTOR. This parameter adjusts the spatial resolution of the input raster to better match the model's expected input size. The default is 0.0.
SCORE_THRESHOLD (optional)
Specify the minimum score threshold for detections. Any bounding boxes with a score below this threshold will be excluded from the result ensuring higher quality predictions. The minimum is 0.1, the maximum is 1.0. The default is 0.5
SEGMENT_FEATURES (optional)
Specify whether to segment features within the predicted bounding boxes. Enabling this option allows for more precise delineation of feature boundaries, which can enhance the accuracy of classification results by providing detailed information about the shape and extent of detected objects. The default is false.
SIZE_FACTOR (optional)
Specify the box size factor to filter the median size of predicted bounding boxes. This parameter helps to exclude detections that are significantly larger or smaller than the typical size of features in the image, improving the accuracy of the classification results by focusing on relevant objects. The minimum is 0, the maximum is 10. The default is 0.
ZOOM_FACTOR (optional)
Specify the zoom factor for the input raster during processing. A value greater than 1 will zoom in to the image, while a value less than 1 will zoom out. This parameter adjusts the scale of the input raster to better match the model's expected input size. The default is 1.0.
Output Parameters
OUTPUT_VECTOR
This is a reference to the output vector, specifying the resulting data generated during the classification process.
Version History
|
Feature Assistant 1.0
|
Introduced |
See Also
Introduction to ENVI Feature Assistant, "ENVI Modeler" in ENVI Help, FeatureAssistantStartServer Task, FeatureAssistantStopServer Task