ImageDev

DilationLine2d

Performs a two-dimensional dilation using a structuring element matching with a line.

Access to parameter description

For an introduction: A linear dilation enlarges and may join objects along the dilation path.
The dilation is performed by using a linear structuring element. The direction of 0 degrees is horizontal and to the left, and the angles are calculated counter-clockwise.

<b> Figure 1.</b> Linear structuring element and dilated image
Figure 1. Linear structuring element and dilated image

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > dilationLine2d( std::shared_ptr< iolink::ImageView > inputImage, double orientationAngle, uint32_t kernelRadius, std::shared_ptr< iolink::ImageView > outputImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. The image type can be integer or float. Image Binary, Label, Grayscale or Multispectral nullptr
input
orientationAngle
The angle of orientation in degrees. Float64 Any value 10
input
kernelRadius
The length of the linear structuring element in pixels. UInt32 >=1 3
output
outputImage
The output image. Its dimensions and type are forced to the same values as the input image. Image nullptr

Object Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

DilationLine2d dilationLine2dAlgo;
dilationLine2dAlgo.setInputImage( polystyrene );
dilationLine2dAlgo.setOrientationAngle( 10 );
dilationLine2dAlgo.setKernelRadius( 3 );
dilationLine2dAlgo.execute();

std::cout << "outputImage:" << dilationLine2dAlgo.outputImage()->toString();

Function Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

auto result = dilationLine2d( polystyrene, 10, 3 );

std::cout << "outputImage:" << result->toString();