View source: R/SOptim_SegmentationFunctions.R
segmentation_OTB_LSMS | R Documentation |
A function providing CLI access to OTB's LSMS segmentation and optimize its parameters
using genetic algorithms. This function uses the same values for the spectral and spatial
range parameters in the mean-shift smoothing and large-scale segmentation step. If you wish
to use different values in each step use function segmentation_OTB_LSMS2
.
segmentation_OTB_LSMS(
x,
inputRstPath,
outputSegmRst = NULL,
SpectralRange = NULL,
SpatialRange = NULL,
MinSize = NULL,
lsms_maxiter = 10,
tilesizex = 2500,
tilesizey = 2500,
otbBinPath = NULL,
RAM = 3072,
verbose = TRUE
)
x |
A vector of size three containing the parameters that will be optimized by the genetic algorithms from package GA:
If you are using this function outside an optimization context it is better to directly
define the segmentation parameters in |
inputRstPath |
The input raster dataset used to perform the image segmentation using OTB LSMS algorithm (typically a multi-layered raster dataset with segmentation features in each band). |
outputSegmRst |
A path to the output segmented image (default: |
SpectralRange |
Range radius defining the radius (expressed in radiometry units) in the multi-spectral space (float). |
SpatialRange |
Spatial radius of the neighborhood (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 |
RAM |
Available memory for processing the image data (in MB). |
verbose |
Print output messages (default: TRUE). |
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_.
Changed system() option to show.output.on.console = TRUE
to avoid for errors
happening on windows-10...
Check [OTB documentation](https://www.orfeo-toolbox.org/CookBook/Applications/app_LargeScaleMeanShift.html) for more info.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.