GenericRegionMerging¶
Segmentation using region merging algorithm
Description¶
- This application allows to use the Generic Region Merging library (GRM).
- It provides currently 3 homogeneity criteria: Euclidean Distance, Full Lambda Schedule and Baatz & Schape criterion.
Parameters¶
Input Image -in image
Mandatory
Ouput Label Image -out image [dtype]
Mandatory
Homogeneity criterion to use -criterion [bs|ed|fls]
Default value: bs
- Baatz & Schape
- Euclidean Distance
- Full Lambda Schedule
Threshold for the criterion -threshold float
Mandatory
Number of iterations -niter int
Default value: 0
Activate it to boost the segmentation speed -speed int
Default value: 0
Weight for the spectral homogeneity -cw float
Default value: 0.5
Weight for the spatial homogeneity -sw float
Default value: 0.5
Examples¶
From the command-line:
otbcli_GenericRegionMerging -in QB_Toulouse_Ortho_XS.tif -out labels.tif -criterion bs -threshold 60 -cw 0.7 -sw 0.3
From Python:
import otbApplication
app = otbApplication.Registry.CreateApplication("GenericRegionMerging")
app.SetParameterString("in", "QB_Toulouse_Ortho_XS.tif")
app.SetParameterString("out", "labels.tif")
app.SetParameterString("criterion","bs")
app.SetParameterFloat("threshold", 60)
app.SetParameterFloat("cw", 0.7)
app.SetParameterFloat("sw", 0.3)
app.ExecuteAndWriteOutput()
Limitations¶
This application is not adapted for large images.