List of my modules...

Module: Kuwahara

Description:

Performs a modified version of the adaptive Kuwahara filter. The filter is a non-linear edge-preserving smoothing.

The original algorithm [1] takes a neighbourhood around a point, divides it in four quadrants, computes the standard deviation of the greylevels in each region, chooses the one with the minimum (i.e. the most homogeneous), and sets the new greylevel of the pixel as the mean greylevel in that quadrant.
The adaptative version [2] adapts the quadrant size to find the minimum standard deviation.
My contribution was to make it 3D (quadrants become octants), to use a Euclidean measure of the octant sizes instead of the maximum metric, and to define non-unit steps to adapt octant sizes, because why not!


Illustration of the effect of the filter. Left is the original image, center is the result with a step of 1 and maximum size of 5, the right is with a step of 2 and max size of 10.

Connections:

Image

[required]
Input image, of type HxUniformScalarField3.

Ports:

Radius


Maximum size of the octants (i.e. max distance of points in neighbourhood).

Step


Octant sizes are incremented step-by-step until max size or until standard deviation reached a local minimum. This sets the step increment.

Compute


Push the button to filter.

Commands:

Additional options can be accessed when typing in the console Kuwahara COMMAND_NAME.

verbose

Displays timing information after the computation. Retype to hide info.

create

Runs the computation. Returns the name of the output, so it can be used in a script, such as set RESULT [Kuwahara create].

References:

1 Kuwahara M., Hachimura K., Eiho S., Kinoshita M. (1976) Processing of RI-Angiocardiographic Images. In: Preston K., Onoe M. (eds) Digital Processing of Biomedical Images. Springer, Boston, MA.
2 K. Bartyzel, Adaptive Kuwahara filter, Signal, Image and Video Processing, vol. 10, no. 4, pp. 663-670, Apr. 2016.