MATLAB中给图像加高斯噪声时imnoise的方差参数问题
在經(jīng)過(guò)仔細(xì)閱讀文檔后發(fā)現(xiàn),其實(shí)MATLAB的說(shuō)明文檔已經(jīng)寫(xiě)得很清楚,現(xiàn)摘出如下:
J = imnoise(I,type,parameters) Depending on type, you can specify additional parameters to imnoise 《一線大廠Java面試題解析+后端開(kāi)發(fā)學(xué)習(xí)筆記+最新架構(gòu)講解視頻+實(shí)戰(zhàn)項(xiàng)目源碼講義》無(wú)償開(kāi)源 威信搜索公眾號(hào)【編程進(jìn)階路】 . All numerical parameters are normalized— they correspond to operations with images with intensities ranging from 0 to 1.
其中最關(guān)鍵的就是 normalized,即歸一化,方差值在0~1之間。這時(shí)才想起來(lái),關(guān)于gaussian參數(shù)的說(shuō)明:
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.
即默認(rèn)的M,V值分別為0, 0.01(注意此處的方差形式)。
所以最終的結(jié)論就是 需要對(duì)方差歸一化處理 ,比如此處要對(duì)一幅256*256的圖像加入標(biāo)準(zhǔn)偏差為10的高斯噪聲,那么相應(yīng)的語(yǔ)句應(yīng)為:
J = imnoise(I, ‘gaussian’, 0, 102/2552)
總結(jié)
以上是生活随笔為你收集整理的MATLAB中给图像加高斯噪声时imnoise的方差参数问题的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 图标设计思路
- 下一篇: 科技爱好者周刊:第 91 期