View source: R/SOptim_SegmentationFunctions.R
segmentation_ArcGIS_MShift | R Documentation |
A function providing CLI access to ArcGIS Mean Shift segmentation and optimize its parameters using genetic algorithms.
segmentation_ArcGIS_MShift(
x,
inputRstPath,
outputSegmRst = NULL,
SpectralDetail = NULL,
SpatialDetail = NULL,
MinSegmentSize = NULL,
pythonPath = NULL,
verbose = TRUE
)
x |
A vector with size three defining the parameters that will be optimized by GA:
If you are using this function outside an optimization context it is better to directly define the
segmentation parameters in |
inputRstPath |
Path to the input raster file (typically a multi-layered raster dataset with segmentation features in each band). |
outputSegmRst |
A path to the output segmented image (default: |
SpectralDetail |
Spectral detail - level of importance given to the spectral differences of features in your imagery |
SpatialDetail |
Spatial detail - level of importance given to the proximity between features in your imagery |
MinSegmentSize |
Minimum segment size - in pixels |
pythonPath |
Path to the python interpreter (default: NULL; meaning that it uses the one in the PATH variable). |
verbose |
Print messages while running? (default: TRUE) |
Some more info regarding the parameters that will be optimized:
valid values range from 1.0 to 20.0 (double). A higher value is appropriate when you have features you want to classify separately but have somewhat similar spectral characteristics. Smaller values create spectrally smoother outputs. For example, with higher spectral detail in a forested scene, you will be able to have greater discrimination between the different tree species
;
valid values range from 1 to 20 (integer). A higher value is appropriate for a scene where your features of interest are small and clustered together. Smaller values create spatially smoother outputs. For example, in an urban scene, you could classify an impervious surface using a smaller spatial detail, or you could classify buildings and roads as separate classes using a higher spatial detail
;
define the minimum size (in pixels; integer) of a given segment. This threshold is used to merge segments smaller than the defined size with their best fitting neighbor segment
.
A list object containing output file paths resulting from the segmentation run. These files will be cleaned after each GA iteration.
Uses a predefined python script for accessing ArcGIS API and run the segmentation. Check
SegOptim/inst
folder.
Each ArcGIS/Python instance works with a separate scratch directory to avoid
disk I/O conflicts. However, some ArcGIS/Python undetermined problems may still occur
during segmentation.
ArcGIS manual on Mean Shift segmentation: http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/segment-mean-shift.htm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.