ImageDev

MorphologicalLaplacian

Approximates an image Laplacian by using morphological operations.

Access to parameter description

For an introduction: This algorithm is a simple way to compute the Laplacian of an image using morphological operations.

<b> (a) </b>
(a)
<b> (b) </b>
(b)
Figure 1. The MorphologicalLaplacian algorithm:
(a) gray level input image, (b) morphological Laplacian result

This algorithm uses ErosionDisk2d and DilationDisk2d in 2D case and ErosionBallProcessing3d and DilationBall3d in 3D case.

Two additional parameters are also provided:
See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > morphologicalLaplacian( std::shared_ptr< iolink::ImageView > inputImage, MorphologicalLaplacian::Precision precision, int32_t kernelRadius, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns outputImage.
// Function prototype.
morphological_laplacian( input_image,
                         precision = MorphologicalLaplacian.Precision.FASTER,
                         kernel_radius = 3,
                         output_image = None )
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
MorphologicalLaplacian( IOLink.ImageView inputImage,
                        MorphologicalLaplacian.Precision precision = ImageDev.MorphologicalLaplacian.Precision.FASTER,
                        Int32 kernelRadius = 3,
                        IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
precision
The precision for computation for 3D morphological operations.
FASTER The mophological operations are computed using the fast mode.
PRECISE The mophological operations are computed using the precise mode.
Enumeration FASTER
input
kernelRadius
The half size of the structuring element.
A structuring element always has an odd side length (3x3, 5x5, etc) which is defined by 2 elementSize + 1.
Int32 >=1 3
output
outputImage
The output image. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. image Binary, Label, Grayscale or Multispectral None
input
precision
The precision for computation for 3D morphological operations.
FASTER The mophological operations are computed using the fast mode.
PRECISE The mophological operations are computed using the precise mode.
enumeration FASTER
input
kernel_radius
The half size of the structuring element.
A structuring element always has an odd side length (3x3, 5x5, etc) which is defined by 2 elementSize + 1.
int32 >=1 3
output
output_image
The output image. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral null
input
precision
The precision for computation for 3D morphological operations.
FASTER The mophological operations are computed using the fast mode.
PRECISE The mophological operations are computed using the precise mode.
Enumeration FASTER
input
kernelRadius
The half size of the structuring element.
A structuring element always has an odd side length (3x3, 5x5, etc) which is defined by 2 elementSize + 1.
Int32 >=1 3
output
outputImage
The output image. Image null

Object Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

MorphologicalLaplacian morphologicalLaplacianAlgo;
morphologicalLaplacianAlgo.setInputImage( foam );
morphologicalLaplacianAlgo.setPrecision( MorphologicalLaplacian::Precision::FASTER );
morphologicalLaplacianAlgo.setKernelRadius( 3 );
morphologicalLaplacianAlgo.execute();

std::cout << "outputImage:" << morphologicalLaplacianAlgo.outputImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

morphological_laplacian_algo = imagedev.MorphologicalLaplacian()
morphological_laplacian_algo.input_image = foam
morphological_laplacian_algo.precision = imagedev.MorphologicalLaplacian.FASTER
morphological_laplacian_algo.kernel_radius = 3
morphological_laplacian_algo.execute()

print( "output_image:", str( morphological_laplacian_algo.output_image ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

MorphologicalLaplacian morphologicalLaplacianAlgo = new MorphologicalLaplacian
{
    inputImage = foam,
    precision = MorphologicalLaplacian.Precision.FASTER,
    kernelRadius = 3
};
morphologicalLaplacianAlgo.Execute();

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

Function Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

auto result = morphologicalLaplacian( foam, MorphologicalLaplacian::Precision::FASTER, 3 );

std::cout << "outputImage:" << result->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

result = imagedev.morphological_laplacian( foam, imagedev.MorphologicalLaplacian.FASTER, 3 )

print( "output_image:", str( result ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

IOLink.ImageView result = Processing.MorphologicalLaplacian( foam, MorphologicalLaplacian.Precision.FASTER, 3 );

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