How can I add gaussian noise to image that are of class double in the range [0, 255]?
6 views (last 30 days)
Show older comments
Mohammed Alammar
on 14 Dec 2019
Edited: Sourav Bairagya
on 17 Dec 2019
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??
0 Comments
Accepted Answer
Sourav Bairagya
on 17 Dec 2019
Edited: Sourav Bairagya
on 17 Dec 2019
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 Comments
More Answers (0)
See Also
Categories
Find more on 3-D Volumetric Image Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!