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?
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