segmentation_ArcGIS_MShift: ArcGIS Mean Shift segmentation algorithm

View source: R/SOptim_SegmentationFunctions.R

segmentation_ArcGIS_MShiftR Documentation

ArcGIS Mean Shift segmentation algorithm

Description

A function providing CLI access to ArcGIS Mean Shift segmentation and optimize its parameters using genetic algorithms.

Usage

segmentation_ArcGIS_MShift(
  x,
  inputRstPath,
  outputSegmRst = NULL,
  SpectralDetail = NULL,
  SpatialDetail = NULL,
  MinSegmentSize = NULL,
  pythonPath = NULL,
  verbose = TRUE
)

Arguments

x

A vector with size three defining the parameters that will be optimized by GA:

  • [1] spectral detail - level of importance given to the spectral differences of features in your imagery,

  • [2] spatial detail - level of importance given to the proximity between features in your imagery, and,

  • [3] minimum segment size - in pixels.

If you are using this function outside an optimization context it is better to directly define the segmentation parameters in SpectralDetail, SpatialDetail and MinSegmentSize.

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: NULL; in this case the segmenter will internally determine a temporary output folder and file path inside the working directory)

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)

Details

Some more info regarding the parameters that will be optimized:

Spectral detail

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

;

Spatial detail

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

;

Minimum segment size

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

.

Value

A list object containing output file paths resulting from the segmentation run. These files will be cleaned after each GA iteration.

Note

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.

See Also

ArcGIS manual on Mean Shift segmentation: http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/segment-mean-shift.htm


joaofgoncalves/SegOptim documentation built on Feb. 5, 2024, 11:10 p.m.