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 );

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

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();

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();