Loading [MathJax]/jax/output/CommonHTML/jax.js
ImageDev

RadialGradientCentered2d

Performs a two-dimensional gradient projection with a directional vector defined by a center point.

Access to parameter description

For an introduction: The RadialGradientCentered2d algorithm performs a gradient projection by computing the directional vector from a single given center. For all pixels P in the image, the projection is applied from the same user-defined center C.

Notices:
See also

Function Syntax

This function returns a RadialGradientCentered2dOutput structure containing outputNormalImage and outputTangentImage.
// Output structure of the radialGradientCentered2d function.
struct RadialGradientCentered2dOutput
{
    /// The normal gradient output image.
    std::shared_ptr< iolink::ImageView > outputNormalImage;
    /// The tangent gradient output image.
    std::shared_ptr< iolink::ImageView > outputTangentImage;
};

// Function prototype
RadialGradientCentered2dOutput radialGradientCentered2d( std::shared_ptr< iolink::ImageView > inputImageX, std::shared_ptr< iolink::ImageView > inputImageY, iolink::Vector2i32 projectionCenter, RadialGradientCentered2d::ProjectionMode projectionMode, std::shared_ptr< iolink::ImageView > outputNormalImage = NULL, std::shared_ptr< iolink::ImageView > outputTangentImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImageX
The X-gradient input image. Image Grayscale or Multispectral nullptr
input
inputImageY
The Y-gradient input image. Image Grayscale or Multispectral nullptr
input
projectionCenter
The center of projection coordinates. Vector2i32 >=0 {1, 1}
input
projectionMode
The output images to be computed.
GRADIENT_NORMAL The engine computes the normal gradient. Only the outputNormalImage output is set using this mode.
GRADIENT_NORMAL_TANGENTIAL The engine computes the normal and tangential gradients. Both outputNormalImage and outputTangentImage outputs are set using this mode.
Enumeration GRADIENT_NORMAL
output
outputNormalImage
The normal gradient output image. Image nullptr
output
outputTangentImage
The tangent gradient output image. Image nullptr

Object Examples

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

RadialGradientCentered2d radialGradientCentered2dAlgo;
radialGradientCentered2dAlgo.setInputImageX( polystyrene );
radialGradientCentered2dAlgo.setInputImageY( polystyrene );
radialGradientCentered2dAlgo.setProjectionCenter( {1, 1} );
radialGradientCentered2dAlgo.setProjectionMode( RadialGradientCentered2d::ProjectionMode::GRADIENT_NORMAL );
radialGradientCentered2dAlgo.execute();

std::cout << "outputNormalImage:" << radialGradientCentered2dAlgo.outputNormalImage()->toString();
std::cout << "outputTangentImage:" << radialGradientCentered2dAlgo.outputTangentImage()->toString();

Function Examples

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

auto result = radialGradientCentered2d( polystyrene, polystyrene, {1, 1}, RadialGradientCentered2d::ProjectionMode::GRADIENT_NORMAL );

std::cout << "outputNormalImage:" << result.outputNormalImage->toString();
std::cout << "outputTangentImage:" << result.outputTangentImage->toString();