Processing math: 100%
ImageDev

BilateralFilter3d

Applies a three-dimensional edge-preserving smoothing filter.

Access to parameter description

For an introduction to image filters: see Images Filtering.

This algorithm is an edge-preserving smoothing filter. The intensity value at each voxel in an image is replaced by a weighted average of intensity values from nearby voxels. Crucially, the weights depend on the distance in color space from the considered voxel.
It preserves sharp edges by systematically excluding voxels across discontinuities from consideration: O(i,j,k)=1K(i,j,k)nx2l=nx2ny2m=ny2nz2n=nz2e(I(i,j,k)I(l,m,n))2h2I(l,m,n)
Where h is a weighting similarity factor and K is a local normalisation factor given by: K(i,j,k)=nx2l=nx2ny2m=ny2nz2n=nz2e(I(i,j,k)I(l,m,n))2h2
The greater h is, the stronger the blur.

A filter mode parameter that 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 voxel from 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.

See also
See related example

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > bilateralFilter3d( std::shared_ptr< iolink::ImageView > inputImage, int32_t kernelSizeX, int32_t kernelSizeY, int32_t kernelSizeZ, double similarity, BilateralFilter3d::FilterMode filterMode, std::shared_ptr< iolink::ImageView > outputImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
kernelSizeX
The horizontal kernel size in voxels (odd value). Int32 [3, 100] 3
input
kernelSizeY
The vertical kernel size in voxels (odd value). Int32 [3, 100] 3
input
kernelSizeZ
The depth kernel size in voxels (odd value). Int32 [3, 100] 3
input
similarity
The weighting similarity factor (must be a positive value). Float64 >0 20
input
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
output
outputImage
The output image. Its dimensions, type, and calibration are forced to the same values as the input. Image nullptr

Object Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

BilateralFilter3d bilateralFilter3dAlgo;
bilateralFilter3dAlgo.setInputImage( foam );
bilateralFilter3dAlgo.setKernelSizeX( 3 );
bilateralFilter3dAlgo.setKernelSizeY( 3 );
bilateralFilter3dAlgo.setKernelSizeZ( 3 );
bilateralFilter3dAlgo.setSimilarity( 20.0 );
bilateralFilter3dAlgo.setFilterMode( BilateralFilter3d::FilterMode::BILATERAL );
bilateralFilter3dAlgo.execute();

std::cout << "outputImage:" << bilateralFilter3dAlgo.outputImage()->toString();

Function Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

auto result = bilateralFilter3d( foam, 3, 3, 3, 20.0, BilateralFilter3d::FilterMode::BILATERAL );

std::cout << "outputImage:" << result->toString();