LargeScaleMeanShift

基于MeanShift的大规模分割

描述

此应用程序将MeanShift框架的4个步骤链接在一起,即 MeanShiftSmoothing vt.的. LSMSSegmentation vt.的. LSMSSmallRegionsMerging 以及 LSMSVectorization

此应用程序可以是基于对象的分析的初步步骤。

它生成一个包含用MeanShift算法提取的区域的矢量数据文件。空间和距离半径参数允许根据图像的动态和分辨率来调整算法的灵敏度。有一个步骤是删除其大小(以像素为单位)小于给定‘minSize’参数的小区域。这些区域被合并到类似的相邻区域。在输出向量中,有描述每个区域的附加字段。具体地,使用输入图像作为支持来计算每个区域的平均值和标准差(对于每个波段)。如果给出了一个可选的‘imfield’映像,它将被用作支持映像。

参数

Input Image -in image Mandatory
The input image can be any single or multiband image. Beware of potential imbalance between bands ranges as it may alter euclidean distance.

Spatial radius -spatialr int Default value: 5
Radius of the spatial neighborhood for averaging. Higher values will result in more smoothing and higher processing time.

Range radius -ranger float Default value: 15
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 int Default value: 50
Minimum Segment Size. If, after the segmentation, a segment is of size strictly 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 int Default value: 500
Size of tiles along the X-axis for tile-wise processing.

Size of tiles in pixel (Y-axis) -tilesizey int Default value: 500
Size of tiles along the Y-axis for tile-wise processing.

Output mode -mode [vector|raster] Default value: vector
Type of segmented output

  • Segmentation as vector output
    In this mode, the application will produce a vector file or database and compute field values for each region
  • Standard segmentation with labeled raster output
    In this mode, the application will produce a standard labeled raster.

作为向量输出选项的分割

Support image for field computation -mode.vector.imfield image
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 filename [dtype] Mandatory
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.

带有标注栅格输出选项的标准分段

The output raster image -mode.raster.out image [dtype] Mandatory
It corresponds to the output of the small region merging step.


Temporary files cleaning -cleanup bool Default value: true
If activated, the application will try to clean all temporary files it created

Available RAM (MB) -ram int Default value: 256
Available memory for processing (in MB).

实例

从命令行执行以下操作:

otbcli_LargeScaleMeanShift -in QB_1_ortho.tif -spatialr 4 -ranger 80 -minsize 16 -mode.vector.out regions.shp

来自Python的评论:

import otbApplication

app = otbApplication.Registry.CreateApplication("LargeScaleMeanShift")

app.SetParameterString("in", "QB_1_ortho.tif")
app.SetParameterInt("spatialr", 4)
app.SetParameterFloat("ranger", 80)
app.SetParameterInt("minsize", 16)
app.SetParameterString("mode.vector.out", "regions.shp")

app.ExecuteAndWriteOutput()