LSMSVectorization¶
此应用程序执行大规模Mean-Shift分段工作流的第四步 [1] 。
描述¶
Given a segmentation result (label image), that may come from the LSMSSegmentation [2] application (out parameter) or have been processed for small regions merging [3] (out parameter), it will convert it to a GIS vector file containing one polygon per segment. Each polygon contains additional fields: mean and variance of each channels from input image (in parameter), segmentation image label, number of pixels in the polygon. For large images one can use the tilesizex and tilesizey parameters for tile-wise processing, with the guarantees of identical results.
参数¶
Input Image -in image
Mandatory
The input image, containing initial spectral signatures corresponding to the segmented image (inseg).
Segmented image -inseg image
Mandatory
Segmented image where each pixel value is the unique integer label of the segment it belongs to.
Output GIS vector file -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.
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.
Available RAM (MB) -ram int
Default value: 256
Available memory for processing (in MB).
实例¶
从命令行执行以下操作:
otbcli_LSMSVectorization -in maur_rgb.png -inseg merged.tif -out vector.shp -tilesizex 256 -tilesizey 256
来自Python的评论:
import otbApplication
app = otbApplication.Registry.CreateApplication("LSMSVectorization")
app.SetParameterString("in", "maur_rgb.png")
app.SetParameterString("inseg", "merged.tif")
app.SetParameterString("out", "vector.shp")
app.SetParameterInt("tilesizex", 256)
app.SetParameterInt("tilesizey", 256)
app.ExecuteAndWriteOutput()
局限性¶
此应用程序是大规模Mean-Shift分段工作流程(LSM)的一部分,可能不适用于任何其他目的。