SOMClassification

SOM image classification.

Description

Unsupervised Self Organizing Map image classification.

Parameters

InputImage -in image Mandatory
Input image to classify.

OutputImage -out image [dtype] Mandatory
Output classified image (each pixel contains the index of its corresponding vector in the SOM).

ValidityMask -vm image
Validity mask (only pixels corresponding to a mask value greater than 0 will be used for learning)

TrainingProbability -tp float Default value: 1
Probability for a sample to be selected in the training set

TrainingSetSize -ts int
Maximum training set size (in pixels)

SOM Map -som image [dtype]
Output image containing the Self-Organizing Map

SizeX -sx int Default value: 32
X size of the SOM map

SizeY -sy int Default value: 32
Y size of the SOM map

NeighborhoodX -nx int Default value: 10
X size of the initial neighborhood in the SOM map

NeighborhoodY -ny int Default value: 10
Y size of the initial neighborhood in the SOM map

NumberIteration -ni int Default value: 5
Number of iterations for SOM learning

BetaInit -bi float Default value: 1
Initial learning coefficient

BetaFinal -bf float Default value: 0.1
Final learning coefficient

InitialValue -iv float Default value: 0
Maximum initial neuron weight

Random seed -rand int
Set a specific random seed with integer value.

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

Examples

From the command-line:

otbcli_SOMClassification -in QB_1_ortho.tif -out SOMClassification.tif -tp 1.0 -ts 16384 -sx 32 -sy 32 -nx 10 -ny 10 -ni 5 -bi 1.0 -bf 0.1 -iv 0

From Python:

import otbApplication

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

app.SetParameterString("in", "QB_1_ortho.tif")
app.SetParameterString("out", "SOMClassification.tif")
app.SetParameterFloat("tp", 1.0)
app.SetParameterInt("ts", 16384)
app.SetParameterInt("sx", 32)
app.SetParameterInt("sy", 32)
app.SetParameterInt("nx", 10)
app.SetParameterInt("ny", 10)
app.SetParameterInt("ni", 5)
app.SetParameterFloat("bi", 1.0)
app.SetParameterFloat("bf", 0.1)
app.SetParameterFloat("iv", 0)

app.ExecuteAndWriteOutput()