MorphologicalClassification - Morphological Classification ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Performs morphological convex, concave and flat classification on an input image channel Detailed description -------------------- 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 :math:`f` denote the input image and :math:`\psi_{N}(f)` the geodesic leveling of :math:`f` with a structuring element of size :math:`N`. One can derive the following decision rule to classify :math:`f` into Convex (label :math:`\stackrel{\smile}{k}`), Concave (label :math:`\stackrel{\frown}{k}`) and Flat (label :math:`\bar{k}`): :math:`f(n) = \begin{cases} \stackrel{\smile}{k} & : f-\psi_{N}(f)>\sigma \\ \stackrel{\frown}{k} & : \psi_{N}(f)-f>\sigma \\ \bar{k} & : \mid f - \psi_{N}(f) \mid \leq \sigma \end{cases}` This output is a labeled image (0 : Flat, 1 : Convex, 2 : Concave) Parameters ---------- This section describes in details the parameters available for this application. Table [#]_ presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is *MorphologicalClassification* . .. [#] Table: Parameters table for Morphological Classification. +---------------+----------------------------------+--------------------------+ |Parameter Key |Parameter Name |Parameter Type | +===============+==================================+==========================+ |in |Input Image |Input image | +---------------+----------------------------------+--------------------------+ |out |Output Image |Output image | +---------------+----------------------------------+--------------------------+ |channel |Selected Channel |Int | +---------------+----------------------------------+--------------------------+ |ram |Available RAM (Mb) |Int | +---------------+----------------------------------+--------------------------+ |structype |Structuring Element Type |Choices | +---------------+----------------------------------+--------------------------+ |structype ball |Ball | *Choice* | +---------------+----------------------------------+--------------------------+ |structype cross|Cross | *Choice* | +---------------+----------------------------------+--------------------------+ |radius |Radius |Int | +---------------+----------------------------------+--------------------------+ |sigma |Sigma value for leveling tolerance|Float | +---------------+----------------------------------+--------------------------+ |inxml |Load otb application from xml file|XML input parameters file | +---------------+----------------------------------+--------------------------+ |outxml |Save otb application to xml file |XML output parameters file| +---------------+----------------------------------+--------------------------+ - **Input Image**: The input image to be classified. - **Output Image**: The output classified image with 3 different values (0 : Flat, 1 : Convex, 2 : Concave). - **Selected Channel**: The selected channel index for input image. - **Available RAM (Mb)**: Available memory for processing (in MB). - **Structuring Element Type**: Choice of the structuring element type. Available choices are: * **Ball** * **Cross** - **Radius**: Radius of the structuring element (in pixels). - **Sigma value for leveling tolerance**: Sigma value for leveling tolerance. - **Load otb application from xml file**: Load otb application from xml file. - **Save otb application to xml file**: Save otb application to xml file. Example ------- To run this example in command-line, use the following: :: otbcli_MorphologicalClassification -in ROI_IKO_PAN_LesHalles.tif -channel 1 -structype ball -radius 5 -sigma 0.5 -out output.tif To run this example from Python, use the following code snippet: :: #!/usr/bin/python # Import the otb applications package import otbApplication # The following line creates an instance of the MorphologicalClassification application MorphologicalClassification = otbApplication.Registry.CreateApplication("MorphologicalClassification") # The following lines set all the application parameters: MorphologicalClassification.SetParameterString("in", "ROI_IKO_PAN_LesHalles.tif") MorphologicalClassification.SetParameterInt("channel", 1) MorphologicalClassification.SetParameterString("structype","ball") MorphologicalClassification.SetParameterInt("radius", 5) MorphologicalClassification.SetParameterFloat("sigma", 0.5) MorphologicalClassification.SetParameterString("out", "output.tif") # The following line execute the application MorphologicalClassification.ExecuteAndWriteOutput() Limitations ~~~~~~~~~~~ Generation of the morphological classification is not streamable, pay attention to this fact when setting the radius size of the structuring element. Authors ~~~~~~~ This application has been written by OTB-Team. See Also ~~~~~~~~ These additional resources can be useful for further information: | otbConvexOrConcaveClassificationFilter class