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:

enter image description here

Expected Output:

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

enter image description here

  • $\begingroup$ i have also tried on other images. I have this link homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/GOMEZ1/… $\endgroup$ Commented Jan 1, 2012 at 17:44
  • $\begingroup$ if it helps i am referring to this code mathworks.de/matlabcentral/fileexchange/… $\endgroup$ Commented Jan 2, 2012 at 2:32
  • 3
    $\begingroup$ You seem to be the same user as the one who asked the previous question on anisotropic diffusion. Please clarify your question re: 1) "not getting desired outputs" – please explain (or show) what your desired output is or give a criterion 2) "I am carrying out the operations on the standard lena image..." Please add the input and the output images to your question 3) "How many iterations are ideal and how should i approach this problem" You have not described your problem! 4) "I have this link..." What should we infer from that link? $\endgroup$ Commented Jan 2, 2012 at 7:15
  • 1
    $\begingroup$ @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. $\endgroup$ Commented Jan 2, 2012 at 9:53
  • 1
    $\begingroup$ (2) i have not added the images because i provided the link for it am referring to , my output is a plain white image. $\endgroup$ Commented Jan 2, 2012 at 9:54

1 Answer 1


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:

median filtered image

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

bilateral filtered image

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

bilateral filtered with less edge preservation

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

median and bilateral filtering

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

gomez adapative 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.

  • $\begingroup$ @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. $\endgroup$ Commented Feb 20, 2015 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.