MATLAB: We need to make type double to calculate PSNR

doubleImage Processing Toolboxpsnr

Why we make the data type double, when we are calculating the psnr of two images. If we are calculating the psnr of two images in given these two conditions the result is not same, why? i) When images are in the form of uint8 ii)when images are in the form of double.

Best Answer

The psnr() function in the Image Processing Toolbox does not require that the images be converted to double. I guess it must do that internally. Here's proof:
psnr
Peak Signal-to-Noise Ratio (PSNR)
Syntax
peaksnr = psnr(A,ref)example
peaksnr = psnr(A,ref,peakval)
[peaksnr,snr] = psnr(_)
Image to be analyzed, specified as an N-D numeric matrix.
Data Types: single | double | int16 | uint8 | uint16
Related Question