UltimateErosion
Computes the ultimate eroded set of a binary image.
Access to parameter description
For an introduction:
Then each erosion step is reconstructed into the previous erosion step (Yi image below).
The difference between the eroded image Xi and the reconstructed image Yi is the centroid of objects that disappeared at the erosion step number i.
This algorithm enables counting the number of convex particles, even if some of them are touching each other, as long as the pseudo-centre of each particle is outside of other particles.

Figure 1. Ultimate erosion on a basic example
See also
Access to parameter description
For an introduction:
- section Mathematical Morphology
- section Geodesic Transformations
Then each erosion step is reconstructed into the previous erosion step (Yi image below).
The difference between the eroded image Xi and the reconstructed image Yi is the centroid of objects that disappeared at the erosion step number i.
This algorithm enables counting the number of convex particles, even if some of them are touching each other, as long as the pseudo-centre of each particle is outside of other particles.

Figure 1. Ultimate erosion on a basic example
See also
Function Syntax
This function returns outputBinaryImage.
// Function prototype
std::shared_ptr< iolink::ImageView > ultimateErosion( std::shared_ptr< iolink::ImageView > inputBinaryImage, UltimateErosion::Neighborhood neighborhood, std::shared_ptr< iolink::ImageView > outputBinaryImage = NULL );
Class Syntax
Parameters
Class Name | UltimateErosion |
---|
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
inputBinaryImage |
The binary input image. | Image | Binary | nullptr | ||||||
![]() |
neighborhood |
The 3D neighborhood configuration. This parameter is ignored with a 2D input image.
|
Enumeration | CONNECTIVITY_26 | |||||||
![]() |
outputBinaryImage |
The binary output image. Its dimensions and type are forced to the same values as the input. | Image | nullptr |
Object Examples
auto foam_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep.vip" ); UltimateErosion ultimateErosionAlgo; ultimateErosionAlgo.setInputBinaryImage( foam_sep ); ultimateErosionAlgo.setNeighborhood( UltimateErosion::Neighborhood::CONNECTIVITY_26 ); ultimateErosionAlgo.execute(); std::cout << "outputBinaryImage:" << ultimateErosionAlgo.outputBinaryImage()->toString();
Function Examples
auto foam_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep.vip" ); auto result = ultimateErosion( foam_sep, UltimateErosion::Neighborhood::CONNECTIVITY_26 ); std::cout << "outputBinaryImage:" << result->toString();