computes for each element p in data the variance of the values in the four (r+1)×(r+1) squares that have p as a corner, and replaces p with the mean of the values of the square with least variance.


  • KuwaharaFilter is a non-linear local filter typically used for edge-preserving smoothing.
  • The data can be any of the following:
  • listarbitrary-rank numerical array
    tseriestemporal data such as TimeSeries, TemporalData,
    imagearbitrary Image or Image3D object
    audioan Audio object
  • For multi-channel data, KuwaharaFilter computes the sum of the variances in each channel.
  • At the edges of data, KuwaharaFilter uses smaller neighborhoods.
  • KuwaharaFilter[data,{r1,r2,}] uses squares (ri+1)×(ri+1) in dimension i of data.
  • KuwaharaFilter assumes the index coordinate system for lists and images.


open allclose all

Basic Examples  (2)

Kuwahara filtering of an image:

Kuwahara filtering of a signal:

Scope  (7)

Data  (5)

Filter a numerical list:

Filter a TimeSeries:

Filter an Audio signal:

Smoothing the image, while preserving the edges:

Kuwahara filter applied to a 3D image:

Parameters  (2)

Kuwahara filtering just in the vertical direction:

Horizontal direction:

Kuwahara filtering of a 3D image in the vertical direction only:

Filtering of the horizontal planes only:

Applications  (3)

Use Kuwahara filtering as a preprocessing step for image segmentation:

Remove salt-and-pepper noise:

Use a Kuwahara filter to remove smaller stars from an astronomical image:

Properties & Relations  (2)

Compare Kuwahara to mean filter:

Compare Kuwahara to other edge-preserving filters:

Neat Examples  (1)

Repeatedly apply KuwaharaFilter to an image:

Introduced in 2010
Updated in 2012