KuwaharaFilter computes for each pixel p in image the variance of the values in the four 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.
KuwaharaFilter works with binary, grayscale, and color images. For multi-channel images, KuwaharaFilter computes the sum of the variances in each channel.
At the edges of an image, KuwaharaFilter uses smaller neighborhoods.