ExpandLabelBoundaries
Performs a constrained dilation around objects of a label image.
Access to parameter description
For an introduction:
Its first aim is to expand labels obtained by a segmentation algorithm producing objects separated by a background line like MarkerBasedWatershed. It fills all black pixels around object boundaries with the value of the most present label among its height neighbors.
Figure 1. Label boundaries expansion applied to the result of MarkerBasedWatershed
algorithm: (a) input label image, (b) image after label expansion
See also
Access to parameter description
For an introduction:
- section Mathematical Morphology
- section Introduction To Dilation
Its first aim is to expand labels obtained by a segmentation algorithm producing objects separated by a background line like MarkerBasedWatershed. It fills all black pixels around object boundaries with the value of the most present label among its height neighbors.
(a) |
(b) |
See also
Function Syntax
This function returns outputLabelImage.
// Function prototype
std::shared_ptr< iolink::ImageView > expandLabelBoundaries( std::shared_ptr< iolink::ImageView > inputLabelImage, ExpandLabelBoundaries::Neighborhood neighborhood, std::shared_ptr< iolink::ImageView > outputLabelImage = NULL );
This function returns outputLabelImage.
// Function prototype. expand_label_boundaries( input_label_image, neighborhood = ExpandLabelBoundaries.Neighborhood.CONNECTIVITY_26, output_label_image = None )
This function returns outputLabelImage.
// Function prototype. public static IOLink.ImageView ExpandLabelBoundaries( IOLink.ImageView inputLabelImage, ExpandLabelBoundaries.Neighborhood neighborhood = ImageDev.ExpandLabelBoundaries.Neighborhood.CONNECTIVITY_26, IOLink.ImageView outputLabelImage = null );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
inputLabelImage |
The input label image. | Image | Label | nullptr | |||||||
neighborhood |
The 3D neighborhood configuration. This parameter is ignored with a 2D input image.
|
Enumeration | CONNECTIVITY_26 | ||||||||
outputLabelImage |
The output label image. Its dimensions are forced to the same values as the input image. | Image | nullptr |
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
input_label_image |
The input label image. | image | Label | None | |||||||
neighborhood |
The 3D neighborhood configuration. This parameter is ignored with a 2D input image.
|
enumeration | CONNECTIVITY_26 | ||||||||
output_label_image |
The output label image. Its dimensions are forced to the same values as the input image. | image | None |
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
inputLabelImage |
The input label image. | Image | Label | null | |||||||
neighborhood |
The 3D neighborhood configuration. This parameter is ignored with a 2D input image.
|
Enumeration | CONNECTIVITY_26 | ||||||||
outputLabelImage |
The output label image. Its dimensions are forced to the same values as the input image. | Image | null |
Object Examples
auto foam_sep_label = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep_label.vip" ); ExpandLabelBoundaries expandLabelBoundariesAlgo; expandLabelBoundariesAlgo.setInputLabelImage( foam_sep_label ); expandLabelBoundariesAlgo.setNeighborhood( ExpandLabelBoundaries::Neighborhood::CONNECTIVITY_26 ); expandLabelBoundariesAlgo.execute(); std::cout << "outputLabelImage:" << expandLabelBoundariesAlgo.outputLabelImage()->toString();
foam_sep_label = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep_label.vip")) expand_label_boundaries_algo = imagedev.ExpandLabelBoundaries() expand_label_boundaries_algo.input_label_image = foam_sep_label expand_label_boundaries_algo.neighborhood = imagedev.ExpandLabelBoundaries.CONNECTIVITY_26 expand_label_boundaries_algo.execute() print( "output_label_image:", str( expand_label_boundaries_algo.output_label_image ) )
ImageView foam_sep_label = Data.ReadVipImage( @"Data/images/foam_sep_label.vip" ); ExpandLabelBoundaries expandLabelBoundariesAlgo = new ExpandLabelBoundaries { inputLabelImage = foam_sep_label, neighborhood = ExpandLabelBoundaries.Neighborhood.CONNECTIVITY_26 }; expandLabelBoundariesAlgo.Execute(); Console.WriteLine( "outputLabelImage:" + expandLabelBoundariesAlgo.outputLabelImage.ToString() );
Function Examples
auto foam_sep_label = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep_label.vip" ); auto result = expandLabelBoundaries( foam_sep_label, ExpandLabelBoundaries::Neighborhood::CONNECTIVITY_26 ); std::cout << "outputLabelImage:" << result->toString();
foam_sep_label = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep_label.vip")) result = imagedev.expand_label_boundaries( foam_sep_label, imagedev.ExpandLabelBoundaries.CONNECTIVITY_26 ) print( "output_label_image:", str( result ) )
ImageView foam_sep_label = Data.ReadVipImage( @"Data/images/foam_sep_label.vip" ); IOLink.ImageView result = Processing.ExpandLabelBoundaries( foam_sep_label, ExpandLabelBoundaries.Neighborhood.CONNECTIVITY_26 ); Console.WriteLine( "outputLabelImage:" + result.ToString() );