segmentation_Terralib_MRGrow: TerraLib Mean Region Growing segmentation algorithm

View source: R/SOptim_SegmentationFunctions.R

segmentation_Terralib_MRGrowR Documentation

TerraLib Mean Region Growing segmentation algorithm

Description

A function providing CLI access to TerraLib 5 Mean Region Growing segmentation and optimize its parameters using genetic algorithms.

Usage

segmentation_Terralib_MRGrow(
  x,
  inputRstPath,
  outputSegmRst = NULL,
  Threshold = NULL,
  MinSize = NULL,
  verbose = TRUE,
  TerraLib.path = NULL
)

Arguments

x

A vector with size two defining the segmentation parameters that will be optimized using genetic algorithms from GA package:

  • [1] Threshold (double),

  • [2] Minimum size of the segments (integer).

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

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)

Threshold

Threshold (double)

MinSize

Minimum size of the segments (integer)

verbose

Print output messages? (default: TRUE).

TerraLib.path

Path to the TerraLib binaries (locating terralib_cli_rg executable). If not set it uses the PATH env var to find it.

Details

By default all bands have the same weight (bw), i.e., bw = 1 / number of bands. Also, by default, the executable file for running this segmentation algorithm (named terralib_cli_rg) should be accessible by the PATH env variable.

Value

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

Note

Windows binaries for CLI access to TerraLib v5.1.1 Mean Region Growing segmenter are available at: https://bitbucket.org/joao_goncalves/terralib5_cli_segmentation_mod/downloads (unfortunetaley not yet tested in Linux environment...). Source could be used to build TerraLib for this effect, check source location /examples/segmentationRegionGrowing and TerraLib instructions (link).


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