Processing math: 100%
ImageDev

RecursiveLaplacian2d

Computes the Laplacian of a two-dimensional image with a recursive algorithm.

Access to parameter description

For an introduction: This algorithm is a recursive implementation for the determination of the Laplacian operator.

To minimize the effect of noise, the RecursiveLaplacian2d module smooths the image while computing the Laplacian by applying a second order derivative of the Deriche smoothing filter which has the two-dimensional form: f(x,y)=b2(α|x|+1)eα|x|(α|y|+1)eα|y|  where  b=α4
The smoothing scale parameter determines the smoothing intensity. If the value is large, the noise will be reduced but edges will be less sharp and only the most important edges will appear in the output image.
It is important to select the right coefficient to lower the noise just enough without defocusing the edges.

Reference
R.Deriche. "Using Canny's criteria to derive a recursively implemented optimal edge detector". International Journal of Computer Vision, vol.1, no 2, pp. 167-187, Jun. 1987.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > recursiveLaplacian2d( std::shared_ptr< iolink::ImageView > inputImage, int32_t spreadValue, 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
spreadValue
The smoothing factor defining the gradient sharpness. Its value must be between 0 and 100.
It is inversely proportional to Deriche alpha smoothing factor, in pixels. Low values provide sharp gradient. SmoothingFactor=(5.3α)5×100
Int32 [0, 100] 60
output
outputImage
The output image. Image nullptr

Object Examples

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

RecursiveLaplacian2d recursiveLaplacian2dAlgo;
recursiveLaplacian2dAlgo.setInputImage( polystyrene );
recursiveLaplacian2dAlgo.setSpreadValue( 60 );
recursiveLaplacian2dAlgo.execute();

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

Function Examples

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

auto result = recursiveLaplacian2d( polystyrene, 60 );

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