Implementation of Kuwahara image filter