简体   繁体   English

将RMS噪声添加到图像

[英]Adding RMS noise to an image

I have a two dimensional array representing an image. 我有一个代表图像的二维数组。 I have to add background gaussian noise of RMS 2 units to the image. 我必须在图像中添加RMS 2单位的背景高斯噪声。 I am unfamiliar with RMS measurement of noise and how to add it. 我不熟悉噪声的RMS测量以及如何添加噪声。 Can you give me an insight on how to do this ? 你能告诉我如何做到这一点吗?

The way I understand it, you want to add white noise following a Gaussian distribution at every pixel. 我理解它的方式,你想在每个像素的高斯分布后添加白噪声。 That could be achieved by something like this 这可以通过类似的方式实现

from scipy import stats
my_noise=stats.distributions.norm.rvs(0,2,size=your_array.shape)
your_array+=my_noise

Here, 0 is the mean and 2 the standard deviation of your distribution. 这里,0是平均值,2是您的分布的标准差。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM