DIPlib Documentation - ©1995-2009 Quantitative Imaging Group, Delft University of Technology.

# GeneralisedKuwahara

Generalised Kuwahara filter

## SYNOPSIS

`#include "dip_filtering.h"`

dip_Error dip_GeneralisedKuwahara ( in, selection, out, se, boundary, filterSize, shape, minimum )

## DATA TYPES

binary, integer, float

## FUNCTION

This function is a generalisation of the `Kuwahara` filter in the sense that is does not use the variance criterion to select the smoothed value, but instead accepts an image with the selection values. The algorithm finds, for every pixel, the minimum or maximum (as specified with `minimum`) value of `selection` within the filter window (its size specified by `filterSize`).

If `shape` is not equal to `DIP_FLT_SHAPE_STRUCTURING_ELEMENT`, `se` is allowed to be set to zero. When `shape` is set to `DIP_FLT_SHAPE_STRUCTURING_ELEMENT`, `filterParam` is ignored, (and can be set to zero).

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `in` | Input
`dip_Image` | `selection` | Selection
`dip_Image` | `out` | Output
`dip_Image` | `se` | Structuring element
`dip_BoundaryArray` | `boundary` | Boundary conditions
`dip_FloatArray` | `filterSize` | Filter sizes
`dip_FilterShape` | `shape` | Filter shape
`dip_Boolean` | `minimum` | Minimum

The enumerator `dip_FilterShape` contains the following constants:

Name | Description
`DIP_FLT_SHAPE_DEFAULT` | default structuring element, same as `DIP_FLT_SHAPE_RECTANGULAR`
`DIP_FLT_SHAPE_RECTANGULAR` | rectangular structuring element
`DIP_FLT_SHAPE_ELLIPTIC` | elliptic structuring element
`DIP_FLT_SHAPE_DIAMOND` | diamond shaped structuring element
`DIP_FLT_SHAPE_PARABOLIC` | parabolic structuring element
`DIP_FLT_SHAPE_STRUCTURING_ELEMENT` | use `se` as structuring element

## NOTE

The filter shape `DIP_FLT_SHAPE_PARABOLIC`, as well as custom grey-value shapes, are not supported.

## SEE ALSO

`Kuwahara`, `VarianceFilter`

DIPlib on-line documentation | Function reference | Global function index