在经过仔细阅读文档后发现,其实MATLAB的说明文档已经写得很清楚,现摘出如下:
J = imnoise(I,type,parameters) Depending on type, you can specify additional parameters to imnoise《一线大厂Java面试题解析+后端开发学习笔记+最新架构讲解视频+实战项目源码讲义》无偿开源 威信搜索公众号【编程进阶路】. All numerical parameters are normalized— they correspond to operations with images with intensities ranging from 0 to 1.
其中最关键的就是normalized,即归一化,方差值在0~1之间。这时才想起来,关于gaussian参数的说明:
J = imnoise(I,‘gaussian’,M,V) adds Gaussian white noise of mean m and variance v to the image I. The default is zero mean noise with 0.01 variance.
即默认的M,V值分别为0, 0.01(注意此处的方差形式)。
所以最终的结论就是需要对方差归一化处理,比如此处要对一幅256*256的图像加入标准偏差为10的高斯噪声,那么相应的语句应为:
J = imnoise(I, ‘gaussian’, 0, 102/2552)