# BM3D strange artifacts

Hello,

i tried the example bm3d_image_denoising.cpp with a grayscale picture in pgm format. The result is strange and has artifacts: there are lines visibile. I don't know what is wrong.

I started the program with the parameters ./bm3d_image_denoising -i=sample.pgm -sigma=55 -o=sample_out.pgm

I know the sigma is high but the problem is still visible for sigma 10 or 15 (but not so good). I sharpened the image and marked the lines with red arrow. Can someone help?

You should add also the original image.

If you have Matlab, you can also test with the original implementation.

Here is the original image:

I don't own matlab. But I know the implementation of Marc Lebrun in https://github.com/gfacciol/bm3d

This implementation produces

I don't undestand using opencv-4.1.2 results is :

You have this problem too. If you sharpen your image, you can see it clearly:

C:\fakepath\sharpened.jpg

If you sharpen image, how do you sharpen this image?

If I sharpen an image, it depends on what i want to see. But in this case, i only sharpened the image, such that everybody can see the artifacts. I applied with gimp an inverse diffusion filter with gmic. But it works with an unsharp mask too. Or with a filter of your choice. For example with a deblur filter

C:\fakepath\deblur.jpg

One can see this also without sharpening on good monitors.

Maybe an issue in the OpenCV implementation.

If you are lucky, the IPOL and the OpenCV implementations follow strictly the original Matlab code. To debug, input a dummy matrix and compare the outputs at different steps of the two implementations to find the discrepancy.