matlab - 为什么Matlab Gaussian Noise会增加0和255的值?

标签 matlab gaussian noise

我正在尝试将高斯噪声添加到灰度图像,然后显示其直方图。它显示高斯曲线,但有 0 和 255 灰度值的高度。不应该是纯高斯曲线吗?

这是我的代码

clc
clear all

I = imread('lena.tiff');
I = rgb2gray(I);

N = imnoise(I,'gaussian',0,0.025);

figure; [counts,x] = imhist(N);
stem(x,counts);

最佳答案

如 Matlab 手册中所述 (http://nl.mathworks.com/help/images/ref/imnoise.html?searchHighlight=imnoise)

Note The mean and variance parameters for 'gaussian', 'localvar', and 'speckle' noise types are always specified as if the image were of class double in the range [0, 1]. If the input image is of class uint8 or uint16, the imnoise function converts the image to double, adds noise according to the specified type and parameters, and then converts the noisy image back to the same class as the input.

关于matlab - 为什么Matlab Gaussian Noise会增加0和255的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27403689/

相关文章:

python - 如何使用python向wav文件添加噪音?

algorithm - 为什么单纯形噪声似乎比经典的 Perlin 噪声具有*更多*伪像?

algorithm - 如何测量图像噪声

arrays - For 循环对各个时间点进行平均 Matlab

MATLAB:如何重用绘图选项?

复共轭转置matlab到C

ios - CIGaussianBlur 质量 : Banding & Artifacts

swift - 添加高斯模糊到图层背景颜色?

matlab - 无法启动 matlabpool

matlab - Matlab 中的高斯函数有什么不同吗?