Processing math: 100%
ImageDev

GaussianGradientTensor2d

Computes a pointwise structure tensor on a two-dimensional image.

Access to parameter description

This algorithm computes the local structure tensor (Ix.IxIx.IyIx.IyIy.Iy)=(IxIy)(IxIy) by convolving the input image with the square first order derivatives of a Gaussian kernel.

Each element of the structure tensor represents a product of two partial derivatives
For instance, Ix.Ix=IxIx, Ix.Iy=IxIy.
The partial derivatives are computed as explained in the GaussianDerivative2d documentation.

This filter provides a spectral image output where each channel represents a tensor element; for instance, a product of two partial derivatives, set in the following order: Ix.Ix, Ix.Iy, Iy.Iy.
To extract the eigenvalues or vectors of the tensor image the EigenDecomposition2d can be applied on this output image.

See also

Function Syntax

This function returns outputTensorImage.
// Function prototype
std::shared_ptr< iolink::ImageView > gaussianGradientTensor2d( std::shared_ptr< iolink::ImageView > inputImage, iolink::Vector2d standardDeviation, std::shared_ptr< iolink::ImageView > outputTensorImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. The image type can be integer or float. Image Binary, Label or Grayscale 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}
output
outputTensorImage
The output image. Its spatial dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to float. Image nullptr

Object Examples

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

GaussianGradientTensor2d gaussianGradientTensor2dAlgo;
gaussianGradientTensor2dAlgo.setInputImage( polystyrene );
gaussianGradientTensor2dAlgo.setStandardDeviation( {1, 1} );
gaussianGradientTensor2dAlgo.execute();

std::cout << "outputTensorImage:" << gaussianGradientTensor2dAlgo.outputTensorImage()->toString();

Function Examples

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

auto result = gaussianGradientTensor2d( polystyrene, {1, 1} );

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