I'm trying to add random noise to an RGB image without using any built in noise functions.
Show older comments
AddRandomNoise: adds random noise to an image.
function [ outImg ] = addRandomNoise( inImg)
The input image inImg has pixel values between 0 and 255 in all three channels R,G and B. This function adds random noise to each pixel and writes out the new image to outImg. The random noise added should be different for every pixel and it should be in the range [-255, 255].
1 Comment
Nick Hobbs
on 26 Oct 2015
I understand you want to add noise to an image. Can you clarify what type of noise or how the noise should be added? For example, if you look at the following link to the documentation on 'imnoise' it will list a few different options.
Answers (1)
Image Analyst
on 26 Oct 2015
0 votes
Do you mean you can't use imnoise()? Or, even worse, you can't even use rand(), randi(), and randn()? Why don't you want to use them? They make it so easy.
If you're really wanting to write your own random number generator, then you can find algorithms here in Wikipedia: https://en.wikipedia.org/wiki/Random_number_generation
Also see this:
Categories
Find more on Get Started with Image Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!