This algorithm merges regional extrema based on a contrast coefficient criterion h.
The input is subtracted from the contrast coefficient h, then a grayscale reconstruction is performed on the result of this subtraction.
The regional extrema of the reconstructed image are called the HExtrema.
The algorithm only works with homogeneous gray level objects.
The appropriate h value depends on the local contrast between the gray level objects to detect.
Increasing this factor too much may eliminate some previously merged objects.
This algorithm is useful for filtering noisy extrema sets.
It also can be used as particle markers in various algorithms; for example, watershed detection.
See also
// Command constructor.HExtrema2d();/// Gets the inputImage parameter./// The input grayscale image.
std::shared_ptr< iolink::ImageView> inputImage()const;/// Sets the inputImage parameter./// The input grayscale image.void setInputImage( std::shared_ptr< iolink::ImageView> inputImage );/// Gets the extremaType parameter./// The type of extrema to detect.HExtrema2d::ExtremaType extremaType()const;/// Sets the extremaType parameter./// The type of extrema to detect.void setExtremaType(constHExtrema2d::ExtremaType& extremaType );/// Gets the contrast parameter./// The contrast level h.uint32_t contrast()const;/// Sets the contrast parameter./// The contrast level h.void setContrast(constuint32_t& contrast );/// Gets the neighborhood parameter./// The 2D neighborhood configuration.HExtrema2d::Neighborhood neighborhood()const;/// Sets the neighborhood parameter./// The 2D neighborhood configuration.void setNeighborhood(constHExtrema2d::Neighborhood& neighborhood );/// Gets the outputBinaryImage parameter./// The output binary. Its dimensions is forced to the same values as the input.
std::shared_ptr< iolink::ImageView> outputBinaryImage()const;/// Sets the outputBinaryImage parameter./// The output binary. Its dimensions is forced to the same values as the input.void setOutputBinaryImage( std::shared_ptr< iolink::ImageView> outputBinaryImage );// Method to launch the command.void execute();
# Property of the inputImage parameter.HExtrema2d.input_image
# Property of the extremaType parameter.HExtrema2d.extrema_type
# Property of the contrast parameter.HExtrema2d.contrast
# Property of the neighborhood parameter.HExtrema2d.neighborhood
# Property of the outputBinaryImage parameter.HExtrema2d.output_binary_image
// Method to launch the command.
execute()
// Command constructor.HExtrema2d()// Property of the inputImage parameter.HExtrema2d.inputImage
// Property of the extremaType parameter.HExtrema2d.extremaType
// Property of the contrast parameter.HExtrema2d.contrast
// Property of the neighborhood parameter.HExtrema2d.neighborhood
// Property of the outputBinaryImage parameter.HExtrema2d.outputBinaryImage
// Method to launch the command.Execute()
Parameters
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input grayscale image.
Image
Grayscale
nullptr
extremaType
The type of extrema to detect.
MAXIMA
The regional maxima are extracted from the input image.
MINIMA
The regional minima are extracted from the input image.
Enumeration
MAXIMA
contrast
The contrast level h.
UInt32
Any value
4
neighborhood
The 2D neighborhood configuration.
CONNECTIVITY_4
The structuring element is a cross.
CONNECTIVITY_8
The structuring element is a square.
Enumeration
CONNECTIVITY_8
outputBinaryImage
The output binary. Its dimensions is forced to the same values as the input.
Image
nullptr
Parameter Name
Description
Type
Supported Values
Default Value
input_image
The input grayscale image.
image
Grayscale
None
extrema_type
The type of extrema to detect.
MAXIMA
The regional maxima are extracted from the input image.
MINIMA
The regional minima are extracted from the input image.
enumeration
MAXIMA
contrast
The contrast level h.
uint32
Any value
4
neighborhood
The 2D neighborhood configuration.
CONNECTIVITY_4
The structuring element is a cross.
CONNECTIVITY_8
The structuring element is a square.
enumeration
CONNECTIVITY_8
output_binary_image
The output binary. Its dimensions is forced to the same values as the input.
image
None
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input grayscale image.
Image
Grayscale
null
extremaType
The type of extrema to detect.
MAXIMA
The regional maxima are extracted from the input image.
MINIMA
The regional minima are extracted from the input image.
Enumeration
MAXIMA
contrast
The contrast level h.
UInt32
Any value
4
neighborhood
The 2D neighborhood configuration.
CONNECTIVITY_4
The structuring element is a cross.
CONNECTIVITY_8
The structuring element is a square.
Enumeration
CONNECTIVITY_8
outputBinaryImage
The output binary. Its dimensions is forced to the same values as the input.