LSMSVectorization

This application performs the fourth step of the exact Large-Scale Mean-Shift segmentation workflow [1].

Description

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.

Parameters

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).

Examples

From the command-line:

otbcli_LSMSVectorization -in maur_rgb.png -inseg merged.tif -out vector.shp -tilesizex 256 -tilesizey 256

From 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()

Limitations

This application is part of the Large-Scale Mean-Shift segmentation workflow (LSMS) and may not be suited for any other purpose.

See also

[1] Michel, J., Youssefi, D., & Grizonnet, M. (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.
[2] LSM:ref:Segmentation
[3] LSMSmallRegionMerging