Generalised Kuwahara filter
#include "dip_filtering.h"
dip_Error dip_GeneralisedKuwaharaImproved ( in, selection, out, se, boundary, filterSize, shape, threshold, minimum )
binary, integer, float
This function implements an improved version of GeneralisedKuwahara, see that function's description for more information. This function adds a threshold parameter that avoids false edges in uniform regions. If the difference between maximal and minimal values within the filter window is smaller or equal to threshold, the centre pixel is taken, instead of the minimum (or maximum). Setting threshold to zero yields the same result as GeneralisedKuwahara.
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).
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_float | threshold | Minimal value difference within window |
dip_Boolean | minimum | Select minimum or maximum? |
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 |
The filter shape DIP_FLT_SHAPE_PARABOLIC, as well as custom grey-value shapes, are not supported.
Kuwahara, GeneralisedKuwahara, KuwaharaImproved, VarianceFilter, Uniform