This algorithm is an edge-preserving smoothing filter. The intensity value at each pixel in an image is
replaced by a weighted average of intensity values from nearby pixels. Crucially, the weights depend on the
distance in color space from the considered pixel.
It preserves sharp edges by systematically excluding pixels across discontinuities from consideration:
O(i,j)=1K(i,j)nx2∑l=−nx2ny2∑m=−ny2e(I(i,j)−I(l,m))2h2I(l,m) Where h is a weighting similarity factor and K is a local normalisation factor given by:
K(i,j)=nx2∑l=−nx2ny2∑m=−ny2e(I(i,j)−I(l,m))2h2I(l,m) The greater h is, the stronger the blur.
A filter mode parameter allows this algorithm to switch to the SUSAN filter (Smallest Univalue Segment
Assimilating Nucleus).
The SUSAN filter reproduces bilateral filter behavior simply by excluding the central pixel of computation.
This filter gives better results in the case of impulse noise.
Reference: C.Tomasi, R.Manduchi. "Bilateral Filtering for Gray and Color Images". Sixth International Conference on
Computer Vision (IEEE Cat. No.98CH36271), Bombay, India, pp. 839-846, 1998.
// Command constructor.BilateralFilter2d();/// 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 kernelSizeX parameter./// The horizontal kernel size in pixels (odd value).int32_t kernelSizeX()const;/// Sets the kernelSizeX parameter./// The horizontal kernel size in pixels (odd value).void setKernelSizeX(constint32_t& kernelSizeX );/// Gets the kernelSizeY parameter./// The vertical kernel size in pixels (odd value).int32_t kernelSizeY()const;/// Sets the kernelSizeY parameter./// The vertical kernel size in pixels (odd value).void setKernelSizeY(constint32_t& kernelSizeY );/// Gets the similarity parameter./// The weighting similarity factor (must be a positive value).double similarity()const;/// Sets the similarity parameter./// The weighting similarity factor (must be a positive value).void setSimilarity(constdouble& similarity );/// Gets the filterMode parameter./// The way to consider the central pixel.BilateralFilter2d::FilterMode filterMode()const;/// Sets the filterMode parameter./// The way to consider the central pixel.void setFilterMode(constBilateralFilter2d::FilterMode& filterMode );/// Gets the outputImage parameter./// The output image. Its dimensions, type, and calibration are forced to the same values as the input.
std::shared_ptr< iolink::ImageView> outputImage()const;/// Sets the outputImage parameter./// The output image. Its dimensions, type, and calibration are forced to the same values as the input.void setOutputImage( std::shared_ptr< iolink::ImageView> outputImage );// Method to launch the command.void execute();
# Property of the inputImage parameter.BilateralFilter2d.input_image
# Property of the kernelSizeX parameter.BilateralFilter2d.kernel_size_x
# Property of the kernelSizeY parameter.BilateralFilter2d.kernel_size_y
# Property of the similarity parameter.BilateralFilter2d.similarity
# Property of the filterMode parameter.BilateralFilter2d.filter_mode
# Property of the outputImage parameter.BilateralFilter2d.output_image
// Method to launch the command.
execute()
// Command constructor.BilateralFilter2d()// Property of the inputImage parameter.BilateralFilter2d.inputImage
// Property of the kernelSizeX parameter.BilateralFilter2d.kernelSizeX
// Property of the kernelSizeY parameter.BilateralFilter2d.kernelSizeY
// Property of the similarity parameter.BilateralFilter2d.similarity
// Property of the filterMode parameter.BilateralFilter2d.filterMode
// Property of the outputImage parameter.BilateralFilter2d.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
kernelSizeX
The horizontal kernel size in pixels (odd value).
Int32
[3, 100]
3
kernelSizeY
The vertical kernel size in pixels (odd value).
Int32
[3, 100]
3
similarity
The weighting similarity factor (must be a positive value).
Float64
>0
20
filterMode
The way to consider the central pixel.
BILATERAL
This mode corresponds to the standard bilateral filter (uses the central point).
SUSAN
This mode corresponds to the SUSAN filter (does not use the central point).
Enumeration
BILATERAL
outputImage
The output image. Its dimensions, type, and calibration are forced to the same values as the input.
Image
nullptr
Parameter Name
Description
Type
Supported Values
Default Value
input_image
The input image.
image
Binary, Label, Grayscale or Multispectral
None
kernel_size_x
The horizontal kernel size in pixels (odd value).
int32
[3, 100]
3
kernel_size_y
The vertical kernel size in pixels (odd value).
int32
[3, 100]
3
similarity
The weighting similarity factor (must be a positive value).
float64
>0
20
filter_mode
The way to consider the central pixel.
BILATERAL
This mode corresponds to the standard bilateral filter (uses the central point).
SUSAN
This mode corresponds to the SUSAN filter (does not use the central point).
enumeration
BILATERAL
output_image
The output image. Its dimensions, type, and calibration are forced to the same values as the input.
image
None
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input image.
Image
Binary, Label, Grayscale or Multispectral
null
kernelSizeX
The horizontal kernel size in pixels (odd value).
Int32
[3, 100]
3
kernelSizeY
The vertical kernel size in pixels (odd value).
Int32
[3, 100]
3
similarity
The weighting similarity factor (must be a positive value).
Float64
>0
20
filterMode
The way to consider the central pixel.
BILATERAL
This mode corresponds to the standard bilateral filter (uses the central point).
SUSAN
This mode corresponds to the SUSAN filter (does not use the central point).
Enumeration
BILATERAL
outputImage
The output image. Its dimensions, type, and calibration are forced to the same values as the input.