segmentation: Segmentation

View source: R/segmentation.R

segmentationR Documentation

Segmentation

Description

This function uses the open-source software of GRASS and SAGA GIS to fulfill an imagery segmentation. It is possible to decide bet ween SAGA and GRASS GIS segmentation.

In SAGA GIS, the tools SEED GENERATION or FAST REPRESENTATIVENESS are used for computing seed points. Then, the SEEDED REGION GROWING al- gorithm is used for the segmentation.

In GRASS GIS, the tool OBJECT-SEGMENTATION (i.segment) is used for the segmentation. There is also the possibility to use the new SLIC algorithm.

Moreover, there is the option to compute a generalisation of segments by (multiple) majority filter (SAGA GIS) at the end.

Usage

segmentation(Tool, Segments.Grid, Segments.Poly, Input.Grid,
  Saga.Output.Grid = file.path(tempdir(),
  paste0("SagaRepresentativenessOutputGrid", par.i, ".sgrd")),
  Saga.Output.Lod = file.path(tempdir(),
  paste0("SagaRepresentativenessOutputLod", par.i, ".sgrd")),
  Output.Seeds = file.path(tempdir(), paste0("OutputSeed", par.i,
  ".sgrd")), Fast.Representativeness.LevelOfGeneralisation = "10.0",
  Saga.Similarity = file.path(tempdir(), paste0("SagaSimilarity", par.i,
  ".sgrd")), Saga.Segments.Seeds.Table = file.path(tempdir(),
  paste0("SagaSegmentsSeedsTable", par.i, ".mtab")),
  Saga.Segmentation.Normalize = "0",
  Saga.Segmentation.Neighbourhood = "0",
  Saga.Segmentation.Method = "0", Saga.Segmentation.Sig.1 = "1.0",
  Saga.Segmentation.Sig.2 = "1.0", Saga.Segmentation.Threshold = "0.0",
  Saga.Segmentation.Refresh = "0", Saga.Segmentation.Leafsize = 256,
  Split = "0", Grass.Segmentation.Threshold = NULL,
  Grass.Segmentation.Weighted = FALSE,
  Grass.Segmentation.Method = "region_growing",
  Grass.Segmentation.Similarity = "euclidean",
  Grass.Segmentation.Minsize = 15, Grass.Segmentation.Memory = 300,
  Grass.Segmentation.Iterations = 50, Grass.Segmentation.Seeds = NULL,
  Grass.Segmentation.Neighbourhood = "0",
  Segmentation.Boundary.Grid = NULL,
  Grass.Segmentation.Goodness = paste0("Grass.Segmentation.Goodness",
  par.i), AllVertices = "FALSE", NoData = FALSE, Mask = NULL,
  NoData.Flag = -99999, show.output.on.console = FALSE,
  Seed.Method = "", Seed.Generation.Variance = paste0(tempdir(),
  paste0("SeedGenerationVariance", par.i, ".sgrd")),
  Seed.Generation.Points = file.path(tempdir(),
  paste0("SeedGenerationPoints", par.i, ".shp")),
  Seed.Generation.Type = "0", Seed.Generation.Scale = "10.0",
  Generalisation.Flac = FALSE, Generalization.Mode = "1",
  Generalization.Radius = "1", Generalization.Threshold = "0.0",
  env = RSAGA::rsaga.env(), Grass.SLIC.Iter = 10,
  Grass.SLIC.Superpixels = 200, Grass.SLIC.Step = 0,
  Grass.SLIC.Compactness = 1, Grass.SLIC.Superpixels.MinSize = 1,
  Grass.SLIC.Memory = 300, Grass.SLIC.Perturb = 0,
  burn.Boundary.into.Segments = FALSE, estimateScaleParameter = FALSE,
  Mode.Filter.Flac = FALSE, Mode.Filter.Size = 7,
  Mode.Filter.Segment.MinSize = 3, par.i = "", Sieving.Flac = FALSE,
  Sieving.Mode = "0", Sieving.Thresh = 4, Sieving.Expand = 4, ...)

Arguments

Tool

GRASS, SAGA or GRASS Superixels SLIC. Definition of open-source software which will be used

Segments.Grid

output path of raster with segments

Segments.Poly

output path of polygon with segments

Input.Grid

vector containing grid(s) for segmentation. It is possible to add multiple gridsm, as well as different grids even in combination of SAGA and GRASS. By using SAGA and GRASS combination the following separation must be used: '<>' (SAGA before GRASS grids!)

Saga.Output.Grid

output of FAST REPRESENTATIVENESS in SAGA. Default: temp

Saga.Output.Lod

output Lod of Representativeness Function in SAGA. Default: temp

Output.Seeds

output of seed points as raster, used for segmentation. Default: temp

Fast.Representativeness.LevelOfGeneralisation

determining number of seed points. Default: "10.0"

Saga.Similarity

output of similarity grid. Default: temp

Saga.Segments.Seeds.Table

table of seeds information. Default: temp

Saga.Segmentation.Normalize

normalisation during imagery segmentation. Default: "0"

Saga.Segmentation.Neighbourhood

neighbourhood considered during imagery segmentation. Default: "0" (4, alternative: "1" for 8)

Saga.Segmentation.Method

segmentation method during imagery segmentation. Default: "0" (feature space and position)

Saga.Segmentation.Sig.1

variance in feature space in imagery segmentation. Default: "1.0"

Saga.Segmentation.Sig.2

variance in position space in imagery segmentation. Default: "1.0"

Saga.Segmentation.Threshold

similarity threshold for joining pixel to segments in imagery segmentation. Default: "0.0"

Saga.Segmentation.Refresh

refresh image after imagery segmentation. Default: "0"

Saga.Segmentation.Leafsize

parameter for speed optimation in imagery segmentation. Default: 256

Split

split polygons to singlepart in vectorising grid classes. Default: "0"

Grass.Segmentation.Threshold

similarity threshold for joining pixel to segments. Default: NULL, 0.0 is not allowed

Grass.Segmentation.Weighted

option of weighing input grids in segmentation. Default: "FALSE"

Grass.Segmentation.Method

type of GRASS Segmentation. Default: "region_growing"

Grass.Segmentation.Similarity

distance measurement of similarity. Default: "euclidean"

Grass.Segmentation.Minsize

minsize of segment. Default: 15

Grass.Segmentation.Memory

memory to be used for segmentation. Default: 300

Grass.Segmentation.Iterations

amount of allowed iterations. Default: 50

Grass.Segmentation.Seeds

input of seeds raster. Enables bottom-up segmentation. Default: NULL

Segmentation.Boundary.Grid

input of boundary raster. Enables top-down (or hierarchical) segmentation. Default: NULL. NULL values must be 0 (or any other not segment value!).

Grass.Segmentation.Goodness

name for output goodness of fit estimate map. Default:"Grass.Segmentation.Goodness"

AllVertices

use all vertices by vectorising grid classes. Default: "FALSE"

NoData

input data contains NoData value. Default: FALSE

Mask

mask raster to mask NoData from input. Default: NULL

show.output.on.console

show output on console. Default: FALSE

Seed.Method

type of seed method for getting seeds. Default: "" (alternative: "Fast Representativeness", "Seed Generation", "Superpixels SLIC")

Seed.Generation.Variance

output raster with variance of seed generation. Default: temp

Seed.Generation.Points

output of seed points as shapefile. Default: temp

Seed.Generation.Type

option of seed generation type. Default:"0" (minima of variance, alternative: maxima of variance)

Seed.Generation.Scale

determining number of seed points in seed generation. Default: "10.0"

Generalisation.Flac

performing (multiple) majority filter on segments. Default: FALSE

Generalization.Mode

search mode by filtering: Default: "1" (circle, alternative: square)

Generalization.Threshold

threshold for applying majority filters. Default: "0.0"

env

environment of RSAGA. Default: RSAGA::rsaga.env()

Grass.SLIC.Iter

maximum number of iterations. Default: 10

Grass.SLIC.Superpixels

approximate number of output super pixels. Default: 200

Grass.SLIC.Step

distance (number of cells) between initial super pixel centers. A step size > 0 overrides the number of super pixels. Default: 0

Grass.SLIC.Compactness

compactness. A larger value causes more compact superpixels. Default: 1.0

Grass.SLIC.Superpixels.MinSize

minimum superpixel size. Default: 1

Grass.SLIC.Memory

memory in MB. Default: 300

Grass.SLIC.Perturb

Perturb initial super pixel centers. Percent of intitial superpixel radius. Default: 0, range: 0-100

burn.Boundary.into.Segments

vector specifing if boundary grid is burned into segmentation (1) or seeds (2). Default: FALSE, maximum length: 2

estimateScaleParameter

must be only be TRUE when scale parameter function is used. Default: FALSE

Mode.Filter.Flac

re-assign objects of a specific size based on mode values to its surroundings (moving window). Default: FALSE

Mode.Filter.Size

moving window size of mode-filter. Default: 3

Mode.Filter.Segment.MinSize

objects smaller and equal to this size are selected for filtering. Default: 3

par.i

run number. Default: ""

Sieving.Flac

perform sieving. Default: FALSE

Sieving.Mode

sieving mode. Default:"0"

Sieving.Thresh

minsize of clumps. Default: 4

Sieving.Expand

expand cells using majority filter. radius in cell sizes. Default:4


ggRaver/Lslide documentation built on April 8, 2022, 7:14 a.m.