GradientMagnitude3d
Provides different algorithms to perform an edge detection based on the first derivative of a two-dimensional image.
Access to parameter description
For an introduction:
The following algorithms are proposed to extract the edges of an image:
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 outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > gradientMagnitude3d( std::shared_ptr< iolink::ImageView > inputImage, GradientMagnitude3d::GradientOperator gradientOperator, iolink::Vector3d standardDeviation, GradientMagnitude3d::FilterMode filterMode, GradientMagnitude3d::OutputType outputType, GradientMagnitude3d::GradientMode gradientMode, std::shared_ptr< iolink::ImageView > outputImage = 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 | SAME_AS_INPUT | |||||||
![]() |
gradientMode |
The output image to compute.
|
Enumeration | AMPLITUDE_EUCLIDEAN | |||||||
![]() |
outputImage |
The gradient amplitude output image.
Dimensions, calibration, and interpretation of the output image are forced to the same values as the input. |
Image | nullptr |
Object Examples
auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" ); GradientMagnitude3d gradientMagnitude3dAlgo; gradientMagnitude3dAlgo.setInputImage( foam ); gradientMagnitude3dAlgo.setGradientOperator( GradientMagnitude3d::GradientOperator::GAUSSIAN ); gradientMagnitude3dAlgo.setStandardDeviation( {1, 1, 1} ); gradientMagnitude3dAlgo.setFilterMode( GradientMagnitude3d::FilterMode::RECURSIVE ); gradientMagnitude3dAlgo.setOutputType( GradientMagnitude3d::OutputType::SAME_AS_INPUT ); gradientMagnitude3dAlgo.setGradientMode( GradientMagnitude3d::GradientMode::AMPLITUDE_EUCLIDEAN ); gradientMagnitude3dAlgo.execute(); std::cout << "outputImage:" << gradientMagnitude3dAlgo.outputImage()->toString();
Function Examples
auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" ); auto result = gradientMagnitude3d( foam, GradientMagnitude3d::GradientOperator::GAUSSIAN, {1, 1, 1}, GradientMagnitude3d::FilterMode::RECURSIVE, GradientMagnitude3d::OutputType::SAME_AS_INPUT, GradientMagnitude3d::GradientMode::AMPLITUDE_EUCLIDEAN ); std::cout << "outputImage:" << result->toString();