In my applications related to image denoising (filtering), I often suffer from the presence of the artifacts in the homogeneous filtered regions. In order to overcome this shortcoming, I thought to separate my noisy image into flat (homogeneous) regions and heterogeneous ones, and then process (filter) them separately. So my question is as follows: What is the simplest way to do this separation? and what is the best task to do in order to preserve the smoothness of the flat regions?