View source: R/SOptim_SegmentationFunctions.R
segmentation_SAGA_SRG | R Documentation |
A function to access SAGA's Seeded Region Growing segmentation algorithm through CLI and optimize some of its parameters using genetic algorithms. The segmentation algorithm has two stages: 1) seed generation and, 2) seeded region growing.
segmentation_SAGA_SRG(
x,
rstList,
outputSegmRst = NULL,
Bandwidth = NULL,
GaussianWeightingBW = NULL,
VarFeatSpace = NULL,
VarPosSpace = NULL,
seedType = 0,
method1 = 0,
DWeighting = 3,
normalize = 0,
neighbour = 0,
method2 = 0,
thresh = 0,
leafSize = 1024,
SAGApath = NULL,
verbose = TRUE
)
x |
A vector containing the parameters to be optimized by package GA:
If you are using this function outside an optimization context it is better to directly define the
segmentation parameters in |
rstList |
File paths to the SAGA header files (format: .sgrd) used to perform image segmentation.
File names should be provided either by a single string with each file separated by a ';'
(e.g. |
outputSegmRst |
A path to the output segmented image in SAGA .sdat/.srgd format (default: |
Bandwidth |
Segmentation bandwidth. |
GaussianWeightingBW |
Gaussian and Exponential Weighting Bandwidth. |
VarFeatSpace |
Variance in feature space. |
VarPosSpace |
Variance in position space. |
seedType |
Seed type options: [0] minima of variance [1] maxima of variance (default: 0). |
method1 |
Method 1: [0] band width smoothing [1] band width search (default: 0). |
DWeighting |
Weighting function: [0] no distance weighting [1] inverse distance to a power [2] exponential [3] gaussian weighting (default: 3) - note: only exponential or Gaussian will work! Otherwise it will fail to optimize DW_BANDWIDTH parameter. |
normalize |
Normalize inputs? [0] No [1] Yes (default: 0). |
neighbour |
Select the neighbourhood type: [0] 4 connected pixels (von Neumann), [1] 8 connected pixels (Moore) (default is 0). |
method2 |
Method 2: [0] feature space and position [1] feature space (default: 0). |
thresh |
Similarity threshold (default: 0). |
leafSize |
Leaf size (for speed optimisation) (default: 1024). |
SAGApath |
Path to SAGA command-line interface (default: NULL; meaning that PATH env variable is used). |
verbose |
Output messages? (default: TRUE) |
Only accepts SAGA raster file format (problems encontered during segmentation when using other file formats).
Only parameters in x
will be optimized while the remaining will maintain their default values.
This function uses the following SAGA commands: saga_cmd imagery_segmentation 2 and saga_cmd imagery_segmentation 3. See more info at: http://www.saga-gis.org/saga_tool_doc/3.0.0/imagery_segmentation_2.html http://www.saga-gis.org/saga_tool_doc/3.0.0/imagery_segmentation_3.html http://www.saga-gis.org/saga_tool_doc/
A list object containing output file paths resulting from the segmentation run. (these files will be cleaned after each GA iteration).
Adams, R. & Bischof, L. (1994): Seeded Region Growing. IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol.16, No.6, p.641-647.
Bechtel, B., Ringeler, A. & Boehner, J. (2008): Segmentation for Object Extraction of Trees using MATLAB and SAGA. In: Boehner, J., Blaschke, T., Montanarella, L. [Eds.]: SAGA - Seconds Out. Hamburger Beitraege zur Physischen Geographie und Landschaftsoekologie, 19:59-70. download
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.