KillBorder2d
Removes the objects connected to the borders of a segmented 2D image.
Access to parameter description
For an introduction:
Objects connected to the label image borders are identified using a numerical reconstruction from markers made of pixels of the image frame. Then we remove these objects from the input image with a logical subtraction.
To reorder labels use ReorderLabels algorithm

Figure 1. Illustration of the BorderKill algorithm
See also
See related examples
Access to parameter description
For an introduction:
- section Mathematical Morphology
- section Reconstruction From Markers
Objects connected to the label image borders are identified using a numerical reconstruction from markers made of pixels of the image frame. Then we remove these objects from the input image with a logical subtraction.
To reorder labels use ReorderLabels algorithm

Figure 1. Illustration of the BorderKill algorithm
See also
See related examples
Function Syntax
This function returns outputObjectImage.
// Function prototype
std::shared_ptr< iolink::ImageView > killBorder2d( std::shared_ptr< iolink::ImageView > inputObjectImage, KillBorder2d::Neighborhood neighborhood, std::shared_ptr< iolink::ImageView > outputObjectImage = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
![]() |
inputObjectImage |
The input binary or label image. | Image | Binary or Label | nullptr | ||||
![]() |
neighborhood |
The 2D neighborhood configuration.
|
Enumeration | CONNECTIVITY_8 | |||||
![]() |
outputObjectImage |
The output binary or label image. Its dimensions and type are forced to the same values as the input. | Image | nullptr |
Object Examples
auto polystyrene_lab_seq = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_lab_seq.vip" ); KillBorder2d killBorder2dAlgo; killBorder2dAlgo.setInputObjectImage( polystyrene_lab_seq ); killBorder2dAlgo.setNeighborhood( KillBorder2d::Neighborhood::CONNECTIVITY_8 ); killBorder2dAlgo.execute(); std::cout << "outputObjectImage:" << killBorder2dAlgo.outputObjectImage()->toString();
Function Examples
auto polystyrene_lab_seq = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_lab_seq.vip" ); auto result = killBorder2d( polystyrene_lab_seq, KillBorder2d::Neighborhood::CONNECTIVITY_8 ); std::cout << "outputObjectImage:" << result->toString();