GradientVector3d
Provides different algorithms to perform an edge detection based on the first derivative of a three-dimensional image.
Access to parameter description
For an introduction:
The following algorithms are proposed to extract the edges of an image:
See also
Access to parameter description
For an introduction:
- section Edge Detection
- section Gradient
- section Images Filters
The following algorithms are proposed to extract the edges of an image:
- Gaussian: It performs a convolution with the derivatives of a Gaussian function along each image axis.
- Sobel: It performs a convolution with the normalized Sobel Kernel.
- Prewitt: It performs a convolution with the normalized Prewitt Kernel:
See also
Function Syntax
This function returns a GradientVector3dOutput structure containing outputImageX, outputImageY and outputImageZ.
// Output structure of the gradientVector3d function. struct GradientVector3dOutput { /// The gradient output image in X direction. std::shared_ptr< iolink::ImageView > outputImageX; /// The gradient output image in Y direction. std::shared_ptr< iolink::ImageView > outputImageY; /// The gradient output image in Z direction. std::shared_ptr< iolink::ImageView > outputImageZ; }; // Function prototype
GradientVector3dOutput gradientVector3d( std::shared_ptr< iolink::ImageView > inputImage, GradientVector3d::GradientOperator gradientOperator, iolink::Vector3d standardDeviation, GradientVector3d::FilterMode filterMode, GradientVector3d::OutputType outputType, std::shared_ptr< iolink::ImageView > outputImageX = NULL, std::shared_ptr< iolink::ImageView > outputImageY = NULL, std::shared_ptr< iolink::ImageView > outputImageZ = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
inputImage |
The input image. | Image | Binary, Label, Grayscale or Multispectral | nullptr | ||||||||
![]() |
gradientOperator |
The gradient operator to apply.
|
Enumeration | GAUSSIAN | |||||||||
![]() |
standardDeviation |
The standard deviation of the gaussian operator defines the gradient sharpness. Low values provide sharp gradient.
This parameter is ignored with the Sobel and Prewitt gradient operators. |
Vector3d | >=0.1 | {1.f, 1.f, 1.f} | ||||||||
![]() |
filterMode |
The gradient operator to apply.
|
Enumeration | RECURSIVE | |||||||||
![]() |
outputType |
The output image type to provide.
|
Enumeration | FLOAT_32_BIT | |||||||||
![]() |
outputImageX |
The gradient output image in X direction.
Dimensions, calibration, and interpretation of the output image are forced to the same values as the input. |
Image | nullptr | |||||||||
![]() |
outputImageY |
The gradient output image in Y direction.
Dimensions, calibration, and interpretation of the output image are forced to the same values as the input. |
Image | nullptr | |||||||||
![]() |
outputImageZ |
The gradient output image in Z direction.
Dimensions, calibration, and interpretation of the output image are forced to the same values as the input. |
Image | nullptr |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); GradientVector3d gradientVector3dAlgo; gradientVector3dAlgo.setInputImage( polystyrene ); gradientVector3dAlgo.setGradientOperator( GradientVector3d::GradientOperator::GAUSSIAN ); gradientVector3dAlgo.setStandardDeviation( {1, 1, 1} ); gradientVector3dAlgo.setFilterMode( GradientVector3d::FilterMode::RECURSIVE ); gradientVector3dAlgo.setOutputType( GradientVector3d::OutputType::FLOAT_32_BIT ); gradientVector3dAlgo.execute(); std::cout << "outputImageX:" << gradientVector3dAlgo.outputImageX()->toString(); std::cout << "outputImageY:" << gradientVector3dAlgo.outputImageY()->toString(); std::cout << "outputImageZ:" << gradientVector3dAlgo.outputImageZ()->toString();
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = gradientVector3d( polystyrene, GradientVector3d::GradientOperator::GAUSSIAN, {1, 1, 1}, GradientVector3d::FilterMode::RECURSIVE, GradientVector3d::OutputType::FLOAT_32_BIT ); std::cout << "outputImageX:" << result.outputImageX->toString(); std::cout << "outputImageY:" << result.outputImageY->toString(); std::cout << "outputImageZ:" << result.outputImageZ->toString();