This function implements the Kuwahara filter, a 2D nonlinear filter that reduces noise in an image while at the same time preserving edge content. A code example follows:
RGB = imread('saturn.png');
I = rgb2gray(RGB);
J = imnoise(I,'gaussian',0,0.005);
Y = kuwahara(J,5,true);
Good but slow
BUG: Output image is misaligned
Y(i,j) = m(k);
Y(i-PADDING,j-PADDING) = m(k);
Good filter, but very slow.
Create scripts with code, output, and formatted text in a single executable document.