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

8 views (last 30 days)
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.
Example:
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 ?

Answers (2)

Image Analyst
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.
  5 Comments
Image Analyst
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.

Sign in to comment.


Youssef  Khmou
Youssef Khmou on 27 Jan 2013
Edited: Youssef Khmou on 27 Jan 2013
Hi,
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
SNR=20*log10(Ampiltude²(I)/Amplitude²(noise))
for image processing i think the code is slightly different :
-------------------------------------------------------------------------------
function y=SNR(IMAGE)
maxs=max(IMAGE(:));
mins=min(IMAGE(:));
stdr=std(IMAGE(:));
y=20*log10((maxs-mins)/stdr);
------------------------------------------------------------------------------
An example :
-----------------------------------------------------------------------------
I=im2double(imread('liftingbody.png'));
snr1=snr(I)
J=imnoise(I,'Gaussian');
snr2=snr(J)
-----------------------------------------------------------------------------
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)
maxs=max(IMAGE(:));
mins=min(IMAGE(:));
stdr=std(IMAGE(:));
y=inv(20*log10((maxs-mins)/stdr));

Community Treasure Hunt

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

Start Hunting!