Large-Scale MeanShift
Brief Description
Large-scale segmentation using MeanShift
Tags
Segmentation, LSMS
Long Description
This application chains together the 4 steps of the MeanShit framework, that is the MeanShiftSmoothing [1], the LSMSSegmentation [2], the LSMSSmallRegionsMerging [3] and the LSMSVectorization [4].
This application can be a preliminary step for an object-based analysis.
It generates a vector data file containing the regions extracted with the MeanShift algorithm. The spatial and range radius parameters allow adapting the sensitivity of the algorithm depending on the image dynamic and resolution. There is a step to remove small regions whose size (in pixels) is less than the given 'minsize' parameter. These regions are merged to a similar neighbor region. In the output vectors, there are additional fields to describe each region. In particular the mean and standard deviation (for each band) is computed for each region using the input image as support. If an optional 'imfield' image is given, it will be used as support image instead.
Parameters
Input Image (in): The input image can be any single or multiband image. Beware of pontential imbalance between bands ranges as it may alter euclidean distance.
Spatial radius (spatialr): Radius of the spatial neighborhood for averaging. Higher values will result in more smoothing and higher processing time.
Range radius (ranger): 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.
Minimum Segment Size (minsize): Minimum Segment Size. If, after the segmentation, a segment is of size lower than this criterion, the segment is merged with the segment that has the closest sepctral signature.
Size of tiles in pixel (X-axis) (tilesizex): Size of tiles along the X-axis for tile-wise processing.
Size of tiles in pixel (Y-axis) (tilesizey): Size of tiles along the Y-axis for tile-wise processing.
Output mode (mode): Type of segmented output
Segmentation as vector output (vector): In this mode, the application will produce a vector file or database and compute field values for each region
Support image for field computation (mode.vector.imfield): This is an optional support image that can be used to compute field values in each region. Otherwise, the input image is used as support.
Output GIS vector file (mode.vector.out): The output GIS vector file, representing the vectorized version of the segmented image where the features of the polygons are the radiometric means and variances.
Standard segmentation with labeled raster output (raster): In this mode, the application will produce a standard labeled raster.
The output raster image (mode.raster.out): It corresponds to the output of the small region merging step.
Temporary files cleaning (cleanup): If activated, the application will try to clean all temporary files it created
Available RAM (Mb) (ram): Available memory for processing (in MB)
Load otb application from xml file (inxml): Load otb application from xml file
Save otb application to xml file (outxml): Save otb application to xml file
Limitations
None
Authors
OTB-Team
See also
[1] MeanShiftSmoothing
[2] LSMSSegmentation
[3] LSMSSmallRegionsMerging
[4] LSMSVectorization
Example of use
in: QB_1_ortho.tif
spatialr: 4
ranger: 80
minsize: 16
mode.vector.out: regions.shp
otbcli_LargeScaleMeanShift -in QB_1_ortho.tif -spatialr 4 -ranger 80 -minsize 16 -mode.vector.out regions.shp