3.5.4 Morphological features extraction
Morphological features can be highlighted by using image filters based on mathematical morphology either
on binary or gray scale images.
Binary morphological operations
This application performs binary morphological operations (dilation, erosion, opening and closing) on a
mono band image with a specific structuring element (a ball or a cross) having one radius along X and
another one along Y. NB: the cross shaped structuring element has a fixed radius equal to 1 pixel in both X
and Y directions.
The BinaryMorphologicalOperation application has the following input parameters:
- -in the input image to be filtered
- -channel the selected channel index in the input image to be processed (default value is 1)
- -structype the choice of the structuring element type (ball/cross) (default value is ball)
- (-structype.ball.xradius) the ball structuring element X Radius (only if
structype==ball) (default value is 5 pixels)
- (-structype.ball.yradius) the ball structuring element Y Radius (only if
structype==ball) (default value is 5 pixels)
- -filter the choice of the morphological operation (dilate/erode/opening/closing) (default
value is dilate)
- (-filter.dilate.foreval) the foreground value for the dilation (idem for
filter.erode/opening/closing) (default value is 1)
- (-filter.dilate.backval)
the background value for the dilation (idem for filter.erode/opening/closing) (default value is
0)
- -out the output filtered image
The application can be used like this:
otbcli_BinaryMorphologicalOperation -in InputImage
-channel 1
-structype ball
-structype.ball.xradius 10
-structype.ball.yradius 5
-filter opening
-filter.opening.foreval 1.0
-filter.opening.backval 0.0
-out OutputImage
Gray scale morphological operations
This application performs morphological operations (dilation, erosion, opening and closing) on a gray scale
mono band image with a specific structuring element (a ball or a cross) having one radius along X and
another one along Y. NB: the cross shaped structuring element has a fixed radius equal to 1 pixel in both X
and Y directions.
The GrayScaleMorphologicalOperation application has the following input parameters:
- -in the input image to be filtered
- -channel the selected channel index in the input image to be processed (default value is 1)
- -structype the choice of the structuring element type (ball/cross) (default value is ball)
- (-structype.ball.xradius) the ball structuring element X Radius (only if
structype==ball) (default value is 5 pixels)
- (-structype.ball.yradius) the ball structuring element Y Radius (only if
structype==ball) (default value is 5 pixels)
- -filter the choice of the morphological operation (dilate/erode/opening/closing) (default
value is dilate)
- -out the output filtered image
The application can be used like this:
otbcli_GrayScaleMorphologicalOperation -in InputImage
-channel 1
-structype ball
-structype.ball.xradius 10
-structype.ball.yradius 5
-filter opening
-out OutputImage