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)=b^2(\alpha|x|+1)e^{-\alpha|x|}\cdot(\alpha|y|+1)e^{-\alpha|y|}~~where~~b=\frac{\alpha}{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 );
This function returns outputImage.
// Function prototype.
recursive_laplacian_2d( input_image, spread_value = 60, output_image = None )
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
RecursiveLaplacian2d( IOLink.ImageView inputImage,
                      Int32 spreadValue = 60,
                      IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Class Name RecursiveLaplacian2d

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=\frac{(5.3-\alpha)}{5}\times 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();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

recursive_laplacian_2d_algo = imagedev.RecursiveLaplacian2d()
recursive_laplacian_2d_algo.input_image = polystyrene
recursive_laplacian_2d_algo.spread_value = 60
recursive_laplacian_2d_algo.execute()

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

RecursiveLaplacian2d recursiveLaplacian2dAlgo = new RecursiveLaplacian2d
{
    inputImage = polystyrene,
    spreadValue = 60
};
recursiveLaplacian2dAlgo.Execute();

Console.WriteLine( "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();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

result = imagedev.recursive_laplacian_2d( polystyrene, 60 )

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

IOLink.ImageView result = Processing.RecursiveLaplacian2d( polystyrene, 60 );

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