Thursday, May 24, 2018

image processing - Difference between SNR and PSNR


I understood that SNR is the ratio of signal power to the noise power. In terms of images, how the original image is affected by the added noise. In PSNR, we take the square of the peak value in the image (in case of an 8 bit image, the peak value is 255) and divide it by the mean square error. The SNR and PSNR are used to measure the quality of an image after the reconstruction. I understand that higher the SNR or PSNR, the reconstruction is good. What I don't understand is how SNR and PSNR differs in terms of their conclusion about the reconstructed image.



  • What the PSNR of an image concludes that the SNR of the same image can't conclude ?

  • Simply how the conclusion of PSNR differs from the conclusion of SNR?




Answer



Let's start with the mathematical definitions.


Discrete signal power is defined as $$P_s = \sum_{-\infty}^{\infty}s^2[n] = \left|s[n]\right|^2.$$


We can apply this notion to noise $w$ on top of some signal to calculate $P_w$ in the same way. The signal to noise ratio (SNR) is then simply $$P_{SNR}=\frac{P_s}{P_w}$$


If we've received a noise corrupted signal $x[n] = s[n]+w[n]$ then we compute the SNR as follows


$$P_{SNR}=\frac{P_s}{P_w} = \frac{P_s}{\left|x[n]-s[n]\right|^2}.$$


Here $\left|x[n]-s[n]\right|^2$ is simply the squared error between original and corrupted signals. Note that if we scaled the definition of power by the number of points in the signal, this would have been the mean squared error (MSE) but since we're dealing with ratios of powers, the result stays the same.


Let us now interpret this result. This is the ratio of the power of signal to the power of noise. Power is in some sense the squared norm of your signal. It shows how much squared deviation you have from zero on average.


You should also note that we can extend this notion to images by simply summing twice of rows and columns of your image vector, or simply stretching your entire image into a single vector of pixels and apply the one-dimensional definition. You can see that no spacial information is encoded into the definition of power.



Now let's look at peak signal to noise ratio. This definition is


$$P_{PSNR}=\frac{\text{max}(s^2[n])}{\text{MSE}}.$$


If you stare at this for long enough you will realize that this definition is really the same as that of $P_{SNR}$ except that the numerator of the ratio is now the maximum squared intensity of the signal, not the average one. This makes this criterion less strict. You can see that $P_{PSNR} \ge P_{SNR}$ and that they will only be equal to each other if your original clean signal is constant everywhere, and with maximum amplitude. Notice that although the variance of a constant signal is null, its power is not; the level of such constant signal does make a difference in SNR but not in PSNR.


Now, why does this definition make sense? It makes sense because the case of SNR we're looking at how strong the signal is and to how strong the noise is. We assume that there are no special circumstances. In fact, this definition is adapted directly from the physical definition of electrical power. In case of PSNR, we're interested in signal peak because we can be interested in things like the bandwidth of the signal, or number of bits we need to represent it. This is much more content-specific than pure SNR and can find many reasonable applications, image compression being on of them. Here we're saying that what matters is how well high-intensity regions of the image come through the noise, and we're paying much less attention to how we're performing under low intensity.


No comments:

Post a Comment

periodic trends - Comparing radii in lithium, beryllium, magnesium, aluminium and sodium ions

Apparently the of last four, $\ce{Mg^2+}$ is closest in radius to $\ce{Li+}$. Is this true, and if so, why would a whole larger shell ($\ce{...