This filter produces a convolution between an image I and another image k. This image k is converted
into a 1D-array and convolution by this general kernel is performed. This algorithm only supports kernel
images with odd X and Y dimensions.
If image k has a size (2p+1)×(2q+1), it is in fact a 2D-array with (2p+1) columns and (2q+1)
lines. It is converted in a 1D-array of (2p+1)×(2q+1) elements by placing side by side the (2q+1)
lines of the k array.
O(n,m)=1Kp∑i=−pq∑j=−qk(i,j)×I(n−i,m−j)
Where K is the normalization or automatic scaling coefficient. If normalization is disabled K=1, else
it is given by:
K=p∑i=−pq∑j=−q|k(i,j)| Note: Since the original data range may not be preserved by this filter, the output image type is
upgraded according to the Image type basic rule.
// Function prototype.publicstaticIOLink.ImageViewConvolutionWithImage2d(IOLink.ImageView inputImage,IOLink.ImageView inputKernelImage,ConvolutionWithImage2d.AutoScale autoScale =ImageDev.ConvolutionWithImage2d.AutoScale.YES,IOLink.ImageView outputImage =null);
Class Syntax
// Command constructor.ConvolutionWithImage2d();/// Gets the inputImage parameter./// The input image.
std::shared_ptr< iolink::ImageView> inputImage()const;/// Sets the inputImage parameter./// The input image.void setInputImage( std::shared_ptr< iolink::ImageView> inputImage );/// Gets the inputKernelImage parameter./// The convolution kernel image. It must have odd X and Y dimensions.
std::shared_ptr< iolink::ImageView> inputKernelImage()const;/// Sets the inputKernelImage parameter./// The convolution kernel image. It must have odd X and Y dimensions.void setInputKernelImage( std::shared_ptr< iolink::ImageView> inputKernelImage );/// Gets the autoScale parameter./// The automatic intensity scaling mode.ConvolutionWithImage2d::AutoScale autoScale()const;/// Sets the autoScale parameter./// The automatic intensity scaling mode.void setAutoScale(constConvolutionWithImage2d::AutoScale& autoScale );/// Gets the outputImage parameter./// The output image. Its dimensions are forced to the same values as the input. Its data type is promoted.
std::shared_ptr< iolink::ImageView> outputImage()const;/// Sets the outputImage parameter./// The output image. Its dimensions are forced to the same values as the input. Its data type is promoted.void setOutputImage( std::shared_ptr< iolink::ImageView> outputImage );// Method to launch the command.void execute();
# Property of the inputImage parameter.ConvolutionWithImage2d.input_image
# Property of the inputKernelImage parameter.ConvolutionWithImage2d.input_kernel_image
# Property of the autoScale parameter.ConvolutionWithImage2d.auto_scale
# Property of the outputImage parameter.ConvolutionWithImage2d.output_image
// Method to launch the command.
execute()
// Command constructor.ConvolutionWithImage2d()// Property of the inputImage parameter.ConvolutionWithImage2d.inputImage
// Property of the inputKernelImage parameter.ConvolutionWithImage2d.inputKernelImage
// Property of the autoScale parameter.ConvolutionWithImage2d.autoScale
// Property of the outputImage parameter.ConvolutionWithImage2d.outputImage
// Method to launch the command.Execute()
Parameters
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input image.
Image
Binary, Label, Grayscale or Multispectral
nullptr
inputKernelImage
The convolution kernel image. It must have odd X and Y dimensions.
Image
Binary, Label, Grayscale or Multispectral
nullptr
autoScale
The automatic intensity scaling mode.
NO
The result is not normalized.
YES
The result is automatically normalized by the sum of the kernel elements.
Enumeration
YES
outputImage
The output image. Its dimensions are forced to the same values as the input. Its data type is promoted.
Image
nullptr
Parameter Name
Description
Type
Supported Values
Default Value
input_image
The input image.
image
Binary, Label, Grayscale or Multispectral
None
input_kernel_image
The convolution kernel image. It must have odd X and Y dimensions.
image
Binary, Label, Grayscale or Multispectral
None
auto_scale
The automatic intensity scaling mode.
NO
The result is not normalized.
YES
The result is automatically normalized by the sum of the kernel elements.
enumeration
YES
output_image
The output image. Its dimensions are forced to the same values as the input. Its data type is promoted.
image
None
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input image.
Image
Binary, Label, Grayscale or Multispectral
null
inputKernelImage
The convolution kernel image. It must have odd X and Y dimensions.
Image
Binary, Label, Grayscale or Multispectral
null
autoScale
The automatic intensity scaling mode.
NO
The result is not normalized.
YES
The result is automatically normalized by the sum of the kernel elements.
Enumeration
YES
outputImage
The output image. Its dimensions are forced to the same values as the input. Its data type is promoted.