-1

I'm trying to get rid of noise in the grayscale image. I tried the non-local-mean and Gaussian filter, but none of them give me good results. Is there any recommended algorithm I can use?

enter image description here

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
Alice
  • 33
  • 5
  • “I tried...” Please *show* what you did, don’t *tell* what you did. In particular, filtering requires a lot of parameter tuning to adjust it to the problem. The parameters you picked were likely inadequate for this problem. – Cris Luengo May 12 '19 at 16:08

2 Answers2

2

In Imagemagick, you can use the kuwahara non-linear edge preserving filter with different values (see https://en.wikipedia.org/wiki/Kuwahara_filter). Choose whichever looks best to you.

Input:

enter image description here

convert img.png -kuwahara 5 k5.png


enter image description here

convert img.png -kuwahara 9 k9.png


enter image description here

convert img.png -kuwahara 15 k15.png


enter image description here

convert img.png -kuwahara 25 k25.png


enter image description here

fmw42
  • 46,825
  • 10
  • 62
  • 80
1

Not sure what you are hoping for, but here each pixel is replaced by the mean of the surrounding 49x49 pixels just using ImageMagick in the Terminal:

convert noise.png -statistic mean 49x49 result.png

enter image description here

Here's the median of the surrounding 25x25 pixels:

convert noise.png -statistic median 25x25 result.png

enter image description here

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432