2
$\begingroup$

I have been working on image processing. I have an image and then add it a Gaussian noise with standard deviation=0.005. then using averaging filter to denoise it (I know it is not a good idea). then I got negative PSNR. what this means? I think PSNR is a positive measurement. the code for calculating PSNR is as follow:

function psnr1=PSNR(I,J)

mse1=(double(I)-double(J)).^2;
MSE1m=(mse1(:,:,1,:)+mse1(:,:,2,:)+mse1(:,:,3,:))/3;
psnr1=10*log10(255^2/mean(mean(MSE1m)));

end

what is wrong? the final results for my code is these curves: avg means averaging filter is applied and W is window size

$\endgroup$
  • $\begingroup$ If the MSE is very small, then you should most certainly get negative dB values for PSNR. It just means that the smoothing of the small-variance noise does much better than smoothing the noise with the higher variance. $\endgroup$ – Peter K. Apr 14 '15 at 0:01
  • $\begingroup$ @PeterK. but 'I' is my original image and 'J' is noise-reduced form noisy image with noise power=0.005 using an averaging filter. Why it is not negative for avg var=0.05 with the same window size? $\endgroup$ – David Apr 14 '15 at 0:29
  • 1
    $\begingroup$ Remember that dB is the logarithm of a value. A negative log simply means that the original value was less than 1.0. For instance log10(0.0001) = -4. $\endgroup$ – Simon B Apr 14 '15 at 12:11
  • 1
    $\begingroup$ Isn't that 255? Or are you using 16 bit pixels? 255^2 is the square of the largest pixel value...? $\endgroup$ – Peter K. Apr 15 '15 at 15:12
  • 1
    $\begingroup$ @peterk, yes exactly. $\endgroup$ – David Apr 15 '15 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.