MATLAB Answers


(Bug?) How to get an estimated_nsr (without having original Image) for Wiener deconvolution?

Asked by Gianfry
on 25 Jan 2013

I am using Wiener deconvolution to restore an image which is blurred and noisy. The problem is: I don't have the original image (of course...) and the Matlab documentation uses it to estimate the NSR.


    I = im2double(imread('cameraman.tif'));  % I DONT have this image!
    estimated_nsr = noise_var / var(I(:));
    wnr3 = deconvwnr(blurred_noisy, PSF, estimated_nsr);

But of course I don't have the original image I (Otherwise I wouldn't use deconwnr...) I think this is bug in the documentation of Matlab.

I have the noise_variance param but not the original image.

Knowing the noise_variance how can I get a good estimated_nsr ?



No products are associated with this question.

2 Answers

Answer by Image Analyst
on 25 Jan 2013

I is the original image - you read it in from cameraman.tif. So you do have the original image - I don't know why you consider that a bug in the documentation. deconvwnr() assumes the original (input) image is the "noisy" image. If you have the PSF and an estimate of the nsr parameter, then send it it. Otherwise, make a guess. Use trial and error.


on 26 Jan 2013

The bug is in the documentation because: If you are using deconvwnr() it means that you only have the blurred_noisy image and you need to recover the latent image.

So the documentation shouldn't write:

    estimated_nsr = noise_var / var(I(:));

Because most likely you can't have I(:) !

Image Analyst
on 26 Jan 2013

You don't have noise_var either - they just guessed at it, so it's kind of a trial and error process. I can see your point that perhaps they should have used

estimated_nsr = noise_var / var(blurred_noisy(:));

instead, because normally blurred_noisy is what you have. You can send them an email and let them know.

on 27 Jan 2013

Ok I will send en email

Answer by Youssef Khmou
on 27 Jan 2013
Edited by Youssef Khmou
on 27 Jan 2013


i am not sure if understand the issue here , but suppose we are testing to obtain the optimal value of the "nsr" :

Lets first talk about SNR : Signal-to-Noise Ratio


for image processing i think the code is slightly different :


function y=SNR(IMAGE)






An example :







so snr1=18.1124 and snr2=16.0656 means that at LOW SNR there is more noise.

so why dont you take the NSR=inv(SNR) and test it with deconvwnr function like :


function y=NSR(IMAGE)





  1 Comment

Youssef Khmou
on 27 Jan 2013

if that method does not give good results, we can try other approaches based on SNR .

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!