# Anisotropic Diffusion Outputs

I am providing 2 d grey scale images to the anisotropic diffusion function in MATLAB but not getting desired outputs. How many iterations are ideal and how should i approach this problem?I am keeping kappa values between 20 to 100. I am carrying out the operations on the standard lena image by adding salt and pepper noise.

Input Image:

Expected Output:

The output of 80 iterations of anisotropic diffusion with k=10

• i have also tried on other images. I have this link homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/GOMEZ1/… – Aviral Kumar Jan 1 '12 at 17:44
• if it helps i am referring to this code mathworks.de/matlabcentral/fileexchange/… – Aviral Kumar Jan 2 '12 at 2:32
• @yoda..(1)in anisotropic diffusion noise is removed from the images without causing any damage to the edges..they are not blurred. Ideal output should be an image with no noise , but am not getting any meaningful diffusion and most of the time get white image only. – Aviral Kumar Jan 2 '12 at 9:53
• (2) i have not added the images because i provided the link for it am referring to , my output is a plain white image. – Aviral Kumar Jan 2 '12 at 9:54

As best I can understand, you are interested in achieving edge-preserving denoising of the same "quality" given by the algorithm in the paper:

Giovani Gómez: Local Smoothness in terms of Variance: the Adaptive Gaussian Filter. Proceedings of the British Machine Vision Confernce, 2000.

The images from that paper that you used above (and in the duplicate of this question that you posted a month later) are available in Section 4 of the link you provided, which seems to be a later version of the paper.

There are two things you should try.

First, as @Jean-Yves suggested to you several times, median filtering is a non-linear filter that preserves edges (although it tends to round off sharp corners). Whether it does so effectively depends on the amount of noise in the image, and your example images are very noisy.

Second, the currently popular edge-preserving denoising algorithm is the bilateral filter. This is implemented in photoshop, and in GEGL (which is available through the Gnu Image Manipulation Program in the Tools->GEGL Operation menu).

Here's the pinecone with a radius 1 median filter:

With GEGL's bilateral filter (gaussian radius of 4, and "edge preservation" set at 8%):

With GEGL's bilateral filter (gaussian radius of 4, and "edge preservation" set at 4%):

And with median filter of radius 1 followed by GEGL's bilateral filter with gaussian radius of 4 and "edge preservation" set at 50%:

All of which I prefer to the result of Gómez's adaptive filter:

So, my answer to this question (and to How to remove Gaussian noise without destroying the edges?, which you posted on Feb 7, 2012) is: try median filtering and bilateral filtering.

• @Drazick: I don't think it's appropriate to use comments to try to attract support for area 51 proposals. Especially area 51 proposals that are just a distraction from making this site (dsp.se) more attractive to a wider audience. – Wandering Logic Feb 20 '15 at 23:00