This algorithm emphasizes the edges of the objects using morphological operations.
Three modes are available to enhance edges inside particles (Internal), outside particles (External)
or on the particle borders (Centered).
(a)
(b)
(c)
Figure 1. The Morphological Gradient effects with label image in overlay:
(a) input gray level image, (b) internal morphological gradient,
(c) external morphological gradient
This algorithm uses ErosionBall3d or DilationBall3d and combine them as follows:
Internal:O=I−EB(I)
External:O=DB(I)−I
CenteredO=DB(I)−EB(I)
Where EB (resp. DB) is a morphological erosion (resp. dilation) by a structuring element B.
The morphological gradient can be considered as a non-linear high-pass filter.
The bright edges are enhanced with a thickness proportional to the size of the structuring element.
It is an approximation of the gradient modulus.
Two additional parameters are also provided:
The computation mode for morphological erosion and dilation: Fast or Precise.
The size of structuring element for morphological operations.
// Command constructor.MorphologicalGradient3d();/// Gets the inputImage parameter./// The input image.
std::shared_ptr< iolink::ImageView> inputImage()const;/// Sets the inputImage parameter./// The input image.void setInputImage( std::shared_ptr< iolink::ImageView> inputImage );/// Gets the kernelRadius parameter./// The radius in pixels of the sphere structuring element used for morphological erosion and dilation. In centered mode, it corresponds to the thickness of the extracted edges and to their half thickness in other modes.uint32_t kernelRadius()const;/// Sets the kernelRadius parameter./// The radius in pixels of the sphere structuring element used for morphological erosion and dilation. In centered mode, it corresponds to the thickness of the extracted edges and to their half thickness in other modes.void setKernelRadius(constuint32_t& kernelRadius );/// Gets the gradientMode parameter./// The computation mode of morphological gradient.MorphologicalGradient3d::GradientMode gradientMode()const;/// Sets the gradientMode parameter./// The computation mode of morphological gradient.void setGradientMode(constMorphologicalGradient3d::GradientMode& gradientMode );/// Gets the precision parameter./// The precision for computation for morphological operations.MorphologicalGradient3d::Precision precision()const;/// Sets the precision parameter./// The precision for computation for morphological operations.void setPrecision(constMorphologicalGradient3d::Precision& precision );/// Gets the outputImage parameter./// The output image.
std::shared_ptr< iolink::ImageView> outputImage()const;/// Sets the outputImage parameter./// The output image.void setOutputImage( std::shared_ptr< iolink::ImageView> outputImage );// Method to launch the command.void execute();
# Property of the inputImage parameter.MorphologicalGradient3d.input_image
# Property of the kernelRadius parameter.MorphologicalGradient3d.kernel_radius
# Property of the gradientMode parameter.MorphologicalGradient3d.gradient_mode
# Property of the precision parameter.MorphologicalGradient3d.precision
# Property of the outputImage parameter.MorphologicalGradient3d.output_image
// Method to launch the command.
execute()
// Command constructor.MorphologicalGradient3d()// Property of the inputImage parameter.MorphologicalGradient3d.inputImage
// Property of the kernelRadius parameter.MorphologicalGradient3d.kernelRadius
// Property of the gradientMode parameter.MorphologicalGradient3d.gradientMode
// Property of the precision parameter.MorphologicalGradient3d.precision
// Property of the outputImage parameter.MorphologicalGradient3d.outputImage
// Method to launch the command.Execute()
Parameters
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input image.
Image
Binary, Label, Grayscale or Multispectral
nullptr
kernelRadius
The radius in pixels of the sphere structuring element used for morphological erosion and dilation. In centered mode, it corresponds to the thickness of the extracted edges and to their half thickness in other modes.
UInt32
>=1
3
precision
The precision for computation for morphological operations.
FASTER
The mophological operations are computed using the fast mode .
PRECISE
The mophological operations are computed using the precise mode.
Enumeration
FASTER
gradientMode
The computation mode of morphological gradient.
INTERNAL
The engine emphasizes the internal edges.
EXTERNAL
The engine emphasizes the external edges.
CENTERED
The engine emphasizes the edges on objects borders.
Enumeration
INTERNAL
outputImage
The output image.
Image
nullptr
Parameter Name
Description
Type
Supported Values
Default Value
input_image
The input image.
image
Binary, Label, Grayscale or Multispectral
None
kernel_radius
The radius in pixels of the sphere structuring element used for morphological erosion and dilation. In centered mode, it corresponds to the thickness of the extracted edges and to their half thickness in other modes.
uint32
>=1
3
precision
The precision for computation for morphological operations.
FASTER
The mophological operations are computed using the fast mode .
PRECISE
The mophological operations are computed using the precise mode.
enumeration
FASTER
gradient_mode
The computation mode of morphological gradient.
INTERNAL
The engine emphasizes the internal edges.
EXTERNAL
The engine emphasizes the external edges.
CENTERED
The engine emphasizes the edges on objects borders.
enumeration
INTERNAL
output_image
The output image.
image
None
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input image.
Image
Binary, Label, Grayscale or Multispectral
null
kernelRadius
The radius in pixels of the sphere structuring element used for morphological erosion and dilation. In centered mode, it corresponds to the thickness of the extracted edges and to their half thickness in other modes.
UInt32
>=1
3
precision
The precision for computation for morphological operations.
FASTER
The mophological operations are computed using the fast mode .
PRECISE
The mophological operations are computed using the precise mode.
Enumeration
FASTER
gradientMode
The computation mode of morphological gradient.
INTERNAL
The engine emphasizes the internal edges.
EXTERNAL
The engine emphasizes the external edges.
CENTERED
The engine emphasizes the edges on objects borders.