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

# Kuwahara

Edge perserving smoothing filter

## SYNOPSIS

`#include "dip_filtering.h"`

dip_Error dip_Kuwahara ( in, out, se, boundary, filterSize, shape )

## DATA TYPES

binary, integer, float

## FUNCTION

This function implements the kuwahara edge-preserving smoothing function. See section 9.4, "Smoothing operations", in "Fundamentals of Image Processing" for a description of the algorithm. However, this function does not implement the classical kuwahara filter, which only compares the variance of four regions in the filter window, but compares the variance of every region specified by the filter shape and size centered withing the filter window.

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 image
`dip_Image` | `out` | Output image
`dip_Image` | `se` | Structuring element
`dip_BoundaryArray` | `boundary` | Boundary conditions
`dip_FloatArray` | `filterSize` | Filter sizes
`dip_FilterShape` | `shape` | Filter shape

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

`GeneralisedKuwahara`, `VarianceFilter`

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