How do you estimate the noise-to-signal parameter for the wiener deconvolution filter?

21 次查看(过去 30 天)
I have images that were given to me that are blurry. I want to deblur these images using deconvwnr and/or other methods, but the inputs are not explained in a way I am finding useful. The point-spread-function I have a method of computing that is not perfect, but it at least give a reasonable starting point. The noise-to-signal parameter is completely a black-box. I cannot even tell the magnitude of the inputs required. Running parametric sweeps across a very wide range of NSR input values, I am able to convince myself that the deconvolution can improve the image quality. What I need is an algorithmic approach that approximates the NSR value in an image. I also need to know if there is a metric for blurriness that can identify when images are improving, though that may be a much harder task.

回答(1 个)

Sudarsanan A K
Sudarsanan A K 2023-10-30
编辑:Sudarsanan A K 2023-10-30
Hi David,
Different deblurring algorithms estimate and remove blur based on how much knowledge you have of the PSF and noise in the image. You can find the available functions in MATLAB with examples in the MathWorks documentation:
Estimating the Noise-to-Signal Ratio (NSR) in an image is a challenging task, as it requires distinguishing between the noise and the underlying signal. While there is no one-size-fits-all algorithm for NSR estimation, a commonly used approach is Local Variance Estimation which can be implemented as follows:
blurred_noisy = im2double(imread('blurred_noisy.jpg')); % blurred_noisy is your blurred and noisy image (attached a sample image with the answer)
patchSize = 8; % Size of the patches
numPatches = 1000; % Number of patches to sample
% Extract random patches from the blurred image
patches = im2col(blurred_noisy, [patchSize patchSize], 'sliding');
patches = patches(:, randperm(size(patches, 2), numPatches));
% Convert patches to double precision
patches = double(patches);
% Compute the local variance of the patches
variance = var(patches, [], 1);
% Approximate the NSR as the ratio of average noise variance to average signal variance
averageNoiseVariance = mean(variance);
averageSignalVariance = mean(patches(:).^2);
estimated_nsr = averageNoiseVariance / averageSignalVariance
estimated_nsr = 0.0075
You can try this out for replacing the NSR estimation step with the MathWorks example documentation:
The Peak Signal-to-Noise Ratio (PSNR)can be used as a metric to evaluate the improvement in image quality after deblurring. PSNR measures the ratio of the maximum possible pixel intensity to the noise level, indicating how well the deblurred image approximates the original image. You can find more about "psnr()" function in the MathWorks documentation:
I hope this helps!

产品


版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by