# How to calculate variance of noise on a noisy image (Noise+Signal) I have a long exposure image captured at 70ms. (I1) (As attached)

I also have another image captured at 0.7ms with Gain24. (I2) (As attached) This image has both noise and signal together.

I would like to compute SNR value by calculating the variance of the signal I1 and variance of noise (I2-I1). Since the gain and exposure are different, the pixel intensity of my I2 image is different from I1, such that (I2-I1) gives not only noise but also a considerable amount of signal.

Is there a way to only compute noise variance from I2 to find SNR. Which also means is there a way to find the true signal in I2

## 1 Answer

I would assume that I1 and I2 are of the same scene/same lighting conditions/same camera position.

1. In the ideal world images I1 and I2 would have been related by a constant scale factor (+ random noise) so in this case the way to go would be to determine an optimal scale factor that maps I1 into I2 and then estimating noise variance from the difference. This variance would corresponde to the sum of noise variances of your 2 images, but under the assumption that I1 is significantly less noisy this would give a descent estimate

2. In the real world there is a thing called camera response curve that maps scene irradiance to pixel intensity values and it's non linear. In fact there can be many more things involved, like gamma correction, custom postprocessing that is done by your particular camera imaging pipeline. Undoing all this mess to get back to linear situation can be an incredible headache. There are software packages and methods for camera response calibration/estimation of other pipeline parameters so in principle it's possible to calibrate the camera prior to taking the images, then undo the camera response curve/other processing making everything linear and after that you can estimate the noise just as in 1). Check camera response curve on google for more details

3. Applying procedure 1) in the uncalibrated situation gives you a solid overestimate of your noise variance so maybe this would be OK for your purpose.

4. I had situations where I had to estimate noise level of an image given just a single image. Since typical real world images contain a lot of low frequency regions in practice it's sometimes possible to simply process your image with some smoothing filter (linear or for example median) and then analyse the difference between smoothed image and the original one. For example if at least half of your image correspondes to low frequency regions MAD estimate taken from the difference of your image and smoothed version of your image would give you a usable estimate of noise variance.

5. Under the assumption of unknown camera response curve you can take a statistical approach to this problem and try to estimate a model with more parameters than just a single scale factor that maps intensities of I1 to I2. Unfortunately I am not ready to give you the exact parametric form of such a model, since I don't see your data.

Hope this helps!

• Thank you @Gaganov Victor. Your assumption on capturing the same scene, at same lighting condition with the same camera position is right. I did the first approach to get to the scale factor which gives a descent estimate. But when I get the difference between the scaled I1 and I2, I was expecting only random noise, but I also can the image (which also means that the estimate is not enough). I understand this, because it is only an estimate in ideal condition. I calibrated noise in the camera which also gave me an estimate of variance, but I will check the camera response. – Image Check Jul 23 '20 at 1:25
• Also, Thanks for this detailed answer. It is really helpful. What kind of a data is required to consider a statistical approach to estimate a model with more parameters – Image Check Jul 23 '20 at 1:26
• @ImageCheck Simply upload your 2 images and attach them to your post and I will try to suggest an approach that you can take with more certanity. – Gaganov Victor Jul 23 '20 at 8:20
• I attached my images. Thank you so much for helping me out. – Image Check Jul 24 '20 at 5:41
• @ImageCheck, Your image consists entirely of smooth regions, use suggestion 4) from my original answer. If you undersmooth your image you will kinda obtain an underestimate, but if you smooth enough it's going to be fairly accurate. BTW If you use 0.7ms exposure you can take multiple noisy images instead of your single 70ms image and obtain noise variance estimate on a per pixel basis, this way you wouldn't need to guess how much you have to smooth and it's going to be a more solid estimate – Gaganov Victor Jul 25 '20 at 13:28