ImageDev

DilationColor2d

Performs a dilation on a true-color image using a structuring element matching with a square.

Access to parameter description

For an introduction: This algorithm performs a dilation on a true-color image, composed of 3 channels: red, green and blue.
The maximum in the neighborhood is either computed on the luminance or the saturation of pixels, and the center is set to the pixel that gives the maximum luminance or saturation.
With this method, no new color is created.

See also

Function Syntax

This function returns the outputColorImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
dilationColor2d( std::shared_ptr< iolink::ImageView > inputColorImage,
                 int32_t kernelRadius,
                 DilationColor2d::CriterionPlane criterionPlane,
                 std::shared_ptr< iolink::ImageView > outputColorImage = NULL );
This function returns the outputColorImage output parameter.
// Function prototype.
dilation_color_2d( input_color_image,
                   kernel_radius = 3,
                   criterion_plane = DilationColor2d.CriterionPlane.LUMINANCE,
                   output_color_image = None )
This function returns the outputColorImage output parameter.
// Function prototype.
public static IOLink.ImageView
DilationColor2d( IOLink.ImageView inputColorImage,
                 Int32 kernelRadius = 3,
                 DilationColor2d.CriterionPlane criterionPlane = ImageDev.DilationColor2d.CriterionPlane.LUMINANCE,
                 IOLink.ImageView outputColorImage = null );

Class Syntax

Parameters

Class Name DilationColor2d

Parameter Name Description Type Supported Values Default Value
input
inputColorImage
The input color image. Image 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
input
criterionPlane
The plane on which the criterion is computed.
LUMINANCE The operation is applied on the luminance component of the color image.
SATURATION The operation is applied on the saturation component of the color image.
Enumeration LUMINANCE
output
outputColorImage
The output color image. Its dimensions and type are forced to the same values as the input image. Image nullptr

Object Examples

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

DilationColor2d dilationColor2dAlgo;
dilationColor2dAlgo.setInputColorImage( ateneub );
dilationColor2dAlgo.setKernelRadius( 3 );
dilationColor2dAlgo.setCriterionPlane( DilationColor2d::CriterionPlane::LUMINANCE );
dilationColor2dAlgo.execute();

std::cout << "outputColorImage:" << dilationColor2dAlgo.outputColorImage()->toString();
ateneub = ioformat.read_image(imagedev_data.get_image_path("ateneub.jpg"))

dilation_color_2d_algo = imagedev.DilationColor2d()
dilation_color_2d_algo.input_color_image = ateneub
dilation_color_2d_algo.kernel_radius = 3
dilation_color_2d_algo.criterion_plane = imagedev.DilationColor2d.LUMINANCE
dilation_color_2d_algo.execute()

print( "output_color_image:", str( dilation_color_2d_algo.output_color_image ) );
ImageView ateneub = ViewIO.ReadImage( @"Data/images/ateneub.jpg" );

DilationColor2d dilationColor2dAlgo = new DilationColor2d
{
    inputColorImage = ateneub,
    kernelRadius = 3,
    criterionPlane = DilationColor2d.CriterionPlane.LUMINANCE
};
dilationColor2dAlgo.Execute();

Console.WriteLine( "outputColorImage:" + dilationColor2dAlgo.outputColorImage.ToString() );

Function Examples

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

auto result = dilationColor2d( ateneub, 3, DilationColor2d::CriterionPlane::LUMINANCE );

std::cout << "outputColorImage:" << result->toString();
ateneub = ioformat.read_image(imagedev_data.get_image_path("ateneub.jpg"))

result = imagedev.dilation_color_2d( ateneub, 3, imagedev.DilationColor2d.LUMINANCE )

print( "output_color_image:", str( result ) );
ImageView ateneub = ViewIO.ReadImage( @"Data/images/ateneub.jpg" );

IOLink.ImageView result = Processing.DilationColor2d( ateneub, 3, DilationColor2d.CriterionPlane.LUMINANCE );

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