There are several options (and definitions) for the calculation of the SNR of or in an image.
First, there are two incompatible definitions of the SNR: SNR is frequently (e. g., in many engineering applications) defined as the ratio of the signal power and the noise power (which is consistent with the definition by Gonzalez given above), but – particularly in imaging – an alternative definition can be found, where SNR is given as the ratio of the mean value of the signal and the standard deviation of the noise.
The power ratio (first definition above) is frequently expressed in dB (using the logarithm), while the signal ratio (second definition) is more often given as a number (of dimension 1).
Second, you must define in which part of the image the signal (power or mean value) is determined. Typical choices are: (1) the maximum power or intensity within the image; this gives you the peak-signal-to-noise ratio (PSNR); (2) the mean power or intensity; or (3) the power or signal of a reference structure within the image (e. g., in medical images with large amounts of (zero signal) background this is more useful than including the background into the mean power or signal).
If you already know the noise standard deviation (and the statistical distribution of noise and its spatial distribution – noise may be distributed non-uniformly over the image), then you are done and you can calculate the SNR of your choice. (If you do not know the noise level (standard deviation or variance), it can be difficult to measure it reliably in an image – at least, if you do not have a noise-free image.)
Hi. SNR is a measure independent of the type of noise that you are analyzing, but the significance and usability of the parameter is very dependant of the type of noise. SNR is useful in random and uniformly distributed noise (like gaussian), but in images with other non linear noises (like degradation between a threshold or degradation in a specific area and not the whole image) could give bad results. The formula is from Digital Image Processing (Gonzalez 2007, p. 376), f^ is the noisy image and f is the original image. Good luck!
The SNR is a parameter independent of the type of noise, but its results and usability are very related to how the image is degraded. SNR is useful with uniformly random noise (like gaussian) but give bad results ond localized and non linear degradation (like threshold degradation or loss of a specific area). The formula is from Digital Image Processign (Gonzalez, 2007, p. 376). f^ is the noisy image and f the original image. Good luck!
There are several options (and definitions) for the calculation of the SNR of or in an image.
First, there are two incompatible definitions of the SNR: SNR is frequently (e. g., in many engineering applications) defined as the ratio of the signal power and the noise power (which is consistent with the definition by Gonzalez given above), but – particularly in imaging – an alternative definition can be found, where SNR is given as the ratio of the mean value of the signal and the standard deviation of the noise.
The power ratio (first definition above) is frequently expressed in dB (using the logarithm), while the signal ratio (second definition) is more often given as a number (of dimension 1).
Second, you must define in which part of the image the signal (power or mean value) is determined. Typical choices are: (1) the maximum power or intensity within the image; this gives you the peak-signal-to-noise ratio (PSNR); (2) the mean power or intensity; or (3) the power or signal of a reference structure within the image (e. g., in medical images with large amounts of (zero signal) background this is more useful than including the background into the mean power or signal).
If you already know the noise standard deviation (and the statistical distribution of noise and its spatial distribution – noise may be distributed non-uniformly over the image), then you are done and you can calculate the SNR of your choice. (If you do not know the noise level (standard deviation or variance), it can be difficult to measure it reliably in an image – at least, if you do not have a noise-free image.)
Begin with an original image (lenna). That is, an image who's noise is so low that it could be measured negligible. Use some very high quality, standard or constructed image for this purpose. That's your signal. After processing it with your adaptive median filter, your final image your processed image also has a signal to noise ratio since again you can compare it to your Original image in the same way. It is now meaningful to ask if the SNR has gone up or down and by how much.
It is a real problem to measure and use SNR of images, because as the others have stated, there are more ways than one could wish to measure it and all sorts of ways to use the result inappropriately. First a clarification:
In electrical engineering (my field), power SNR and "voltage" SNR computations result in the same number because power SNR is computed as 10*log(signal/noise) where "log" denotes the base-10 logarithm, "signal" usually denotes a function of the signal such as mean or RMS or some other, taken over a region which can be the entire signal space or a part thereof, and "noise" denotes the same measure of the noise over the same region of signal space. The "voltage" SNR is computed as 20*log(signal/noise) with the same definition of "log", "signal" is now defined as signal power and "noise" is defined as noise power. However, what has not been said is that since power is dissipated by a given resistive load with a given applied voltage, the two values are identical because power is proportional to voltage squared.
However, there is no "resistive load" in an image. So the value of a "power SNR" is meaningless. Thus, in images we should speak of the
in my view. In any case, the discussion is meaningless as an absolute number and is only useful for comparison purposes.
So to the question: if there is so much ambiguity to identifying the measurement method, then perhaps we need to explore the problem further to determine what makes sense in the context of the problem and how we are going to use the resulting values before we try to decide on the "best" measurement method (so-called peak SNR, mean SNR, RMS SNR, etc.) and the inevitable parameters that we will adopt (size of the region, weighting factors, etc.).
My best advice to the original poster is to get a better understanding of the problem. He is attempting to create a transformation that computes a value that is relevant over a selected region of an image, and since relevance begs the question: "Relevant to what?", it is essential that he answers this question first.
I disagree. The acceptable range is whatever allows you to detect, localize and quantify the features of interest to the degree necessary.
Further, it depends on your application. For some applications, binary images are fine. For others, you need 24-bit images with the ENOB at 23 bits or more.
I don't believe that he intensity of the signal is best represented by the mean. That would work well if the probability density function of the signal was symmetrically distributed about the mean of the signal, but that is rare indeed. The question is, what are you trying to accomplish? I submit that a valid SNR measurement is a measure of the "true" signal to the "noise" term. If the "true" signal is known, as is the case with a test image, then there are ways to measure the "true" signal. If the result is going to make sense to human, it must behave somewhat similarly to the human visual system. Generally, a person or people will be called on to judge the result.
Since human vision is based on the change in intensity and not the value in uniform areas (you know this; your eyes acclimatize to the intensity in uniform areas and so you only really see rapid changes in intensity; read Thomas Cornsweet on the Cornsweet Edge, also look for simultaneous contrast), then the "intensity" of the "true" signal is probably best measured as the local standard deviation of the signal measured over area N and averaged over M such areas centred on the pixel of interest. This yields a smoothed measure of the information content that is meaningful to people.
Then it is a simple matter to compute the SNR as the ratio of this measure to the standard deviation of the noise determined over the same areas of size N and averaged over M such areas centred on the pixel of interest.
But what if you don't have a noise-free image? Then some "ad-hoc"-ery must be used. In this case, you will need to find a measure that can separate the edges in the image from the noise field. That requires either 1) some guesses as to the size of the regions to be used, or 2) another measure to separate the image into an estimate of the signal and an estimate of the noise. To create the two estimates, one could use something akin to a Wiener filter or a Kalman filter, or these days a neural net (although that won't tell you a) when it will fail, b) how it will fail, or c) why it came up with the answers that it did; all of which you should know before you trust the result).
Or you could read my paper in the November 1993 issue of IEEE PAMI for a way to find edges in noisy images in a way that is based on the physics of how those edges are created in images. The method can also be modified to measure the amount of noise. That is the way that I would use because it reflects the innate spatial coherence of true edges and the non-coherence of noise-based ones, but of course I am biased.
The Mean Square Error (MSE) and the Peak Signal to Noise Ratio (PSNR) are the two error metrics used to compare image compression quality. The MSE represents the cumulative squared error between the compressed and the original image, whereas PSNR represents a measure of the peak error. The lower the value of MSE, the lower the error.