I have a noisy image for which I know the noise variance. (Basically I created noisy image by adding noise). Now, I'm downsampling this noisy image. How does the noise variance change? Is it possible to calculate the noise variance in the downsampled noise using equations?
More Details: I'm implementing multiscale SURE Shrink filter in python. I have a clean image from which I create noisy image by adding gaussian noise of variance 100
noise = numpy.random.normal(0, math.sqrt(variance), clean_image.shape) noisy_image = clean_image + noise
This noisy image is the input to my filter. Then I apply a gaussian filter of variance 1 and size 3 to get a lowpass image.
gaussian_kernel = gauss_filt_coeffs(size=3, sigma=1) lowpass_image = cv2.filter2D(noisy_image, -1, gaussian_kernel, borderType=cv2.BORDER_REPLICATE)
The variance of this lowpass image is given as follows:
var_lowpass = var_z * numpy.power(numpy.linalg.norm(gaussian_kernel, ord='fro'), 2)
Now, I downsample this lowpass image
downsampled_image = skimage.transform.rescale(lowpass_image, (0.5, 0.5))
Now, i need to calculate the variance of noise in this downsampled image. How can I do that?
Also, since I have the clean image, I calculated the noise and downsampled it and found its noise. It reduced from 12 to 9.
noise = noisy_image - clean_image gaussian_kernel = gauss_filt_coeffs(size=3, sigma=1) lowpass_noise = cv2.filter2D(noise, -1, gaussian_kernel, borderType=cv2.BORDER_REPLICATE) lowpass_noise.var()*255*255 # Gives 12.744359719236552 downsampled_noise = skimage.transform.rescale(lowpass_noise, (0.5, 0.5)) downsampled_noise.var() * 255 * 255 # 9.190921671981481
Then I tried downsampling by different amounts and see if I can find a pattern here. But it was completely random! (for me) I couldn't find any pattern.