MATLAB: Quick simple question, mean filter

convolutionMATLABmean filternoise

Hello Dear Experts,
Given a convolution mask J = ones(N)/N^2 and image I (with Gaussian noise miu = 0, sigma = alpha) of size MxM M>>N. I am filtering I using the J mask.
How the noise is reduced then? NewNoise = OldNoise/alpha, what is alpha?
For example, I is size NxN with noise, J = ones(5)/25.
Thanks a lot in advance!

Best Answer

Don't use bad names like I and J. Pick descriptive names that aren't easily confused with 1 (one) or the imaginary variable. So, taking that advice:
windowWidth = 5;
kernel = ones(windowWidth) / windowWidth ^2;
outputImage = conv2(inputImage, kernel);