segmentation_OTB_LSMS2: Large Scale Mean Shift segmentation algorithm from Orfeo...

View source: R/SOptim_SegmentationFunctions.R

segmentation_OTB_LSMS2R Documentation

Large Scale Mean Shift segmentation algorithm from Orfeo Toolbox (OTB) with two sets of parameters

Description

A function providing CLI access to OTB's LSMS segmentation and optimize its parameters using genetic algorithms. This function differs from segmentation_OTB_LSMS by implementing two sets of parameters for the spectral and spatial range, the first for running mean-shift smoothing (MS_ prefix) and, the second, for the large-scale segmentation step (LSS_ prefix).

Usage

segmentation_OTB_LSMS2(
  x,
  inputRstPath,
  outputSegmRst = NULL,
  MS_SpectralRange = NULL,
  MS_SpatialRange = NULL,
  LSS_SpectralRange = NULL,
  LSS_SpatialRange = NULL,
  MinSize = NULL,
  lsms_maxiter = 10,
  tilesizex = 2500,
  tilesizey = 2500,
  otbBinPath = NULL,
  RAM = 3072,
  verbose = TRUE
)

Arguments

x

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

  • [1] Range radius defining the radius (expressed in radiometry units) in the multi-spectral space for the mean-shift smoothing step (float);

  • [2] Spatial radius of the neighborhood for mean-shift smoothing (float);

  • [3] Range radius defining the radius (expressed in radiometry units) in the multi-spectral space for the large-scale segmentation step (float);

  • [4] Spatial radius of the neighborhood for large-scale segmentation (float);

  • [5] Minimum segment/region size. If, after the segmentation, a region is of size lower than this criterion, the region is merged with the "nearest" region (radiometrically) (integer).

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

inputRstPath

The input raster dataset used to perform the image segmentation using OTB LSMS algorithm (typically a multi-layer 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).

MS_SpectralRange

Threshold on spectral signature euclidean distance (expressed in radiometry unit) to consider neighborhood pixel for averaging. Higher values will be less edge-preserving (more similar to simple average in neighborhood), whereas lower values will result in less noise smoothing. Note that this parameter has no effect on processing time (float).

MS_SpatialRange

Radius of the spatial neighborhood for averaging. Higher values will result in more smoothing and higher processing time (float).

LSS_SpectralRange

Threshold on spectral signature euclidean distance (expressed in radiometry unit) to consider pixels in the same segment. A good value is half the range radius used in the MeanShiftSmoothing application (ranger parameter; float).

LSS_SpatialRange

Threshold on Spatial distance to consider pixels in the same segment. A good value is half the spatial radius used in the MeanShiftSmoothing application (spatialr parameter; float).

MinSize

Minimum segment/region size.

lsms_maxiter

Algorithm iterative scheme will stop if convergence hasn't been reached after the maximum number of iterations (integer).

tilesizex

Size of tiles along the X-axis (integer).

tilesizey

Size of tiles along the Y-axis (integer).

otbBinPath

The system path to OTB binaries (e.g., where otbcli_MeanShiftSmoothing is located). By default this is equal to NULL which means that the system path is used.

RAM

Available memory for processing the image data (in MB).

verbose

Print output messages (default: TRUE).

Value

A list object containing output file paths resulting from the segmentation run. These files will be cleaned after each GA iteration or if an error occurs. Also, notice that some auxiliary files will be created: otb_filt_range_, otb_filt_spatial_, otb_segm_init_.

Note

Check [OTB documentation](https://www.orfeo-toolbox.org/CookBook/Applications/app_LargeScaleMeanShift.html) for more info.

References

J. Michel, D. Youssefi and M. Grizonnet, 2015. Stable Mean-Shift Algorithm and Its Application to the Segmentation of Arbitrarily Large Remote Sensing Images. IEEE Transactions on Geoscience and Remote Sensing, 53: 2, 952-964.


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