GroupCloseLabelsl2d
Assigns a same label to objects that are closed to each other.
Access to parameter description
Given a grouping distance, objects are assigned to a same label if their boundaries are separated by this distance or less.
Figure 1. Particle grouping: (a) binary image of particles,@Br
(b) label image with a different label for each particle, (c) grouped label image with a same label for each
cluster of particles
The figure above compares the results of the classical connected component and cluster based labeling algorithms on a binary image representing some particles.
See also
Access to parameter description
Given a grouping distance, objects are assigned to a same label if their boundaries are separated by this distance or less.
![]() (a) |
![]() (b) |
![]() (c) |
The figure above compares the results of the classical connected component and cluster based labeling algorithms on a binary image representing some particles.
- The Labeling2d algorithm gives a different label to each particle.
- The GroupCloseLabelsl2d algorithm associates the same label to each particle of a cluster, a cluster being defined by the distance between the separated particles.
See also
Function Syntax
This function returns outputLabelImage.
// Function prototype
std::shared_ptr< iolink::ImageView > groupCloseLabelsl2d( std::shared_ptr< iolink::ImageView > inputObjectImage, double maxDistance, std::shared_ptr< iolink::ImageView > outputLabelImage = nullptr );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
![]() |
inputObjectImage |
The input binary or label image. | Image | Binary or Label | nullptr |
![]() |
maxDistance |
The maximum distance beteween two objects for grouping them. | Float64 | >0 | 3 |
![]() |
outputLabelImage |
The output label image. Its dimensions are forced to the same values as the input. | Image | nullptr |
Object Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); GroupCloseLabelsl2d groupCloseLabelsl2dAlgo; groupCloseLabelsl2dAlgo.setInputObjectImage( polystyrene_sep ); groupCloseLabelsl2dAlgo.setMaxDistance( 3.0 ); groupCloseLabelsl2dAlgo.execute(); std::cout << "outputLabelImage:" << groupCloseLabelsl2dAlgo.outputLabelImage()->toString();
Function Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); auto result = groupCloseLabelsl2d( polystyrene_sep, 3.0 ); std::cout << "outputLabelImage:" << result->toString();