4

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

Royi
  • 19,608
  • 4
  • 197
  • 238
Aviral Kumar
  • 341
  • 2
  • 7
  • i have also tried on other images. I have this link http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/GOMEZ1/results.html – Aviral Kumar Jan 01 '12 at 17:44
  • if it helps i am referring to this code http://www.mathworks.de/matlabcentral/fileexchange/14995-anisotropic-diffusion-perona-malik/content/anisodiff_Perona-Malik/anisodiff2D.m – Aviral Kumar Jan 02 '12 at 02:32
  • 3
    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? – Lorem Ipsum Jan 02 '12 at 07:15
  • 1
    @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 02 '12 at 09:53
  • 1
    (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 02 '12 at 09:54
  • (3) i have seen images with 100 or 200 iterations for removing the noise. How does this factor(number of iterations) effect the output in anisotropic diffusion? – Aviral Kumar Jan 02 '12 at 09:55
  • Now i hope you can give me some answer yoda. – Aviral Kumar Jan 02 '12 at 09:56
  • As suggested by yoda, you need to attach images to demonstrate what you have tried & what you mean by not getting desired output. – nav Jan 02 '12 at 13:21
  • Just a side note: a first step doing median filtering is extremely adequate when dealing with salt & pepper noise. You want to try that, then do anisotropic filtering. – Jean-Yves Jan 26 '12 at 07:39

1 Answers1

2

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.

Wandering Logic
  • 1,531
  • 11
  • 20
  • @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