This patch uses the average variance of individual color channel as the condition for choosing the appropriate quadrant. This will produce different visual results, but ones that are consistent with the intention of the Kuwahara filter. This is done to be compatible with the GPU implementation, which uses that method due to superior performance and memory saving.