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?
Asked
Active
Viewed 626 times
-1
-
“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 Answers
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:
convert img.png -kuwahara 5 k5.png
convert img.png -kuwahara 9 k9.png
convert img.png -kuwahara 15 k15.png
convert img.png -kuwahara 25 k25.png

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
Here's the median of the surrounding 25x25 pixels:
convert noise.png -statistic median 25x25 result.png

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