BM3D strange artifacts

asked 2019-09-19 10:21:27 -0600

cm7695 gravatar image

updated 2019-09-20 08:35:57 -0600

LBerger gravatar image

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?

C:\fakepath\sample_out_sharpen.jpg

edit retag flag offensive close merge delete

Comments

1

You should add also the original image.

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

Eduardo gravatar imageEduardo ( 2019-09-19 17:32:35 -0600 )edit
1

Here is the original image:

sample.jpg

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

This implementation produces

sample_lebrun.jpg

cm7695 gravatar imagecm7695 ( 2019-09-20 08:15:39 -0600 )edit

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

LBerger gravatar imageLBerger ( 2019-09-20 08:41:46 -0600 )edit

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

C:\fakepath\sharpened.jpg

cm7695 gravatar imagecm7695 ( 2019-09-20 09:46:30 -0600 )edit

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

LBerger gravatar imageLBerger ( 2019-09-20 10:48:32 -0600 )edit

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.

cm7695 gravatar imagecm7695 ( 2019-09-20 13:00:49 -0600 )edit

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.

Eduardo gravatar imageEduardo ( 2019-09-20 17:07:51 -0600 )edit