I have gray scale noisy image (2-D). I want to plot Gaussian PDF for this 2-D gray scale noisy image in MATLAB. How I write matlab code for this?

3 views (last 30 days)
I have gray scale noisy image (2-D). I want to plot Gaussian PDF for this 2-D gray scale noisy image in MATLAB. How I write matlab code for this?

Answers (1)

John D'Errico
John D'Errico on 29 Jun 2017
Edited: John D'Errico on 29 Jun 2017
If the image noise is presumed to be i.i.d. Gaussian (independent, identically distributed) then I'd probably do what I did in my estimate noise utility on the FEX. While it works on 1-d data only, the basic idea will still work.
1. Convolve your image with a simple finite difference kernel, like K = [0 1 0;1 -4 1;0 1 0]/sqrt(20). So conv2 will apply here. The convolution will remove any local trends, while leaving behind colored noise. But it will have the same variance as your original noise. Don't forget to convert to doubles first.
2. Unroll the array, because the result will be a simple list of samples from a Gaussian.
3. Trim off the outliers from the sample. That tries to remove any sharp transients from the original image.
4. What remains will be Gaussian variates. Estimate the variance of the Gaussian noise distribution using var. Even better code might try to estimate the variance using a censored Gaussian knowing the trim fraction, but this might be problematic.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!