How can I add gaussian noise to image that are of class double in the range [0, 255]?

7 次查看(过去 30 天)
Hi all,
I have this (I) image which are of class double in the range [0, 255] : {I.mat in the attachments}
I want to add noise using gaussian methods and I can specify a different set of parameters.
List of method to add noise (based on Matlab’s imnoise function):
o params(1) represents the mean of noise for idle pixels
o params(2) represents the variance of noise for idle pixels
o params(3) represents the mean of noise for busy pixels
o params(4) represents the variance of noise for busy pixels
Note: The mean and variance parameters for 'gaussian' in Matlab’s imnoise function are always specified as if the image were of class double in the range [0, 1] – however I has [0, 255].
could you please help me??

采纳的回答

Sourav Bairagya
Sourav Bairagya 2019-12-17
编辑:Sourav Bairagya 2019-12-17
The 'imnoise' function expects input pixel values of data type 'double' and 'single' to be in the range [0, 1]. It also accepts the input of datatype 'uint8' in the range [0,255]. You can use the rescale function to adjust pixel values to the expected range. If any input pixel is of datatype 'double' or 'single' and lies outside [0,1], 'imnoise' function clips that to the expected range before adding noise.
You may convert your image to 'uint8' format and then can feed that to 'imnoise' function.
I = uint8(I);
For more information you can leverage this link:

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by