Running the BM3D Denoising Algorithm in Python I am looking for a strong baseline in image denoising and therefore wanted to have the BM3D algorithm in my benchmark.

These 2 python implementations:


https://github.com/ericmjonas/pybm3d
https://github.com/liuhuang31/BM3D-Denoise


have been unmaintained for a long time (and the second one is documented in what I think is chinese). I have experimented a bit with the first one without satisfactory results (see https://github.com/ericmjonas/pybm3d/issues/11 with non satisfactory fixes like clipping).

This package : https://pypi.org/project/bm3d/#description , doesn't have a documentation or source code easily findable.

Then I found this: https://docs.opencv.org/master/de/daa/group__xphoto.html#ga2fc5a9661c1338a823fb3290673a880d, in the docs of opencv but there is no indication as to how to use it and no examples in python. I saw this SO question but it's for a C++ implementation and I don't know how it would translate in Python because I am not familiar at all with opencv.
What I resorted to was using the PyPI package, which is advertised here: http://www.cs.tut.fi/~foi/GCF-BM3D/index.html#ref_software.

I dug a bit in the source code, and found that I could perform BM3D, in the following fashion:



import bm3d

denoised_image = bm3d.bm3d(image_noisy, sigma_psd=30/255, stage_arg=bm3d.BM3DStages.HARD_THRESHOLDING)


There are also some examples in the library's source code download.

I installed bm3d using pip (pip install bm3d) and needed OpenBlas (sudo apt-get install libopenblas-dev).