ImageDev

DobFilter3d

Appproximates a Laplacian as the difference of two box filters applied on the same three-dimensional image.

Access to parameter description

For an introduction:
DobFilter3d calculates the difference between two local averages computed over square neighborhoods of different kernel sizes (Difference Of Boxes) applied on the same image. The operation consists of the same filter performed with two different kernel sizes.
The size of the kernels must be an odd number.

This operation applied to a 1D step edge is shown in Figure 1.
<b> Figure 1.</b> DOB approximation
Figure 1. DOB approximation

DobFilter3d does not compute the Laplacian of an image, but is a good approximation and has the main advantage of not generating isolated points.

Typical ratios of the neighborhood sizes (width of Box1 / width of Box2) have a range between 1.5 and 2.5. Box1 and Box2 are respectively parametrized by the parameters largeBoxSize and smallBoxSize.
For example, kernels of size 5x5x5/3x3x3 or 9x9x9/5x5x5 can be used.

To keep a correct representation of the edges and a maximum of detail, using too large a kernel is not recommended (3, 5 and 7 are the most frequent values).

The deviation between the two masks has a direct effect on the edges. If the difference is too large, the edges are very thick and all small details disappear. If the difference is small (less than 4), the edges are very thin and details more precise.

See also

Function Syntax

This function returns the outputImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
dobFilter3d( std::shared_ptr< iolink::ImageView > inputImage,
             int32_t smallBoxSize,
             int32_t largeBoxSize,
             std::shared_ptr< iolink::ImageView > outputImage = NULL );

Class Syntax

Parameters

Class Name DobFilter3d

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
smallBoxSize
The size of the small box. Int32 >=1 3
input
largeBoxSize
The size of the large box. Int32 >=1 7
output
outputImage
The output image. Image nullptr

Object Examples

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

DobFilter3d dobFilter3dAlgo;
dobFilter3dAlgo.setInputImage( foam );
dobFilter3dAlgo.setSmallBoxSize( 3 );
dobFilter3dAlgo.setLargeBoxSize( 7 );
dobFilter3dAlgo.execute();

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

Function Examples

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

auto result = dobFilter3d( foam, 3, 7 );

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