segmentation_RSGISLib_Shep: Shepherd segmentation algorithm from RSGISLib

View source: R/SOptim_SegmentationFunctions.R

segmentation_RSGISLib_ShepR Documentation

Shepherd segmentation algorithm from RSGISLib

Description

A function providing CLI access to RSGISLib Shepherd segmentation and optimize its parameters using genetic algorithms.

Usage

segmentation_RSGISLib_Shep(
  x,
  inputRstPath,
  outputSegmRst = NULL,
  NumClust = NULL,
  MinSize = NULL,
  SpectralThresh = NULL,
  pythonPath = NULL,
  verbose = TRUE
)

Arguments

x

A vector of size three containing the parameters that will be optimized by the genetic algorithms from package GA:

  • [1] Number of clusters for running the k-means algorithm (integer)

  • [2] Minimum segment size, if smaller it will be merged to neighbouring segments (in pixels; integer)

  • [3] Spectral threshold used to merge objects (float), is a value providing the maximum (Euclidean distance) spectral separation for which to merge clumps. Set to a large value to ignore spectral separation and always merge.

If you are using this function outside an optimization context it is better to directly define the segmentation parameters in NumClust, MinSize and SpectralThresh.

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)

NumClust

Number of clusters for running the k-means algorithm (integer)

MinSize

Minimum segment size (in pixels; integer)

SpectralThresh

Spectral threshold used to merge objects (float)

pythonPath

Path to the Python interpreter (by default uses the one in the PATH env var). In windows it should be used for defining the path to the conda distribution of RSGISLib.

verbose

Print output messages (default: TRUE).

Details

By default the k-means algorithm running inside the segmenter will use "INITCLUSTER_DIAGONAL_FULL_ATTACH" for the initialization stage, 250 iterations and 0.0025 for the degree of change stopping condition.

Value

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

Note

Unfortunetelly these functionalities where not yet tested in Linux or Mac environments.

References

Clewley, D., Bunting, P., Shepherd, J., Gillingham, S., Flood, N., Dymond, J., Lucas, R., Armston, J., Moghaddam, M., 2014. A Python-Based Open Source System for Geographic Object-Based Image Analysis (GEOBIA) Utilizing Raster Attribute Tables. Remote Sensing 6, 6111.

See Also

Also check out the RSGISLib manual pages at: http://www.rsgislib.org/rsgislib_segmentation.html.


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