Performs morphological profiles analysis on an input image channel.
This algorithm is derived from 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.
Depending of the profile selection, the application provides:
- The multi scale geodesic morphological opening or closing profile of the input image.
- The multi scale derivative of the opening or closing profile.
- The parameter (called characteristic) of the maximum derivative value of the multi scale closing or opening profile for which this maxima occurs.
- The labeled classification of the input image.
The behavior of the classification is:
Given and two membership values, two labels associated, and a tolerance value, the following decision rule is applied:
The output image can be:- A multi band image for the opening/closing normal or derivative profiles. - A mono band image for the opening/closing characteristics. - A labeled image for the classification.
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.
-out image [dtype] Mandatory
The output image.
-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
-size int Default value: 5
Size of the profiles
-radius int Default value: 5
Initial radius of the structuring element (in pixels)
-step int Default value: 1
Radius step along the profile (in pixels)
-profile [opening|closing|derivativeopening|derivativeclosing|openingcharacteristics|closingcharacteristics|classification] Default value: opening
From the command-line:
otbcli_MorphologicalProfilesAnalysis -in ROI_IKO_PAN_LesHalles.tif -channel 1 -structype ball -profile classification -size 5 -radius 1 -step 1 -profile.classification.sigma 1 -out output.tif
import otbApplication app = otbApplication.Registry.CreateApplication("MorphologicalProfilesAnalysis") app.SetParameterString("in", "ROI_IKO_PAN_LesHalles.tif") app.SetParameterInt("channel", 1) app.SetParameterString("structype","ball") app.SetParameterString("profile","classification") app.SetParameterInt("size", 5) app.SetParameterInt("radius", 1) app.SetParameterInt("step", 1) app.SetParameterFloat("profile.classification.sigma", 1) app.SetParameterString("out", "output.tif") app.ExecuteAndWriteOutput()
Generation of the morphological profile is not streamable, pay attention to this fact when setting the radius initial size and step of the structuring element.