ImageDev

GaussianDerivative2d

Approximates the convolution of a two-dimensional image with a Gaussian kernel or its derivative.

Access to parameter description

This algorithm independently applies, on each axis, an approximation of: The Gaussian filter is based on the recursive filtering method proposed by R.Deriche which is defined for one dimension by: $$ f(x)=b(\alpha|x|+1)e^{-\alpha|x|}~~where~~b=\frac{\alpha}{4} $$ Note that this filter has an infinite impulse response and takes advantage of the separability of the Gaussian kernel.
Using this mode, the computation time is independent of the standard deviation.

Reference
R.Deriche. "Fast algorithms for low-level vision". IEEE Transactions on Pattern Analysis and Machine Intelligence, vol.12, no 1, pp. 78-87, Jan. 1990.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > gaussianDerivative2d( std::shared_ptr< iolink::ImageView > inputImage, iolink::Vector2i32 orderDerivative, iolink::Vector2d standardDeviation, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns outputImage.
// Function prototype.
gaussian_derivative_2d( input_image,
                        order_derivative = [0, 0],
                        standard_deviation = [1, 1],
                        output_image = None )
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
GaussianDerivative2d( IOLink.ImageView inputImage,
                      int[] orderDerivative = null,
                      double[] standardDeviation = null,
                      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
standardDeviation
The sigma value of the Gaussian filter for each direction X and Y. Each value must be greater than or equal to 0.1. Vector2d >=0.1 {1.f, 1.f}
input
orderDerivative
The derivation order for each direction X and Y. Each value must be 0, 1 or 2. Vector2i32 [0, 2] {0, 0}
output
outputImage
The output image. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to float. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. image Binary, Label, Grayscale or Multispectral None
input
standard_deviation
The sigma value of the Gaussian filter for each direction X and Y. Each value must be greater than or equal to 0.1. vector2d >=0.1 [1, 1]
input
order_derivative
The derivation order for each direction X and Y. Each value must be 0, 1 or 2. vector2i32 [0, 2] [0, 0]
output
output_image
The output image. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to float. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral null
input
standardDeviation
The sigma value of the Gaussian filter for each direction X and Y. Each value must be greater than or equal to 0.1. Vector2d >=0.1 {1f, 1f}
input
orderDerivative
The derivation order for each direction X and Y. Each value must be 0, 1 or 2. Vector2i32 [0, 2] {0, 0}
output
outputImage
The output image. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to float. Image null

Object Examples

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

GaussianDerivative2d gaussianDerivative2dAlgo;
gaussianDerivative2dAlgo.setInputImage( polystyrene );
gaussianDerivative2dAlgo.setOrderDerivative( {0, 0} );
gaussianDerivative2dAlgo.setStandardDeviation( {1.0, 1.0} );
gaussianDerivative2dAlgo.execute();

std::cout << "outputImage:" << gaussianDerivative2dAlgo.outputImage()->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

gaussian_derivative_2d_algo = imagedev.GaussianDerivative2d()
gaussian_derivative_2d_algo.input_image = polystyrene
gaussian_derivative_2d_algo.order_derivative = [0, 0]
gaussian_derivative_2d_algo.standard_deviation = [1.0, 1.0]
gaussian_derivative_2d_algo.execute()

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

GaussianDerivative2d gaussianDerivative2dAlgo = new GaussianDerivative2d
{
    inputImage = polystyrene,
    orderDerivative = new int[]{0, 0},
    standardDeviation = new double[]{1.0, 1.0}
};
gaussianDerivative2dAlgo.Execute();

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

Function Examples

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

auto result = gaussianDerivative2d( polystyrene, {0, 0}, {1.0, 1.0} );

std::cout << "outputImage:" << result->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

result = imagedev.gaussian_derivative_2d( polystyrene, [0, 0], [1.0, 1.0] )

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

IOLink.ImageView result = Processing.GaussianDerivative2d( polystyrene, new int[]{0, 0}, new double[]{1.0, 1.0} );

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