segmentation_Terralib_Baatz: TerraLib Baatz-Shcape segmentation algorithm

View source: R/SOptim_SegmentationFunctions.R

segmentation_Terralib_BaatzR Documentation

TerraLib Baatz-Shcape segmentation algorithm

Description

A function providing CLI access to TerraLib 5 Baatz-Shcape segmentation and optimize its parameters using genetic algorithms.

Usage

segmentation_Terralib_Baatz(
  x,
  inputRstPath,
  outputSegmRst = NULL,
  CompactnessWeight = NULL,
  SpectralWeight = NULL,
  Threshold = NULL,
  MinSize = NULL,
  verbose = TRUE,
  TerraLib.path = NULL
)

Arguments

x

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

  • [1] Compactness weight (double),

  • [2] Spectral / color weight (double),

  • [3] Threshold parameter (double),

  • [4] 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 CompactnessWeight, SpectralWeight, 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)

CompactnessWeight

Compactness weight (double)

SpectralWeight

Spectral / color weight (double)

Threshold

Threshold parameter (double)

MinSize

Minimum size of the segments (integer)

verbose

Print output messages? (default: TRUE)

TerraLib.path

Path to the TerraLib binaries (locating terralib_cli_baatz 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_baatz) 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 Baatz-Schape 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/segmentationBaatz and TerraLib instructions (link). The executable file for running this segmentation algorithm is named: terralib_cli_baatz

References

Baatz, M.; Schape, A. Multiresolution segmentation: an optimization approach for high quality multi-scale image segmentation. In: XII Angewandte Geographische Informationsverarbeitung, Wichmann Verlag, Heidelberg, 2000.


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