Performs morphological convex, concave and flat classification on an input image channel
This algorithm is based on the following publication: Martino Pesaresi and Jon Alti Benediktsson, Member, IEEE: A new approach for the morphological segmentation of high resolution satellite imagery. IEEE Transactions on geoscience and remote sensing, vol. 39, NO. 2, February 2001, p. 309-320.
This application perform the following decision rule to classify a pixel between the three classes Convex, Concave and Flat. Let denote the input image and the geodesic leveling of with a structuring element of size . One can derive the following decision rule to classify into Convex (label ), Concave (label ) and Flat (label ):
The output is a labeled image (0: Flat, 1: Convex, 2: Concave)
This application has several output images and supports “multi-writing”. Instead of computing and writing each image independently, the streamed image blocks are written in a synchronous way for each output. The output images will be computed strip by strip, using the available RAM to compute the strip size, and a user defined streaming mode can be specified using the streaming extended filenames (type, mode and value). Note that multi-writing can be disabled using the multi-write extended filename option: &multiwrite=false, in this case the output images will be written one by one. Note that multi-writing is not supported for MPI writers.
-in image Mandatory
The input image to be classified.
-out image [dtype] Mandatory
The output classified image with 3 different values (0: Flat, 1: Convex, 2: Concave)
-channel int Default value: 1
The selected channel index for input image
Structuring Element Type
-structype [ball|cross] Default value: ball
Choice of the structuring element type
-radius int Default value: 5
Radius of the structuring element (in pixels), default value is 5.
Sigma value for leveling tolerance
-sigma float Default value: 0.5
Sigma value for leveling tolerance, default value is 0.5.
Available RAM (MB)
-ram int Default value: 256
Available memory for processing (in MB).
From the command-line:
otbcli_MorphologicalClassification -in ROI_IKO_PAN_LesHalles.tif -channel 1 -structype ball -radius 5 -sigma 0.5 -out output.tif
import otbApplication app = otbApplication.Registry.CreateApplication("MorphologicalClassification") app.SetParameterString("in", "ROI_IKO_PAN_LesHalles.tif") app.SetParameterInt("channel", 1) app.SetParameterString("structype","ball") app.SetParameterInt("radius", 5) app.SetParameterFloat("sigma", 0.5) app.SetParameterString("out", "output.tif") app.ExecuteAndWriteOutput()
Generation of the morphological classification is not streamable, pay attention to this fact when setting the radius size of the structuring element.