ImageDev

Delineate2d

Enhances contrast of a two-dimensional image.

Access to parameter description

For an introduction to image filters: see section Images Filtering.

This algorithm provides contrast enhancement of an image using basic morphological transformations.
The delineate filter is based on the fact that a function $f$ is always between the erosion and the dilation of $f$. $$ E(I(n,m)) \leq I(n,m) \leq D(I(n,m)) $$ For each pixel, the output gray level value is assigned to the closest value between the erosion and the dilation of $I(n,m)$: $$ O(n,m)=\left\{\begin{array}{ll} D(I(n,m)) & \mbox {if $\left[D(I(n,m))-I(n,m)\right] < \left[E(I(n,m))-I(n,m)\right]$} \\ E(I(n,m)) & \mbox{otherwise} \end{array}\right. $$ See also

Function Syntax

This function returns the outputImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
delineate2d( std::shared_ptr< iolink::ImageView > inputImage,
             int32_t kernelRadius,
             std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns the outputImage output parameter.
// Function prototype.
delineate_2d( input_image, kernel_radius = 3, output_image = None )
This function returns the outputImage output parameter.
// Function prototype.
public static IOLink.ImageView
Delineate2d( IOLink.ImageView inputImage,
             Int32 kernelRadius = 3,
             IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Class Name Delineate2d

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
kernelRadius
The half size of the square structuring element. A structuring element always has an odd side length (3x3, 5x5, etc.) which is defined by twice the kernel radius + 1. Int32 >=1 3
output
outputImage
The output image. Its dimensions and type are forced to the same values as the input. Image nullptr

Object Examples

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

Delineate2d delineate2dAlgo;
delineate2dAlgo.setInputImage( polystyrene );
delineate2dAlgo.setKernelRadius( 3 );
delineate2dAlgo.execute();

std::cout << "outputImage:" << delineate2dAlgo.outputImage()->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

delineate_2d_algo = imagedev.Delineate2d()
delineate_2d_algo.input_image = polystyrene
delineate_2d_algo.kernel_radius = 3
delineate_2d_algo.execute()

print( "output_image:", str( delineate_2d_algo.output_image ) );
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

Delineate2d delineate2dAlgo = new Delineate2d
{
    inputImage = polystyrene,
    kernelRadius = 3
};
delineate2dAlgo.Execute();

Console.WriteLine( "outputImage:" + delineate2dAlgo.outputImage.ToString() );

Function Examples

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

auto result = delineate2d( polystyrene, 3 );

std::cout << "outputImage:" << result->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

result = imagedev.delineate_2d( polystyrene, 3 )

print( "output_image:", str( result ) );
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

IOLink.ImageView result = Processing.Delineate2d( polystyrene, 3 );

Console.WriteLine( "outputImage:" + result.ToString() );