Skip to content

demo not denoising successfully #11

@batson

Description

@batson

Hello,

Running on a Mac, clean install today (required upgrading libpng, libjpeg, libtiff by hand for some reason).

When I run the demo from the README, I get poor performance:

import numpy as np
import skimage.data
from skimage.measure import compare_psnr

import pybm3d


noise_std_dev = 40
img = skimage.data.astronaut()
noise = np.random.normal(scale=noise_std_dev,
                         size=img.shape).astype(img.dtype)

noisy_img = img + noise

out = pybm3d.bm3d.bm3d(noisy_img, noise_std_dev)

noise_psnr = compare_psnr(img, noisy_img)
out_psnr = compare_psnr(img, out)

print("PSNR of noisy image: ", noise_psnr)
print("PSNR of reconstructed image: ", out_psnr)
PSNR of noisy image:  8.790840053416506
PSNR of reconstructed image:  9.694752220332331

If I convert to greyscale first with skimage.color.rgb2grey, and set sigma = 0.2, the perf is even worse:

PSNR of noisy image:  13.975934859277583
PSNR of reconstructed image:  27.27140695331532

I'm not sure how to debug this, any advice appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions